Browse files

temporary fix the dummy GraphicsContext

  • Loading branch information...
1 parent 9162089 commit c65bee91e35eb6ccbff4e80482878928ffdb3130 @Mailaender committed Sep 12, 2012
View
5 OpenRA.Renderer.Cg/GraphicsDevice.cs
@@ -62,6 +62,11 @@ public GraphicsDevice(Size size, WindowMode window)
surf = SdlGraphics.InitializeSdlGl(ref windowSize, window, extensions);
+ OpenTK.Graphics.GraphicsContext dummyContext = OpenTK.Graphics.GraphicsContext.CreateDummyContext(new OpenTK.ContextHandle(surf));
+ OpenTK.Platform.IWindowInfo windowInfo = OpenTK.Platform.Utilities.CreateDummyWindowInfo();
+ dummyContext.MakeCurrent(windowInfo);
+ OpenTK.Graphics.OpenGL.GL.LoadAll();
+
cgContext = Tao.Cg.Cg.cgCreateContext();
Tao.Cg.Cg.cgSetErrorCallback(CgErrorCallback);
View
5 OpenRA.Renderer.Gl/GraphicsDevice.cs
@@ -50,6 +50,11 @@ public GraphicsDevice(Size size, WindowMode window)
surf = SdlGraphics.InitializeSdlGl(ref windowSize, window, extensions);
+ OpenTK.Graphics.GraphicsContext dummyContext = OpenTK.Graphics.GraphicsContext.CreateDummyContext(new OpenTK.ContextHandle(surf));
+ OpenTK.Platform.IWindowInfo windowInfo = OpenTK.Platform.Utilities.CreateDummyWindowInfo();
+ dummyContext.MakeCurrent(windowInfo);
+ OpenTK.Graphics.OpenGL.GL.LoadAll();
+
GL.EnableClientState(ArrayCap.VertexArray);
ErrorHandler.CheckGlError();
GL.EnableClientState(ArrayCap.TextureCoordArray);
View
9 OpenRA.Renderer.SdlCommon/SdlGraphics.cs
@@ -64,17 +64,12 @@ public static IntPtr InitializeSdlGl( ref Size size, WindowMode window, string[]
if (surf == IntPtr.Zero)
Console.WriteLine("Failed to set video mode.");
- OpenTK.Graphics.GraphicsContext dummyContext = OpenTK.Graphics.GraphicsContext.CreateDummyContext(new OpenTK.ContextHandle(surf));
- OpenTK.Platform.IWindowInfo windowInfo = OpenTK.Platform.Utilities.CreateDummyWindowInfo();
- dummyContext.MakeCurrent(windowInfo);
- OpenTK.Graphics.OpenGL.GL.LoadAll();
-
Sdl.SDL_WM_SetCaption( "OpenRA", "OpenRA" );
Sdl.SDL_ShowCursor( 0 );
Sdl.SDL_EnableUNICODE( 1 );
Sdl.SDL_EnableKeyRepeat( Sdl.SDL_DEFAULT_REPEAT_DELAY, Sdl.SDL_DEFAULT_REPEAT_INTERVAL );
- ErrorHandler.CheckGlError();
+ /*ErrorHandler.CheckGlError();
var extensions = GL.GetString(StringName.Extensions);
if (extensions == null)
@@ -87,7 +82,7 @@ public static IntPtr InitializeSdlGl( ref Size size, WindowMode window, string[]
ErrorHandler.WriteGraphicsLog("Unsupported GPU: Missing extensions: {0}"
.F(missingExtensions.JoinWith(",")));
throw new InvalidProgramException("Unsupported GPU. See graphics.log for details.");
- }
+ }*/
return surf;
}

0 comments on commit c65bee9

Please sign in to comment.