Jelle Raaijmakers
401472c9a4
LibGL: Implement glDrawPixels
and add stub for glBitmap
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
c2960e68a8
LibGL: Implement glLightModelf
and glLightModelfv
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
0453cad46c
LibGL: Add stubs for glPushAttrib
and glPopAttrib
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
fbed7a5ba8
LibGL: Implement glLineWidth
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
22f8294a57
LibGL: Implement glLoadMatrixd
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
506abf2a61
LibGL: Implement glIsList
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
17c109f5d7
LibGL: Implement glTranslated
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
9c9fa33495
LibGL: Implement glClearStencil
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
07bf37be75
LibGL: Implement glScaled
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
9dbc8d7e3c
LibGL: Add stubs for glMaterialf
and glMaterialfv
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
4eb6295a57
LibGL: Implement glRasterPos2i
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
78d0674228
LibGL: Implement glNormal3f
and glNormal3fv
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
ea6bcda79c
LibGL: Implement glStencil*
functions
...
This implements the context state for stencil testing functions and
operations. No rasterization is implemented.
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
729349ce78
LibGL: Implement GL_STENCIL_TEST
...
Only the state is implemented; not the rasterization phase.
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
11fea6b597
LibGL: Implement glListBase
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
1056bac49a
LibGL: Implement glCallLists
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
651ea89094
LibGL: Implement glTexCoord2fv
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
315973e73c
LibGL: Implement glColor3ub
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
d38c4ac8b5
LibGL: Add stubs for glLightf
and glLightfv
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
7ac8cd057e
LibGL: Implement glMultMatrixf
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
40724a426f
LibGL: Implement glGetDoublev
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
6d4a5a40a0
LibGL: Define GL_ES_VERSION_2_0
...
GLES 2.0 is a subset of OpenGL, so we allow applications to compile
against LibGL as if it fully supports GLES 2.0.
Additionally, we set the definitions to an integer value of `1` so
applications that check for availability like this...
int main() { return GL_ES_VERSION_2_0; }
...can actually compile. At least ScummVM uses this, and Mesa defines
their constants in the same way:
44b9e11ddb/include/GL/gl.h (L105)
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers
bccfa205d3
LibGL: Improve mipmap lookup in Texture2D
...
We can get rid of a `VERIFY` since we already do this in `Array::at()`.
Also move `::mipmap()` to the header file so it is inlined in
`Sampler2D`.
2021-12-11 23:15:24 +01:00
Jelle Raaijmakers
65cda8e4aa
LibGL: Always inline to_rgba32()
...
This function popped up in profiles.
2021-12-11 23:15:24 +01:00
Jelle Raaijmakers
930782a155
LibGL: Fix scissor box coordinate system
...
We were working with (0, 0) being the top-left of the render target,
but `glScissor` documentation states that this should be the
bottom-left instead.
2021-12-11 23:15:24 +01:00
Jelle Raaijmakers
e967d31a98
LibGL: Remove unused default from rasterizer scissor_box
...
Its value is always set in the constructor.
2021-12-11 23:15:24 +01:00
Jelle Raaijmakers
0be2a76ee7
LibGL: Use simpler syntax for GL_SCISSOR_BOX
retrieval
2021-12-11 23:15:24 +01:00
Jelle Raaijmakers
7ad70f623e
LibGL: Make glDeleteTextures
skip over 0 names
...
As stated in the manual:
glDeleteTextures silently ignores 0's and names that do not
correspond to existing textures.
If we do not skip these 0 names, they end up as invalid free texture
names in our name allocator.
2021-12-11 23:15:24 +01:00
Jelle Raaijmakers
4abd6aa198
LibGL: Remove unnecessary break;
from SoftwareGLContext
2021-12-11 23:15:24 +01:00
Jelle Raaijmakers
d885cc102b
LibGL: Fix a number of enum values in gl.h
...
Their values should match the enum values as defined by the Khronos
Group.
2021-12-11 23:15:24 +01:00
Jelle Raaijmakers
5e370e6f96
LibGL: Implement GL_(UN)PACK_ALIGNMENT
...
These enums are used to indicate byte-alignment when reading from and
to textures. The `GL_UNPACK_ROW_LENGTH` value was reimplemented to
support overriding the source data row width.
2021-12-11 23:15:24 +01:00
Jelle Raaijmakers
0d57f08b98
LibGL: Use Array::back()
for last mipmap selection
2021-12-11 23:15:24 +01:00
Jelle Raaijmakers
e27b077c2a
LibGL: Add GL::present_context()
...
This provides a convenience method that performs the virtual resolution
for `::present` on the provided `GLContext`.
2021-12-01 12:35:08 +01:00
Jelle Raaijmakers
bed0f3466a
LibGL: Remove TextureUnit::unbind_texture()
2021-12-01 10:21:13 +01:00
Jelle Raaijmakers
5788a139d8
LibGL: Implement texture unit texturing states
2021-12-01 10:21:13 +01:00
Hendiadyoin1
76e6ed0d75
LibGL: Mark SoftwareGLContext::gl_scissor as override
...
I do not know how this did not trigger CI up until now...
2021-11-29 23:17:05 +03:30
Stephan Unverwerth
cbf93ee687
LibGL: Initialize all GL context matrices with the identity matrix
2021-11-28 10:07:34 -08:00
Jelle Raaijmakers
bb58f6ccab
LibGL: Implement glScissor()
2021-11-28 09:20:58 -08:00
Andreas Kling
0de33b3d6c
LibGfx: Use ErrorOr<T> for Bitmap::try_create()
...
Another one that was used in a fajillion places.
2021-11-08 00:35:27 +01:00
Jelle Raaijmakers
a36ee213b9
LibGL: Implement glIsEnabled()
2021-10-17 21:01:52 -07:00
Jelle Raaijmakers
b2627c8b74
LibGL: Implement disabling GL_FOG
2021-10-17 21:01:52 -07:00
Jelle Raaijmakers
abaac02c88
LibGL: Correct GL_MODELVIEW and GL_PROJECTION values
...
According to the Khronos group, GL enum values are in the spec:
https://www.khronos.org/registry/OpenGL/docs/enums.html
Not adhering to their values will cause issues with projects that ship
their own copy of `gl.h`, such as ScummVM.
2021-10-17 21:01:52 -07:00
Nico Weber
b8dc3661ac
Libraries: Fix -Wunreachable-code warnings from clang
2021-10-08 23:33:46 +02:00
Linus Groh
496d2e3c29
LibGL: Remove duplicate GLboolean typedef
...
Fixes #10268 .
2021-10-02 21:10:13 +01:00
Nico Weber
de72332920
Libraries: Fix typos
2021-10-01 01:06:40 +01:00
Andreas Kling
6ad427993a
Everywhere: Behaviour => Behavior
2021-09-07 13:53:14 +02:00
Daniel Bertalan
d7b6cc6421
Everywhere: Prevent risky implicit casts of (Nonnull)RefPtr
...
Our existing implementation did not check the element type of the other
pointer in the constructors and move assignment operators. This meant
that some operations that would require explicit casting on raw pointers
were done implicitly, such as:
- downcasting a base class to a derived class (e.g. `Kernel::Inode` =>
`Kernel::ProcFSDirectoryInode` in Kernel/ProcFS.cpp),
- casting to an unrelated type (e.g. `Promise<bool>` => `Promise<Empty>`
in LibIMAP/Client.cpp)
This, of course, allows gross violations of the type system, and makes
the need to type-check less obvious before downcasting. Luckily, while
adding the `static_ptr_cast`s, only two truly incorrect usages were
found; in the other instances, our casts just needed to be made
explicit.
2021-09-03 23:20:23 +02:00
Stephan Unverwerth
e7d3483618
LibGL: Implement glTexSubImage2D
2021-09-02 21:00:24 +04:30
Stephan Unverwerth
1aed453d8c
LibGL: Add GL_TETXURE*_ARB aliases
...
These defines were introduced when multitexturing was only supported via
the extension EXT_multitexture. GLQuake makes use of them.
2021-09-02 21:00:24 +04:30
Stephan Unverwerth
e34fc4e336
LibGL: Support additional enums in glGetIntegerv
...
GL_MAX_TETXURE_UNITS: Returns the available units for multitexturing
GL_MAX_TETXURE_SIZE: Returns the maximum width/height for textures
2021-09-02 21:00:24 +04:30