Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

158 Neutral

About Simplicity

  • Rank
  1. Simplicity

    Rendering to a picture box?

    In C#, when you do the "new Device", pass in the PictureBox and the Control parameter: m_D3DDevice = new Device(0, DeviceType.Hardware, pictureBoxD3D, CreateFlags.SoftwareVertexProcessing, m_D3DPP);
  2. Say you have two abstract interfaces IA and IB defined like so: class IA { public: virtual void func1() = 0; }; class IB : public IA { public: virtual void func2() = 0; }; Notice that IB inherits for IA. Now two classes A and B that are the implimentations of IA and IB, respectively. Essentially, A and B inherits from IA and IB, respectively. However, since IB derives from IA, this says that B must implements whatever A implements. So it makes sense that B inherits from A as well: class A : public IA { public: virtual void func1() { //do something } }; class B : public IB, public A { public: virtual void func2(); { //do something } }; Most of you have already see that dreaded inheritage diamond showing up. I've ponder this for a while but can't seem to find a desirable solution. One way is to push the implementation of A onto IA and get rid of A altogether. But that defeats the purpose of having abtract interfaces. Another way is to have IB and B separate from IA and A, but then there will be duplicated code since IB and B needs to support func1(). Does anyone knows a way to solve this peacefully? Thanks.
  3. After I built a Setup project, 2 files (setup.exe and setup.msi) would be created. Is there a way to change the version, description and copyright information of that setup.exe file? Right now they're all tied to Microsoft. From my own research, I suspect that you can change it only if you use other products for packaging, like Inno Setup or Setup Factory. Please correct me if I'm wrong. Much appreciated for your feedback.
  4. Simplicity


    I have created a DLL using Visual Studio, and I have no idea where to set the version number in the project so that people can see the file version when they right-click into the properties page of the DLL. Right now, a DLL in Windows/system/ has 3 tabs (General, Version, and Summary) when you click on properties; while my DLL only shows General and Summary. Any idea? I have similar problem with a "setup" project... where can I set the version number? Thanks, hopefully someone can answer these simple questions for me.
  5. For Visual C++ 2005, let's say I have project A, which is a static library project that exports a A.lib file. In A is the declaration and implementation of several classes. Now I have project B, a DLL project, which links with the A.lib exported from A and export its own B.lib and B.dll. B declares and implements also a set of classes, some of which inherits from A. Now a project C which creates an executable that links with project B. When I try to compile,usage of "functionalities" from A will cause unresolved externals, unless I link C with A as well. This tells me that B isn't statically linking everything from A. How to I configure B to link statically everything from A so that C doesn't need to link with A?
  6. If you have a function that returns some object, but the caller doesn't assign it to anything, will the compiler know so that it treats it as if the function doesn't return anything? For example: LargeObj Function() { //do something return( LarObj ); } void main() { Function(); }
  7. Actually the scheme I used is: The application is abstracted from the DLL through interfaces: psuedo code App: DLLObj* pObj = GetObj(); pObj->CreateOtherObj(); DLL interfaces are classes with pure virtual functions. Then, the implementation are the ones that actually contain STL stuff. And I'm compiling the DLL and the App under "Multithreaded (Debug) DLL" runtime library. For some reason application crashes when dealing with objects that contain STL. In the cases suggested by recompiling the DLL with VC++ 2005, am I not able to supply developers with an API and have them compile their apps using any other compiler?
  8. I've made a DLL library which is compiled in VC++ 2003. When I create an application in VC++ 2005 using the DLL (through dynamic linking) the application crashes at certain point with relation to STL. Has anyone encounter this problem and is there a solution?
  9. Simplicity

    Writing to Texture

    jollyjeffers, the mistakes in the posted code isn't in the actual code. I was just in a hurry when I posted. Anyway, the "real mistake" is here: void VertexListP1TexD3D9::SetTexCoor0( Real32 Tu, Real32 Tv, const MemSize Index ) { VertexP1Tex* pData = NULL; m_pVertexBuffer->GetDataPointer( (void**)&pData ); pData[ Index ].Tu = Tu; pData[ Index ].Tu = Tv; //look here, stupid me!!!!! } Schrompf was right, tex.y is most likely zero in this case. Thanks guys.
  10. Simplicity

    Writing to Texture

    Actually I have the texture coordinates setup correctly: m_pVLRect->SetPosition( Vector3( 1.0f, 1.0f, 0.0f ), 0 ); m_pVLRect->SetTexCoor0( 0.0f, 0.0f, 0 ); m_pVLRect->SetPosition( Vector3( 2.0f, 1.0f, 0.0f ), 1 ); m_pVLRect->SetTexCoor0( 1.0f, 0.0f, 1 ); m_pVLRect->SetPosition( Vector3( 1.0f, 0.0f, 0.0f ), 2 ); m_pVLRect->SetTexCoor0( 0.0f, 1.0f, 2 ); m_pVLRect->SetPosition( Vector3( 2.0f, 0.0f, 0.0f ), 3 ); m_pVLRect->SetTexCoor0( 1.0f, 1.0f, 3 ); *Ignore the code context, just look at the vertex positions and tex coords. I render this as a triangle strip with 2 primitives.
  11. Ok I have a 256x256 texture of 32bits created like so: pD3DDevice->CreateTexture( 256, //Width 256, //Height, 0, //Level D3DUSAGE_DYNAMIC, //Usage D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &pTexture, NULL ); Now I want to write to it: D3DLOCKED_RECT LockedRect; m_pTextureD3D->LockRect( 0, &LockedRect, NULL, 0 ); unsigned32* pTest = (unsigned32*)LockedRect.pBits; for ( unsigned32 j = 0; j < 10; j++ ) { pTest[j] = 0xffff0000; } Basically I want the first 4 "texels" to be red. But for some reason it writes 4 rows. Can anyone help me explain this?
  12. Simplicity

    Vertex Color for Lighting

    Using the glColorMaterial is only for immediate mode isn't it? If I store my vertices in a buffer object and render when necessary, I can't really use glColorMaterial. So there isn't an OpenGL equivalent of D3D renderstate "colorvertex" ?
  13. Is it possible to use vertex color for lighting in OpenGL insteal of material color like in Direct3D? If so, how is it done?
  14. Simplicity


    Where can I get some information on how to program using XInput? I've searched everywhere but seems like there's nothing.
  15. Simplicity

    User Input

    Any documentation on XInput?
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!