diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 2b73e6030..18f1ab8af 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -153,6 +153,24 @@ namespace bgfx BGFX_FATAL(m_d3d9, bgfx::Fatal::D3D9_UnableToCreateInterface, "Unable to create Direct3D."); + uint32_t adapterCount = m_d3d9->GetAdapterCount(); + for (uint32_t ii = 0; ii < adapterCount; ++ii) + { + D3DADAPTER_IDENTIFIER9 identifier; + DX_CHECK(m_d3d9->GetAdapterIdentifier(ii, 0, &identifier) ); + + BX_TRACE("Adapter #%d", ii); + BX_TRACE("\tDriver: %s", identifier.Driver); + BX_TRACE("\tDescription: %s", identifier.Description); + BX_TRACE("\tDeviceName: %s", identifier.DeviceName); + BX_TRACE("\tVendorId: 0x%08x, DeviceId: 0x%08x, SubSysId: 0x%08x, Revision: 0x%08x" + , identifier.VendorId + , identifier.DeviceId + , identifier.SubSysId + , identifier.Revision + ); + } + uint32_t behaviorFlags[] = { D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE, diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index bfcf0a8e4..762dd0346 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -10,17 +10,17 @@ # include # include -#if BX_PLATFORM_WINDOWS +#if BGFX_CONFIG_RENDERER_OPENGL # define glClearDepthf(_depth) glClearDepth(_depth) -#endif // BX_PLATFROM_WINDOWS +#endif // BGFX_CONFIG_RENDERER_OPENGL namespace bgfx { -#if BX_PLATFORM_WINDOWS -#define GL_IMPORT(_optional, _proto, _func) _proto _func -#include "glimports.h" -#undef GL_IMPORT -#endif // BX_PLATFORM_WINDOWS +#if BGFX_CONFIG_RENDERER_OPENGL +# define GL_IMPORT(_optional, _proto, _func) _proto _func +# include "glimports.h" +# undef GL_IMPORT +#endif // BGFX_CONFIG_RENDERER_OPENGL typedef void (*PostSwapBuffersFn)(uint32_t _width, uint32_t _height); @@ -254,6 +254,13 @@ namespace bgfx glXMakeCurrent(display, window, m_context); +# define GL_IMPORT(_optional, _proto, _func) \ + { \ + _func = (_proto)glXGetProcAddress((const GLubyte*)#_func); \ + BGFX_FATAL(!_optional && NULL != _func, bgfx::Fatal::OPENGL_UnableToCreateContext, "Failed to create OpenGL context. glXGetProcAddress %s", #_func); \ + } +# include "glimports.h" +# undef GL_IMPORT glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glXSwapBuffers(display, window); @@ -1573,8 +1580,6 @@ namespace bgfx if (key.m_view != view) { - GL_CHECK(glFlush() ); - currentState.clear(); changedFlags = BGFX_STATE_MASK; currentState.m_flags = newFlags; diff --git a/src/renderer_gl.h b/src/renderer_gl.h index 34903ef3f..9f17539e5 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -7,7 +7,7 @@ #define __RENDERER_GL_H__ #if BGFX_CONFIG_RENDERER_OPENGL -# include +# include # include #elif BGFX_CONFIG_RENDERER_OPENGLES # include @@ -65,11 +65,11 @@ namespace bgfx # define GL_CHECK(_call) _call #endif // BGFX_CONFIG_DEBUG -#if BX_PLATFORM_WINDOWS -#define GL_IMPORT(_optional, _proto, _func) extern _proto _func -#include "glimports.h" -#undef GL_IMPORT -#endif // BX_PLATFORM_WINDOWS +#if BGFX_CONFIG_RENDERER_OPENGL +# define GL_IMPORT(_optional, _proto, _func) extern _proto _func +# include "glimports.h" +# undef GL_IMPORT +#endif // BGFX_CONFIG_RENDERER_OPENGL class ConstantBuffer;