summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGL/GLContext.h
AgeCommit message (Collapse)Author
2022-04-17LibGL: Implement `GLContext::frontbuffer()`Jelle Raaijmakers
2022-04-09LibGL: Add stub for glCopyTexSubImage2DJesse Buhagiar
2022-04-09LibGL: Implement `glArrayElement`Jesse Buhagiar
2022-04-09LibGL: Implement `gl_tex_parameterfv`Jesse Buhagiar
This is the vectorized version of `gl_tex_parameter`, which sets the parameters of a texture's sampler. We currently only support one single pname, `GL_TEXTURE_BORDER_COLOR`, which sets the border color of a texel for if it is sampled outside of a mip-map's range.
2022-04-09LibGL: Add stub `glClipPlane`Jesse Buhagiar
2022-04-06LibGL+LibGPU+LibSoftGPU: Load SoftGPU driver dynamicallyStephan Unverwerth
This loads libsoftgpu.so during GLContext creation and instantiates the device class which is then passed into the GLContext constructor.
2022-04-06LibGL+LibGPU+LibSoftGPU: Add virtual base class for devicesStephan Unverwerth
This adds a virtual base class for GPU devices located in LibGPU. The OpenGL context now only talks to this device agnostic interface. Currently the device interface is simply a copy of the existing SoftGPU interface to get things going :^)
2022-04-06LibGL+LibGPU+LibSoftGPU: Move Vertex.h to LibGPUStephan Unverwerth
2022-04-06LibGL+LibGPU+LibSoftGPU: Move Material.h to LibGPUStephan Unverwerth
2022-04-06LibGL+LibGPU+LibSoftGPU: Move Light.h to LibGPUStephan Unverwerth
2022-04-06LibGL+LibGPU+LibSoftGPU: Move DeviceConfig to LibGPUStephan Unverwerth
This introduces a new abstraction layer, LibGPU, that serves as the usermode interface to GPU devices. To get started we just move the DeviceConfig there and make sure everything still works :^)
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-27LibGL: Always normalize vertex attribute dataJelle Raaijmakers
We were normalizing data read from vertex attribute pointers based on their usage, but there is nothing written about this behavior in the spec or in man pages. When we implement `glVertexAttribPointer` however, the user can optionally enable normalization per vertex attribute pointer. This refactors the `VertexAttribPointer` to have a `normalize` field so we can support that future implementation.
2022-03-10LibGL: Keep track of active matrix and stackJelle Raaijmakers
This simplifies a lot of code in `GLContext` and prevents potential errors when testing against the current matrix mode.
2022-03-10LibGL: Only normalize in `glRotate*` if possibleJelle Raaijmakers
Vectors of length 0 cannot be normalized, so prevent dividing by zero in the `glRotate*` API. This fixes the skybox rendering of Quake2.
2022-03-09LibGL: Merge GLContext and SoftwareGLContextStephan Unverwerth
This merges GLContext and SoftwareGLContext into a single GLContext class. Since the hardware abstraction is handled via the GPU device interface we do not need the virtual base of GLContext anymore. All context handling functionality from the old GLContext has been moved into the new version. All methods in GLContext are now non virtual and the class is marked as final.
2022-03-08LibGL: East-const `glTex*` methodsJelle Raaijmakers
2022-01-26LibGL: Implement `glMateriali{v}`Jesse Buhagiar
2022-01-26LibGL: Implement `glLighti{v}`Jesse Buhagiar
2022-01-26LibGL: Implement `glGetMaterial`Jesse Buhagiar
2022-01-26LibGL: Implement `glGetLight`Jesse Buhagiar
2022-01-19LibGL: Add stubs for multitexturing and announce GL_ARB_multitextureStephan Unverwerth
This makes glquake recognize multitexture support and choose the multitexture rendering path.
2022-01-17LibGL+LibSoftGPU: Implement the stencil bufferJelle Raaijmakers
This implements an 8-bit front stencil buffer. Stencil operations are SIMD optimized. LibGL changes include: * New `glStencilMask` and `glStencilMaskSeparate` functions * New context parameter `GL_STENCIL_CLEAR_VALUE`
2022-01-14LibGL: Add context lifetime debug outputJelle Raaijmakers
Also, make `::create_context` return a `NonnullOwnPtr`.
2022-01-13LibGL+LibSoftGPU: Implement `glColorMaterial` and `GL_COLOR_MATERIAL`Jelle Raaijmakers
When `GL_COLOR_MATERIAL` is enabled, specific material parameters can be overwritten by the current color per-vertex during the lighting calculations. Which parameter is controlled by `glColorMaterial`. Also move the lighting calculations _before_ clipping, because the spec says so. As a result, we interpolate the resulting vertex color instead of the input color.
2022-01-13LibGL: Implement glIsTextureLuke Wilde
Required by Xash3D for the r_showtextures command, where it shows every allocated texture on screen. Description of glIsTexture from the spec: "glIsTexture returns GL_TRUE if texture is currently the name of a texture. If texture is zero, or is a non-zero value that is not currently the name of a texture, or if an error occurs, glIsTexture returns GL_FALSE. A name returned by glGenTextures, but not yet associated with a texture by calling glBindTexture, is not the name of a texture." https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glIsTexture.xhtml
2022-01-12Ports+LibGL: Replace LibGL context check by ScummVM patchJelle Raaijmakers
According to the OpenGL spec, invoking functions without an active context results in undefined behavior. Since ScummVM seems to be the only port having issues with our behavior, patch their code instead.
2022-01-12LibGL: Flesh out `glMaterialf{v}`Jesse Buhagiar
These two functions have been turned from stubs into actually doing something. They now set the correspondingmaterial data member based on the value passed into the `pname`argument. Co-authored-by: Stephan Unverwerth <s.unverwerth@serenityos.org>
2022-01-12LibGL: Implement `glLightf{v}` and fix `gl.h` prototypeJesse Buhagiar
This implements the `glLightf{v}` family of functions used to set lighting parameters per light in the GL. It also fixes an incorrect prototype for the user exposed version of `glLightf{v}` in which `params` was not marked as `const`.
2021-12-30LibGL: Change `gl_tex_gen` param to `GLint`Jelle Raaijmakers
The singular form of `glTexGeni/f/d` only supports constants, not floating point values as its parameter.
2021-12-27LibGL: Stub more API callsJelle Raaijmakers
These stubs are largely implemented the same: their API is exposed, but they print to the debug console and sometimes `TODO()`. These changes allow GLU and Tux Racer to build. Methods stubbed: * `glTexImage1D` * `glTexImage3D` * `glTexCoord2d(v)` * `glNormalPointer` * `glTexGen(d|f|i)` * `glTexGenfv`
2021-12-27LibGL: Implement `glGetTexLevelParameteriv`Jelle Raaijmakers
2021-12-27LibGL: Implement `glRectf` and `glRecti`Jelle Raaijmakers
2021-12-27LibGL: Add glext.h and lots of new defines in gl.hJelle Raaijmakers
These constants are used by GLU and Tux Racer.
2021-12-12LibGL: Support missing context in `glGetError` and `glGetIntegerv`Jelle Raaijmakers
In its current state, ScummVM seems to invoke these methods just after destroying the current GL context. According to the OpenGL spec: "Issuing GL commands when the program does not have a current context results in undefined behavior, up to and including program termination." Our old behavior was to deref a `nullptr`, which isn't that great. For now, protect these two methods. If other ports seem to misbehave as well, we can always expand the check to other methods.
2021-12-12LibGL: Add stub for `glCopyTexImage2D`Jelle Raaijmakers
2021-12-12LibGL: Implement `glDrawPixels` and add stub for `glBitmap`Jelle Raaijmakers
2021-12-12LibGL: Implement `glLightModelf` and `glLightModelfv`Jelle Raaijmakers
2021-12-12LibGL: Add stubs for `glPushAttrib` and `glPopAttrib`Jelle Raaijmakers
2021-12-12LibGL: Implement `glLineWidth`Jelle Raaijmakers
2021-12-12LibGL: Implement `glIsList`Jelle Raaijmakers
2021-12-12LibGL: Implement `glClearStencil`Jelle Raaijmakers
2021-12-12LibGL: Add stubs for `glMaterialf` and `glMaterialfv`Jelle Raaijmakers
2021-12-12LibGL: Implement `glRasterPos2i`Jelle Raaijmakers
2021-12-12LibGL: Implement `glNormal3f` and `glNormal3fv`Jelle Raaijmakers
2021-12-12LibGL: Implement `glStencil*` functionsJelle Raaijmakers
This implements the context state for stencil testing functions and operations. No rasterization is implemented.
2021-12-12LibGL: Implement `glListBase`Jelle Raaijmakers
2021-12-12LibGL: Implement `glCallLists`Jelle Raaijmakers
2021-12-12LibGL: Implement `glMultMatrixf`Jelle Raaijmakers
2021-12-12LibGL: Implement `glGetDoublev`Jelle Raaijmakers