mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
LibGL: Implement glGenLists and a few friends
This commit implements glGenLists(), glNewList(), glDeleteLists(), and glCallList(). The 'compiled' records are implemented as a vector of member function pointers and tuples containing their arguments, and a mechanism is implemented to allow the recorded calls to copy-capture values from the time of the call; this is currently only used with glLoadMatrix.
This commit is contained in:
parent
02de813950
commit
720d21411b
6 changed files with 292 additions and 2 deletions
35
Userland/Libraries/LibGL/GLLists.cpp
Normal file
35
Userland/Libraries/LibGL/GLLists.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include "GLContext.h"
|
||||
|
||||
extern GL::GLContext* g_gl_context;
|
||||
|
||||
GLuint glGenLists(GLsizei range)
|
||||
{
|
||||
return g_gl_context->gl_gen_lists(range);
|
||||
}
|
||||
|
||||
void glCallList(GLuint list)
|
||||
{
|
||||
return g_gl_context->gl_call_list(list);
|
||||
}
|
||||
|
||||
void glDeleteLists(GLuint list, GLsizei range)
|
||||
{
|
||||
return g_gl_context->gl_delete_lists(list, range);
|
||||
}
|
||||
|
||||
void glEndList(void)
|
||||
{
|
||||
return g_gl_context->gl_end_list();
|
||||
}
|
||||
|
||||
void glNewList(GLuint list, GLenum mode)
|
||||
{
|
||||
return g_gl_context->gl_new_list(list, mode);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue