コード例 #1
0
ファイル: GL.cs プロジェクト: xdinos/SDL2Experiments
        internal static void LoadEntryPoints()
        {
            if (Viewport == null)
            {
                Viewport = LoadFunction <ViewportDelegate>("glViewport");
            }
            if (Scissor == null)
            {
                Scissor = LoadFunction <ScissorDelegate>("glScissor");
            }
            //if (MakeCurrent == null)
            //	MakeCurrent = LoadFunction<MakeCurrentDelegate>("glMakeCurrent");

            GetError = LoadFunction <GetErrorDelegate>("glGetError");

            EnableVertexAttribArray  = LoadFunction <EnableVertexAttribArrayDelegate>("glEnableVertexAttribArray");
            DisableVertexAttribArray = LoadFunction <DisableVertexAttribArrayDelegate>("glDisableVertexAttribArray");

            _getStringInternal = LoadFunction <GetStringDelegate>("glGetString");

            ClearDepth = LoadFunction <ClearDepthDelegate>("glClearDepth")
                         ?? LoadFunction <ClearDepthDelegate>("glClearDepthf");

            Clear        = LoadFunction <ClearDelegate>("glClear");
            ClearColor   = LoadFunction <ClearColorDelegate>("glClearColor");
            ClearStencil = LoadFunction <ClearStencilDelegate>("glClearStencil");

            Enable  = LoadFunction <EnableDelegate>("glEnable");
            Disable = LoadFunction <DisableDelegate>("glDisable");

            BindBuffer = LoadFunction <BindBufferDelegate>("glBindBuffer");
            //DrawBuffers = LoadFunction<DrawBuffersDelegate>("glDrawBuffers");
            //DrawElements = LoadFunction<DrawElementsDelegate>("glDrawElements");
            DrawArrays = LoadFunction <DrawArraysDelegate>("glDrawArrays");
            //Uniform1i = LoadFunction<Uniform1iDelegate>("glUniform1i");
            //Uniform4fv = LoadFunction<Uniform4fvDelegate>("glUniform4fv");
            //ReadPixelsInternal = LoadFunction<ReadPixelsDelegate>("glReadPixels");

            CreateShader         = LoadFunction <CreateShaderDelegate>("glCreateShader");
            ShaderSourceInternal = LoadFunction <ShaderSourceDelegate>("glShaderSource");
            CompileShader        = LoadFunction <CompileShaderDelegate>("glCompileShader");

            ColorMask = LoadFunction <ColorMaskDelegate>("glColorMask");
            //TODO: DepthFunc = LoadFunction<DepthFuncDelegate>("glDepthFunc");
            DepthMask = LoadFunction <DepthMaskDelegate>("glDepthMask");

            StencilMask = LoadFunction <StencilMaskDelegate>("glStencilMask");

            GenBuffers = LoadFunction <GenBuffersDelegate>("glGenBuffers");
            BufferData = LoadFunction <BufferDataDelegate>("glBufferData");
            //MapBuffer = LoadFunction<MapBufferDelegate>("glMapBuffer");
            //UnmapBuffer = LoadFunction<UnmapBufferDelegate>("glUnmapBuffer");
            BufferSubData = LoadFunction <BufferSubDataDelegate>("glBufferSubData");
            //DeleteBuffers = LoadFunction<DeleteBuffersDelegate>("glDeleteBuffers");

            VertexAttribPointer = LoadFunction <VertexAttribPointerDelegate>("glVertexAttribPointer");
        }
コード例 #2
0
 static void OpenGLNativeVERSION_2_0Init()
 {
     _BlendEquationSeparate = GetProcAdress< BlendEquationSeparateDelegate >( "glBlendEquationSeparate" );
     _DrawBuffers = GetProcAdress< DrawBuffersDelegate >( "glDrawBuffers" );
     _StencilOpSeparate = GetProcAdress< StencilOpSeparateDelegate >( "glStencilOpSeparate" );
     _StencilFuncSeparate = GetProcAdress< StencilFuncSeparateDelegate >( "glStencilFuncSeparate" );
     _StencilMaskSeparate = GetProcAdress< StencilMaskSeparateDelegate >( "glStencilMaskSeparate" );
     _AttachShader = GetProcAdress< AttachShaderDelegate >( "glAttachShader" );
     _BindAttribLocation = GetProcAdress< BindAttribLocationDelegate >( "glBindAttribLocation" );
     _CompileShader = GetProcAdress< CompileShaderDelegate >( "glCompileShader" );
     _CreateProgram = GetProcAdress< CreateProgramDelegate >( "glCreateProgram" );
     _CreateShader = GetProcAdress< CreateShaderDelegate >( "glCreateShader" );
     _DeleteProgram = GetProcAdress< DeleteProgramDelegate >( "glDeleteProgram" );
     _DeleteShader = GetProcAdress< DeleteShaderDelegate >( "glDeleteShader" );
     _DetachShader = GetProcAdress< DetachShaderDelegate >( "glDetachShader" );
     _DisableVertexAttribArray = GetProcAdress< DisableVertexAttribArrayDelegate >( "glDisableVertexAttribArray" );
     _EnableVertexAttribArray = GetProcAdress< EnableVertexAttribArrayDelegate >( "glEnableVertexAttribArray" );
     _GetActiveAttrib = GetProcAdress< GetActiveAttribDelegate >( "glGetActiveAttrib" );
     _GetActiveUniform = GetProcAdress< GetActiveUniformDelegate >( "glGetActiveUniform" );
     _GetAttachedShaders = GetProcAdress< GetAttachedShadersDelegate >( "glGetAttachedShaders" );
     _GetAttribLocation = GetProcAdress< GetAttribLocationDelegate >( "glGetAttribLocation" );
     _GetProgramiv = GetProcAdress< GetProgramivDelegate >( "glGetProgramiv" );
     _GetProgramInfoLog = GetProcAdress< GetProgramInfoLogDelegate >( "glGetProgramInfoLog" );
     _GetShaderiv = GetProcAdress< GetShaderivDelegate >( "glGetShaderiv" );
     _GetShaderInfoLog = GetProcAdress< GetShaderInfoLogDelegate >( "glGetShaderInfoLog" );
     _GetShaderSource = GetProcAdress< GetShaderSourceDelegate >( "glGetShaderSource" );
     _GetUniformLocation = GetProcAdress< GetUniformLocationDelegate >( "glGetUniformLocation" );
     _GetUniformfv = GetProcAdress< GetUniformfvDelegate >( "glGetUniformfv" );
     _GetUniformiv = GetProcAdress< GetUniformivDelegate >( "glGetUniformiv" );
     _GetVertexAttribdv = GetProcAdress< GetVertexAttribdvDelegate >( "glGetVertexAttribdv" );
     _GetVertexAttribfv = GetProcAdress< GetVertexAttribfvDelegate >( "glGetVertexAttribfv" );
     _GetVertexAttribiv = GetProcAdress< GetVertexAttribivDelegate >( "glGetVertexAttribiv" );
     _GetVertexAttribPointerv = GetProcAdress< GetVertexAttribPointervDelegate >( "glGetVertexAttribPointerv" );
     _IsProgram = GetProcAdress< IsProgramDelegate >( "glIsProgram" );
     _IsShader = GetProcAdress< IsShaderDelegate >( "glIsShader" );
     _LinkProgram = GetProcAdress< LinkProgramDelegate >( "glLinkProgram" );
     _ShaderSource = GetProcAdress< ShaderSourceDelegate >( "glShaderSource" );
     _UseProgram = GetProcAdress< UseProgramDelegate >( "glUseProgram" );
     _Uniform1f = GetProcAdress< Uniform1fDelegate >( "glUniform1f" );
     _Uniform2f = GetProcAdress< Uniform2fDelegate >( "glUniform2f" );
     _Uniform3f = GetProcAdress< Uniform3fDelegate >( "glUniform3f" );
     _Uniform4f = GetProcAdress< Uniform4fDelegate >( "glUniform4f" );
     _Uniform1i = GetProcAdress< Uniform1iDelegate >( "glUniform1i" );
     _Uniform2i = GetProcAdress< Uniform2iDelegate >( "glUniform2i" );
     _Uniform3i = GetProcAdress< Uniform3iDelegate >( "glUniform3i" );
     _Uniform4i = GetProcAdress< Uniform4iDelegate >( "glUniform4i" );
     _Uniform1fv = GetProcAdress< Uniform1fvDelegate >( "glUniform1fv" );
     _Uniform2fv = GetProcAdress< Uniform2fvDelegate >( "glUniform2fv" );
     _Uniform3fv = GetProcAdress< Uniform3fvDelegate >( "glUniform3fv" );
     _Uniform4fv = GetProcAdress< Uniform4fvDelegate >( "glUniform4fv" );
     _Uniform1iv = GetProcAdress< Uniform1ivDelegate >( "glUniform1iv" );
     _Uniform2iv = GetProcAdress< Uniform2ivDelegate >( "glUniform2iv" );
     _Uniform3iv = GetProcAdress< Uniform3ivDelegate >( "glUniform3iv" );
     _Uniform4iv = GetProcAdress< Uniform4ivDelegate >( "glUniform4iv" );
     _UniformMatrix2fv = GetProcAdress< UniformMatrix2fvDelegate >( "glUniformMatrix2fv" );
     _UniformMatrix3fv = GetProcAdress< UniformMatrix3fvDelegate >( "glUniformMatrix3fv" );
     _UniformMatrix4fv = GetProcAdress< UniformMatrix4fvDelegate >( "glUniformMatrix4fv" );
     _ValidateProgram = GetProcAdress< ValidateProgramDelegate >( "glValidateProgram" );
     _VertexAttrib1d = GetProcAdress< VertexAttrib1dDelegate >( "glVertexAttrib1d" );
     _VertexAttrib1dv = GetProcAdress< VertexAttrib1dvDelegate >( "glVertexAttrib1dv" );
     _VertexAttrib1f = GetProcAdress< VertexAttrib1fDelegate >( "glVertexAttrib1f" );
     _VertexAttrib1fv = GetProcAdress< VertexAttrib1fvDelegate >( "glVertexAttrib1fv" );
     _VertexAttrib1s = GetProcAdress< VertexAttrib1sDelegate >( "glVertexAttrib1s" );
     _VertexAttrib1sv = GetProcAdress< VertexAttrib1svDelegate >( "glVertexAttrib1sv" );
     _VertexAttrib2d = GetProcAdress< VertexAttrib2dDelegate >( "glVertexAttrib2d" );
     _VertexAttrib2dv = GetProcAdress< VertexAttrib2dvDelegate >( "glVertexAttrib2dv" );
     _VertexAttrib2f = GetProcAdress< VertexAttrib2fDelegate >( "glVertexAttrib2f" );
     _VertexAttrib2fv = GetProcAdress< VertexAttrib2fvDelegate >( "glVertexAttrib2fv" );
     _VertexAttrib2s = GetProcAdress< VertexAttrib2sDelegate >( "glVertexAttrib2s" );
     _VertexAttrib2sv = GetProcAdress< VertexAttrib2svDelegate >( "glVertexAttrib2sv" );
     _VertexAttrib3d = GetProcAdress< VertexAttrib3dDelegate >( "glVertexAttrib3d" );
     _VertexAttrib3dv = GetProcAdress< VertexAttrib3dvDelegate >( "glVertexAttrib3dv" );
     _VertexAttrib3f = GetProcAdress< VertexAttrib3fDelegate >( "glVertexAttrib3f" );
     _VertexAttrib3fv = GetProcAdress< VertexAttrib3fvDelegate >( "glVertexAttrib3fv" );
     _VertexAttrib3s = GetProcAdress< VertexAttrib3sDelegate >( "glVertexAttrib3s" );
     _VertexAttrib3sv = GetProcAdress< VertexAttrib3svDelegate >( "glVertexAttrib3sv" );
     _VertexAttrib4Nbv = GetProcAdress< VertexAttrib4NbvDelegate >( "glVertexAttrib4Nbv" );
     _VertexAttrib4Niv = GetProcAdress< VertexAttrib4NivDelegate >( "glVertexAttrib4Niv" );
     _VertexAttrib4Nsv = GetProcAdress< VertexAttrib4NsvDelegate >( "glVertexAttrib4Nsv" );
     _VertexAttrib4Nub = GetProcAdress< VertexAttrib4NubDelegate >( "glVertexAttrib4Nub" );
     _VertexAttrib4Nubv = GetProcAdress< VertexAttrib4NubvDelegate >( "glVertexAttrib4Nubv" );
     _VertexAttrib4Nuiv = GetProcAdress< VertexAttrib4NuivDelegate >( "glVertexAttrib4Nuiv" );
     _VertexAttrib4Nusv = GetProcAdress< VertexAttrib4NusvDelegate >( "glVertexAttrib4Nusv" );
     _VertexAttrib4bv = GetProcAdress< VertexAttrib4bvDelegate >( "glVertexAttrib4bv" );
     _VertexAttrib4d = GetProcAdress< VertexAttrib4dDelegate >( "glVertexAttrib4d" );
     _VertexAttrib4dv = GetProcAdress< VertexAttrib4dvDelegate >( "glVertexAttrib4dv" );
     _VertexAttrib4f = GetProcAdress< VertexAttrib4fDelegate >( "glVertexAttrib4f" );
     _VertexAttrib4fv = GetProcAdress< VertexAttrib4fvDelegate >( "glVertexAttrib4fv" );
     _VertexAttrib4iv = GetProcAdress< VertexAttrib4ivDelegate >( "glVertexAttrib4iv" );
     _VertexAttrib4s = GetProcAdress< VertexAttrib4sDelegate >( "glVertexAttrib4s" );
     _VertexAttrib4sv = GetProcAdress< VertexAttrib4svDelegate >( "glVertexAttrib4sv" );
     _VertexAttrib4ubv = GetProcAdress< VertexAttrib4ubvDelegate >( "glVertexAttrib4ubv" );
     _VertexAttrib4uiv = GetProcAdress< VertexAttrib4uivDelegate >( "glVertexAttrib4uiv" );
     _VertexAttrib4usv = GetProcAdress< VertexAttrib4usvDelegate >( "glVertexAttrib4usv" );
     _VertexAttribPointer = GetProcAdress< VertexAttribPointerDelegate >( "glVertexAttribPointer" );
 }