BMW

Members
  • Content count

    35
  • Joined

  • Last visited

Community Reputation

160 Neutral

About BMW

  • Rank
    Member
  1. Didn't want to repeat question so see here: http://stackoverflow.com/questions/23150123/loading-png-with-stb-image-for-opengl-texture-gives-wrong-colors   Feel free to post answer on here.
  2. Thank you Sir.   I hadn't initialised my translation vector in the Transform class.
  3. Hello All,   I am developing a Minecraft clone in C++/OpenGL on Linux. I am using SDL2 for creating a window and an OpenGL context.   Everything seems to be working - except not all the time. Sometimes when I run my game, it works. The next time I run it, it won't render anything (just the clear color).   You can view the source code of the game on GitHub here: http://github.com/brettmw/cubed   Screenshot of when it's functioning correctly:   And when it's not:  
  4. Thank you.   MaxVertexIndex was 0xFFFE.   Problem Solved.
  5. Creating: g_pD3DDevice->CreateIndexBuffer(size, D3DUSAGE_WRITEONLY | D3DUSAGE_SOFTWAREPROCESSING, D3DFMT_INDEX32, D3DPOOL_DEFAULT, &g_pIB, NULL) Binding: g_pD3DDevice->SetIndices(g_pIB); Drawing: g_pD3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, primitives * 2, 0, primitives); And if it helps, this is how I create the device (the software vertex processing device is used as my hardware doesn't support hardware vertex processing): D3DPRESENT_PARAMETERS D3Dpp; ZeroMemory(&D3Dpp, sizeof(D3DPRESENT_PARAMETERS)); D3Dpp.AutoDepthStencilFormat = D3DFMT_D16; D3Dpp.BackBufferCount = 1; D3Dpp.BackBufferFormat = D3DFMT_X8R8G8B8; D3Dpp.BackBufferHeight = pGame->screenHeight; D3Dpp.BackBufferWidth = pGame->screenWidth; D3Dpp.EnableAutoDepthStencil = TRUE; D3Dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; D3Dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; D3Dpp.Windowed = !pGame->fullscreen; D3Dpp.hDeviceWindow = hWnd; if(!(SUCCEEDED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,     D3DCREATE_MIXED_VERTEXPROCESSING, &D3Dpp, &g_pD3DDevice)))) {     if(!(SUCCEEDED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,         D3DCREATE_SOFTWARE_VERTEXPROCESSING, &D3Dpp, &g_pD3DDevice))))    {         return false;    } }
  6. What??? Apparently my graphics card doesn't support drawing indexed primitives!??! I changed it so that it doesn't use an index buffer (DrawPrimitive rather than DrawIndexedPrimitive) and it fixed the problem.....   So, does my graphics card not support indexing, or am I doing something wrong?
  7. Distant primitives are not rendered, only primitives as close as shown in the second screenshot are drawn.   I am using software vertex processing - CreateDevice() fails with D3DCREATE_HARDWARE_VERTEXPROCESSING.
  8. Fixed function pipeline.   Thanks for replies.
  9. I have tried disabling fog, the problem still existed.   zNear = 0.2f zFar = 300.0f
  10. I am having issues with rendering correctly using the HAL device. Rendering works perfectly with a REF device.   The issue is that most of the geometry is clipped except the part near to the camera, but not too close.   Here are two screenshots illustrating the issue: REF device (correct rendering):   HAL device (incorrect rendering):   I suspect it is a driver issue, but other games run fine. Maybe I am trying to use an unsupported feature? What would cause such an issue as seen above?   EDIT: I have an Intel G33/G31 Express Chipset
  11.   Or a not-so-high level language such as C++ IMO is much better - just as easy to use once you learn it but much more control.
  12. Hi all.   Announcing my Voxel Engine project that I've been working on for the past few weeks. It is no where near finished. It is made in C++ with the Direct3D graphics library.   I have yet to decide a name for it (any suggestions would be much appreciated).   You can follow the development on my youtube channel http://youtube.com/mc838783   Download link is on my youtube channel.
  13. Yup, I added support for negative positions, or rather removed obstacles for them. I made the mistake of limiting the game in the early stages - "i wont need negative positions". However it didn't prove too difficult at all. All I did was changed unsigned ints to ints and remove a few negative-checks, added in a few negative-checkers (-1 off negative numbers because they truncate upwards whereas positive numbers truncate downwards). I am glad that I used the concept of chunks in the early stages.   This seems to have solved the problem.   Here is a video of the game showing off the (semi)infinite terrain generation (although it's very slow at the moment): https://www.youtube.com/watch?v=YONsFIyrCOo