Download Now

    Reference IOpenGLContext

    Declared in Codebot.OpenGL.pas on line 4705

    IOpenGLContext provides access to OpenGL rendering and can be obtained by using the OpenGLContextCreate function.
      IOpenGLContext = interface
      public
        function GetCanRender: Boolean;
        procedure SetCanRender(const Value: Boolean);
        function GetCurrent: Boolean;
        procedure SetCurrent(const Value: Boolean);
        function GetVSync: Boolean;
        procedure SetVSync(const Value: Boolean);
        { Calling GetSize returns the size in pixels of the rendering area }
        procedure GetSize(out Width, Height: Integer);
        { Calling Flip switched the fore and back rendering buffers }
        procedure Flip;
        { MakeCurrent is another way to set the context current to True or False }
        procedure MakeCurrent(Value: Boolean);
        { Lock exclusive access for the calling thread }
        procedure Lock;
        { Unlock exclusive access for the calling thread }
        procedure Unlock;
        { CanRender is set to True when a context is ready and is set set to False
          when starting up or shutting down }
        property CanRender: Boolean read GetCanRender write SetCanRender;
        { Current can be used to control if a context current for a thread }
        property Current: Boolean read GetCurrent write SetCurrent;
        { When VSync is True calls to Flip wait for vertical sync before returning }
        property VSync: Boolean read GetVSync write SetVSync;
      end;