/// <summary>
 /// Gets the location of the parameter in a compiled OpenGL program.
 /// </summary>
 /// <param name="Program">Specifies the shader program that contains this parameter.</param>
 public void GetLocation(GLShaderProgram Program)
 {
     Program.Use();
     if (ProgramId == 0)
     {
         ProgramId = Program.ProgramID;
         Location  = ParamType == ParamType.Uniform ? Program.GetUniformLocation(Name) : Program.GetAttributeLocation(Name);
     }
 }
Beispiel #2
0
 public void Dispose()
 {
     if (_shader != null)
     {
         _shader.Dispose();
         _shader = null;
         DeleteBuffer(_vboHandle);
         DeleteBuffer(_elementsHandle);
         DeleteVertexArray(_vertexArrayObject);
         DeleteTexture(_fontTextureId);
     }
 }
Beispiel #3
0
        public ImGuiGLRenderer(IntPtr window, IntPtr glContext)
        {
            _window    = window;
            _glContext = glContext;

            // compile the shader program
            _shader = new GLShaderProgram(VertexShader, FragmentShader);

            ImGui.SetCurrentContext(ImGui.CreateContext());
            RebuildFontAtlas();
            InitKeyMap();

            _vboHandle         = GenBuffer();
            _elementsHandle    = GenBuffer();
            _vertexArrayObject = GenVertexArray();
        }