Commit graph

158 commits

Author SHA1 Message Date
Stephan Unverwerth
e6c0600499 LibGL: Add back face culling functions
Adds all needed functions to support back face culling
and implements back face culling in the SoftwareGLContext.
2021-05-08 10:13:22 +02:00
Ali Mohammad Pur
f601f12801 LibGL: Implement glOrtho and underlying functions 2021-05-08 10:13:22 +02:00
Jesse Buhagiar
f07a7f7b94 LibGL: Impement glLoadMatrixf and underlying function 2021-05-08 10:13:22 +02:00
Jesse Buhagiar
ea0df0b5da LibGL: Implement glScalef 2021-05-08 10:13:22 +02:00
Jesse Buhagiar
55b3ecfbd3 LibGL: Check for matrix stack over/underflow
We now correctly set the gloabl error if we detect that
a matrix stack overflow will occur in `glPushMatrix` or
`glPopMatrix`
2021-05-08 10:13:22 +02:00
Jesse Buhagiar
1959efe063 LibGL: Set GL error on some calls during begin/end
According to the OpenGL 2.x spec, some calls will set the current
global error to `GL_INVALID_OPERATION` if they are used during
a `glBegin`/`glEnd` block.
2021-05-08 10:13:22 +02:00
Jesse Buhagiar
e537e2690a LibGL: Implement glGetError and underlying function
This implements `glGetError` and correctly sets the state machine's
error macro (similar to LibC `errno`) when an invalid operation is
performed. This is reset on completion of a successful operation.
2021-05-08 10:13:22 +02:00
Jesse Buhagiar
4807d32139 LibGL: Implement a basic OpenGL 1.x compatible library
This currently (obviously) doesn't support any actual 3D hardware,
hence all calls are done via software rendering.

Note that any modern constructs such as shaders are unsupported,
as this driver only implements Fixed Function Pipeline functionality.

The library is split into a base GLContext interface and a software
based renderer implementation of said interface. The global glXXX
functions serve as an OpenGL compatible c-style interface to the
currently bound context instance.

Co-authored-by: Stephan Unverwerth <s.unverwerth@gmx.de>
2021-05-08 10:13:22 +02:00