[gl_stub] Add a bunch of new stubs

Gets gl_stub working with recent changes to QF.
This commit is contained in:
Bill Currie 2022-05-20 16:27:01 +09:00
parent 87f3c206f1
commit 34da36e1cf
3 changed files with 118 additions and 13 deletions

View file

@ -15,6 +15,7 @@
typedef XID GLXDrawable;
typedef struct __GLXcontextRec *GLXContext;
typedef struct __GLXFBConfigRec *GLXFBConfig;
#define TRACE do { \
puts (__FUNCTION__);\
@ -149,3 +150,48 @@ glXGetConfig (Display *dpy, XVisualInfo *visual, int attrib, int *value )
TRACE;
return 0;
}
GLXFBConfig *
glXChooseFBConfig (Display *dpy, int screen, int *attribList, int *count)
{
if (trace)
TRACE;
GLXFBConfig *cfg = calloc (1, sizeof (GLXFBConfig));
*cfg = (GLXFBConfig) (intptr_t) screen;
return cfg;
}
XVisualInfo *
glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config)
{
XVisualInfo template;
int num_visuals;
int template_mask;
int screen;
if (trace)
TRACE;
screen = (intptr_t) config;
template_mask = 0;
template.visualid =
XVisualIDFromVisual (XDefaultVisual (dpy, screen));
template_mask = VisualIDMask;
return XGetVisualInfo (dpy, template_mask, &template, &num_visuals);
}
int
glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value)
{
if (trace)
TRACE;
return 0;
}
GLXContext
glXCreateContextAttribsARB (Display *dpy, GLXFBConfig cfg, GLXContext ctx, Bool direct, const int *attribs)
{
if (trace)
TRACE;
return (GLXContext)1;
}

View file

@ -227,11 +227,6 @@ norm_glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderb
{
}
void
norm_glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
}
void
norm_glGenBuffers (GLsizei n, GLuint* buffers)
{
@ -1196,7 +1191,7 @@ norm_glGetIntegerv (GLenum pname, GLint * params)
{
switch (pname) {
case GL_MAX_TEXTURE_SIZE:
*params = 512;
*params = 2048;
break;
case GL_UNPACK_ALIGNMENT:
case GL_PACK_ALIGNMENT:
@ -2466,3 +2461,38 @@ void
norm_glPNTrianglesiATI (GLint x, GLint y)
{
}
void
norm_glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
}
void
norm_glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
}
void
norm_glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer)
{
}
void
norm_glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level)
{
}
void
norm_glNamedFramebufferTexture (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level)
{
}
void
norm_glCreateVertexArrays (GLsizei n, GLuint *arrays)
{
}
void
norm_glBindVertexArray (GLuint array)
{
}

View file

@ -256,12 +256,6 @@ trace_glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum render
TRACE;
}
void
trace_glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
TRACE;
}
void
trace_glGenBuffers (GLsizei n, GLuint* buffers)
{
@ -1413,7 +1407,7 @@ trace_glGetIntegerv (GLenum pname, GLint * params)
TRACE;
switch (pname) {
case GL_MAX_TEXTURE_SIZE:
*params = 512;
*params = 2048;
break;
case GL_UNPACK_ALIGNMENT:
case GL_PACK_ALIGNMENT:
@ -2926,3 +2920,38 @@ trace_glPNTrianglesiATI (GLint x, GLint y)
{
TRACE;
}
void
trace_glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
}
void
trace_glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
}
void
trace_glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer)
{
}
void
trace_glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level)
{
}
void
trace_glNamedFramebufferTexture (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level)
{
}
void
trace_glCreateVertexArrays (GLsizei n, GLuint *arrays)
{
}
void
trace_glBindVertexArray (GLuint array)
{
}