Skip to content

TSdlGLContext

An OpenGL context.

Definition

Unit: Neslib.Sdl3.Video

type TSdlGLContext = record ... end;

Properties

Name Description
Current The currently active OpenGL context.

Constructors

Name Description
Create Create an OpenGL context for an OpenGL window, and make it current.

Operators

Name Description
Equal(TSdlGLContext, TSdlGLContext) Used to compare against another TSdlGLContext.
Equal(TSdlGLContext, Pointer) Used to compare against nil.
Implicit Used to set the value to nil.
NotEqual(TSdlGLContext, TSdlGLContext) Used to compare against another TSdlGLContext.
NotEqual(TSdlGLContext, Pointer) Used to compare against nil.

Methods

Name Description
Free Free an OpenGL context.
MakeCurrent Set up this OpenGL context for rendering into an OpenGL window.

Property Descriptions

Current

The currently active OpenGL context.

class property Current: TSdlGLContext read GetCurrent

Type: TSdlGLContext

Exceptions

ESdlError: Raised on failure.

See Also

Remarks

This property should only be used on the main thread.


Constructor Descriptions

Create

Create an OpenGL context for an OpenGL window, and make it current.

Windows users new to OpenGL should note that, for historical reasons, GL functions added after OpenGL version 1.1 are not available by default. Those functions must be loaded at run-time, either with an OpenGL extension-handling library or with TSdlGL.GetProcAddress and its related functions.

constructor Create(const AWindow: TSdlWindow)

Parameters

AWindow: TSdlWindow : The window to associate with the context.

Exceptions

ESdlError: Raised on failure.

See Also

Remarks

This constructor should only be called on the main thread.


Operator Descriptions

Equal(TSdlGLContext, TSdlGLContext)

Used to compare against another TSdlGLContext.

class operator Equal(const ALeft, ARight: TSdlGLContext): Boolean; inline; static

Parameters

ALeft: TSdlGLContext

ARight: TSdlGLContext

Returns

Boolean


Equal(TSdlGLContext, Pointer)

Used to compare against nil.

class operator Equal(const ALeft: TSdlGLContext; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TSdlGLContext

ARight: Pointer

Returns

Boolean


Implicit(Pointer)

Used to set the value to nil.

class operator Implicit(const AValue: Pointer): TSdlGLContext; inline; static

Parameters

AValue: Pointer

Returns

TSdlGLContext


NotEqual(TSdlGLContext, TSdlGLContext)

Used to compare against another TSdlGLContext.

class operator NotEqual(const ALeft, ARight: TSdlGLContext): Boolean; inline; static

Parameters

ALeft: TSdlGLContext

ARight: TSdlGLContext

Returns

Boolean


NotEqual(TSdlGLContext, Pointer)

Used to compare against nil.

class operator NotEqual(const ALeft: TSdlGLContext; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TSdlGLContext

ARight: Pointer

Returns

Boolean


Method Descriptions

Free

Free an OpenGL context.

procedure Free; inline

Exceptions

ESdlError: Raised on failure.

See Also

Remarks

This method should only be called on the main thread.


MakeCurrent(TSdlWindow)

Set up this OpenGL context for rendering into an OpenGL window.

This context must have been created with a compatible window.

procedure MakeCurrent(const AWindow: TSdlWindow); inline

Exceptions

ESdlError: Raised on failure.

Parameters

AWindow: TSdlWindow : The window to associate with the context.

Remarks

This method should only be called on the main thread.