Example #1
0
		public GraphicsDevice( Size size, WindowMode window )
		{
			Console.WriteLine("Using Cg renderer");
			windowSize = size;

			var extensions = new string[]
			{
				"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 );
		}
Example #2
0
        public SdlGraphics(Size size, WindowMode window, string[] extensions)
        {
            windowSize = size;
            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();
        }
Example #3
0
        public SdlGraphics(Size size, WindowMode window, string[] extensions)
        {
            windowSize = size;
            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();
        }
Example #4
0
        public GraphicsDevice( Size size, WindowMode window )
        {
            Console.WriteLine("Using Gl renderer");
            windowSize = size;

            var extensions = new string[]
            {
                "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 );
        }