Quake II RTX doxygen  1.0 dev
dynamic.c File Reference
#include "shared/shared.h"
#include "common/common.h"
#include "client/video.h"
#include "dynamic.h"

Go to the source code of this file.

Macros

#define QGL(x)   qgl##x##_t qgl##x
 
#define QGL(x)   qgl##x = NULL
 
#define GCA(x)   VID_GetCoreAddr("gl"#x)
 
#define GPA(x)   VID_GetProcAddr("gl"#x)
 
#define QGL(x)   if ((qgl##x = GCA(x)) == NULL) return qfalse;
 
#define QGL(x)   qgl##x = GPA(x)
 

Functions

void QGL_Shutdown (void)
 
void QGL_ShutdownExtensions (unsigned mask)
 
qboolean QGL_Init (void)
 
void QGL_InitExtensions (unsigned mask)
 
unsigned QGL_ParseExtensionString (const char *s)
 

Variables

QGL_core_IMP QGL_ARB_fragment_program_IMP QGL_ARB_multitexture_IMP QGL_ARB_vertex_buffer_object_IMP QGL_EXT_compiled_vertex_array_IMP qglGenerateMipmap_t qglGenerateMipmap
 

Macro Definition Documentation

◆ GCA

#define GCA (   x)    VID_GetCoreAddr("gl"#x)

Definition at line 667 of file dynamic.c.

◆ GPA

#define GPA (   x)    VID_GetProcAddr("gl"#x)

Definition at line 668 of file dynamic.c.

◆ QGL [1/4]

#define QGL (   x)    qgl##x##_t qgl##x

Definition at line 26 of file dynamic.c.

◆ QGL [2/4]

#define QGL (   x)    qgl##x = NULL

Definition at line 26 of file dynamic.c.

◆ QGL [3/4]

#define QGL (   x)    if ((qgl##x = GCA(x)) == NULL) return qfalse;

Definition at line 26 of file dynamic.c.

◆ QGL [4/4]

#define QGL (   x)    qgl##x = GPA(x)

Definition at line 26 of file dynamic.c.

Function Documentation

◆ QGL_Init()

qboolean QGL_Init ( void  )

Definition at line 670 of file dynamic.c.

671 {
672 #ifdef _DEBUG
673 #define QGL(x) if ((qgl##x = dll##x = GCA(x)) == NULL) return qfalse;
674 #else
675 #define QGL(x) if ((qgl##x = GCA(x)) == NULL) return qfalse;
676 #endif
678 #undef QGL
679 
680  return qtrue;
681 }

◆ QGL_InitExtensions()

void QGL_InitExtensions ( unsigned  mask)

Definition at line 683 of file dynamic.c.

684 {
685 #ifdef _DEBUG
686 #define QGL(x) qgl##x = dll##x = GPA(x)
687 #else
688 #define QGL(x) qgl##x = GPA(x)
689 #endif
690  if (mask & QGL_ARB_fragment_program) {
692  }
693 
694  if (mask & QGL_ARB_multitexture) {
696  }
697 
698  if (mask & QGL_ARB_vertex_buffer_object) {
700  }
701 
702  if (mask & QGL_EXT_compiled_vertex_array) {
704  }
705 
706  if (mask & QGL_3_0_core_functions) {
707  qglGenerateMipmap = GPA(GenerateMipmap);
708  }
709 #undef QGL
710 }

Referenced by GL_InitPrograms(), GL_PostInit(), and GL_SetupConfig().

◆ QGL_ParseExtensionString()

unsigned QGL_ParseExtensionString ( const char *  s)

Definition at line 712 of file dynamic.c.

713 {
714  // must match defines in dynamic.h!
715  static const char *const extnames[] = {
716  "GL_ARB_fragment_program",
717  "GL_ARB_multitexture",
718  "GL_ARB_vertex_buffer_object",
719  "GL_EXT_compiled_vertex_array",
720  "GL_EXT_texture_filter_anisotropic",
721  NULL
722  };
723 
724  return Com_ParseExtensionString(s, extnames);
725 }

Referenced by GL_SetupConfig().

◆ QGL_Shutdown()

void QGL_Shutdown ( void  )

Definition at line 631 of file dynamic.c.

632 {
633 #ifdef _DEBUG
634 #define QGL(x) qgl##x = dll##x = NULL
635 #else
636 #define QGL(x) qgl##x = NULL
637 #endif
639 
641 }

◆ QGL_ShutdownExtensions()

void QGL_ShutdownExtensions ( unsigned  mask)

Definition at line 643 of file dynamic.c.

644 {
645  if (mask & QGL_ARB_fragment_program) {
647  }
648 
649  if (mask & QGL_ARB_multitexture) {
651  }
652 
653  if (mask & QGL_ARB_vertex_buffer_object) {
655  }
656 
657  if (mask & QGL_EXT_compiled_vertex_array) {
659  }
660 
661  if (mask & QGL_3_0_core_functions) {
662  qglGenerateMipmap = NULL;
663  }
664 #undef QGL
665 }

Referenced by GL_ShutdownPrograms(), QGL_Shutdown(), and R_Shutdown_GL().

Variable Documentation

◆ qglGenerateMipmap

QGL_ARB_fragment_program_IMP
#define QGL_ARB_fragment_program_IMP
Definition: dynamic.h:118
edict_s::s
entity_state_t s
Definition: g_local.h:954
QGL_3_0_core_functions
#define QGL_3_0_core_functions
Definition: dynamic.h:161
GPA
#define GPA(x)
Definition: dynamic.c:668
QGL_EXT_compiled_vertex_array_IMP
#define QGL_EXT_compiled_vertex_array_IMP
Definition: dynamic.h:151
QGL_ARB_multitexture_IMP
#define QGL_ARB_multitexture_IMP
Definition: dynamic.h:132
qglGenerateMipmap
QGL_core_IMP QGL_ARB_fragment_program_IMP QGL_ARB_multitexture_IMP QGL_ARB_vertex_buffer_object_IMP QGL_EXT_compiled_vertex_array_IMP qglGenerateMipmap_t qglGenerateMipmap
Definition: dynamic.c:34
QGL_ARB_fragment_program
#define QGL_ARB_fragment_program
Definition: dynamic.h:155
QGL_ARB_vertex_buffer_object_IMP
#define QGL_ARB_vertex_buffer_object_IMP
Definition: dynamic.h:137
QGL_ShutdownExtensions
void QGL_ShutdownExtensions(unsigned mask)
Definition: dynamic.c:643
QGL_core_IMP
#define QGL_core_IMP
Definition: dynamic.h:37
QGL_ARB_vertex_buffer_object
#define QGL_ARB_vertex_buffer_object
Definition: dynamic.h:157
QGL_ARB_multitexture
#define QGL_ARB_multitexture
Definition: dynamic.h:156
QGL_EXT_compiled_vertex_array
#define QGL_EXT_compiled_vertex_array
Definition: dynamic.h:158