public GraphicsDevice(Size size, WindowMode window) { Console.WriteLine("Using Cg renderer"); windowSize = size; var extensions = new [] { "GL_ARB_vertex_program", "GL_ARB_fragment_program", "GL_ARB_vertex_buffer_object", }; surf = SdlGraphics.InitializeSdlGl(ref windowSize, window, extensions); cgContext = Tao.Cg.Cg.cgCreateContext(); Tao.Cg.Cg.cgSetErrorCallback(CgErrorCallback); Tao.Cg.CgGl.cgGLRegisterStates(cgContext); Tao.Cg.CgGl.cgGLSetManageTextureParameters(cgContext, true); vertexProfile = CgGl.cgGLGetLatestProfile(CgGl.CG_GL_VERTEX); fragmentProfile = CgGl.cgGLGetLatestProfile(CgGl.CG_GL_FRAGMENT); Gl.glEnableClientState(Gl.GL_VERTEX_ARRAY); ErrorHandler.CheckGlError(); Gl.glEnableClientState(Gl.GL_TEXTURE_COORD_ARRAY); ErrorHandler.CheckGlError(); Sdl.SDL_SetModState(0); // i have had enough. input = new SdlInput(surf); }
// This is the main entry point of the application. static void Main(string[] args) { SdlInput.RegisterPlatform(); Console.WriteLine("Hello, world!"); SilkMobile.RunApp(args, Run); Console.WriteLine("Goodbye, world!"); SdlProvider.SDL.Value.ThrowError(); }
public GraphicsDevice(Size size, WindowMode window) { Console.WriteLine("Using Gl renderer"); windowSize = size; var extensions = new [] { "GL_ARB_vertex_shader", "GL_ARB_fragment_shader", "GL_ARB_vertex_buffer_object", }; surf = SdlGraphics.InitializeSdlGl(ref windowSize, window, extensions); Gl.glEnableClientState(Gl.GL_VERTEX_ARRAY); ErrorHandler.CheckGlError(); Gl.glEnableClientState(Gl.GL_TEXTURE_COORD_ARRAY); ErrorHandler.CheckGlError(); Sdl.SDL_SetModState(0); input = new SdlInput(surf); }