Browse Source

GL 3.2 context.

bkaradzic 12 years ago
parent
commit
0d21a23ba7
3 changed files with 4 additions and 3 deletions
  1. 1 1
      src/bgfx.cpp
  2. 2 1
      src/glcontext_wgl.cpp
  3. 1 1
      src/renderer_gl.cpp

+ 1 - 1
src/bgfx.cpp

@@ -264,7 +264,7 @@ namespace bgfx
 		uint8_t* rgba = mem->data;
 		charsetFillTexture(vga8x8, rgba, 8, pitch, bpp);
 		charsetFillTexture(vga8x16, &rgba[8*pitch], 16, pitch, bpp);
-		m_texture = createTexture2D(2048, 24, 1, TextureFormat::L8
+		m_texture = createTexture2D(width, height, 1, TextureFormat::L8
 						, BGFX_TEXTURE_MIN_POINT
 						| BGFX_TEXTURE_MAG_POINT
 						| BGFX_TEXTURE_MIP_POINT

+ 2 - 1
src/glcontext_wgl.cpp

@@ -207,7 +207,7 @@ namespace bgfx
 #else
 				WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
 				WGL_CONTEXT_MINOR_VERSION_ARB, 2,
-				WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
+				WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
 #endif // 1
 #if BGFX_CONFIG_DEBUG
 				WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_DEBUG_BIT_ARB,
@@ -216,6 +216,7 @@ namespace bgfx
 			};
 
 			m_context = wglCreateContextAttribsARB(m_hdc, 0, contextAttrs);
+			BGFX_FATAL(NULL != m_context, Fatal::UnableToInitialize, "Failed to create context.");
 		}
 
 		wglMakeCurrent(NULL, NULL);

+ 1 - 1
src/renderer_gl.cpp

@@ -1946,7 +1946,7 @@ namespace bgfx
 #endif // BGFX_CONFIG_DEBUG
 
 		const char* extensions = (const char*)glGetString(GL_EXTENSIONS);
-		GL_CHECK(;); // check if error is generated by glGetString.
+		glGetError(); // ignore error if glGetString returns NULL.
 		if (NULL != extensions)
 		{
 			char name[1024];