1 #include "coregl_wrappath.h"
7 // Symbol definition for override
8 #define _COREGL_SYMBOL(IS_EXTENSION, RET_TYPE, FUNC_NAME, PARAM_LIST) RET_TYPE (*_COREGL_NAME_MANGLE(FUNC_NAME)) PARAM_LIST = NULL;
9 #include "headers/sym.h"
12 typedef struct _GLGlueFakeContext
14 GLuint gl_num_tex_units[1];
15 GLuint gl_num_vertex_attribs[1];
18 GLGlueFakeContext initial_fake_ctx_real;
19 GLGlueFakeContext *initial_fake_ctx = &initial_fake_ctx_real;
23 _get_texture_states(GLenum pname, GLint *params)
25 GLuint cur_active_tex = 0;
27 AST(initial_fake_ctx != NULL);
29 _sym_glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint *)&cur_active_tex);
31 for (i = 0; i < initial_fake_ctx->gl_num_tex_units[0]; i++)
33 _sym_glActiveTexture(GL_TEXTURE0 + i);
34 _sym_glGetIntegerv(pname, &(((GLint *)params)[i]));
36 _sym_glActiveTexture(cur_active_tex);
50 dump_wrap_context_states(int force_output)
52 static struct timeval tv_last = { 0, 0 };
54 if (trace_ctx_flag != 1) return;
56 _sym_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, (GLint *)initial_fake_ctx->gl_num_tex_units);
57 _sym_glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, (GLint *)initial_fake_ctx->gl_num_vertex_attribs);
61 struct timeval tv_now = { 0, 0 };
62 AST(gettimeofday(&tv_now, NULL) == 0);
63 if (tv_now.tv_sec - tv_last.tv_sec < _COREGL_TRACE_OUTPUT_INTERVAL_SEC)
71 LOG("\E[0;40;34m===================================================================================================================\E[0m\n");
72 LOG("\E[0;32;1m State info \E[1;37;1m: (CURRENT BINDED CONTEXT)\E[0m\n");
73 LOG("\E[0;40;34m===================================================================================================================\E[0m\n");
75 #define PRINTF_CHAR_GLenum "%10d"
76 #define PRINTF_CHAR_GLboolean "%10d"
77 #define PRINTF_CHAR_GLint "%10d"
78 #define PRINTF_CHAR_GLsizei "%10u"
79 #define PRINTF_CHAR_GLuint "%10u"
80 #define PRINTF_CHAR_GLuintmask "0x%8X"
82 #define PRINTF_CHAR_GLclampf "%10.6f"
83 #define PRINTF_CHAR_GLfloat "%10.6f"
85 #define PRINTF_CHAR_GLvoidptr "%10p"
87 #define PRINTF_CHAR(type) PRINTF_CHAR_##type
89 #define INITIAL_CTX initial_fake_ctx
91 #define GLUE_STATE(TYPE, NAME, SIZE, ARRAY_SIZE, DEFAULT_STMT, GET_STMT) \
93 TYPE valuedata[SIZE]; \
95 value = valuedata; GET_STMT; value = valuedata; \
96 LOG("\E[0;37;1m %-30.30s : (\E[0m ", #NAME); \
97 for (int i = 0; i < SIZE; i++) \
101 LOG("\n %-30.30s ", "");\
105 LOG("["PRINTF_CHAR(TYPE)"]", value[i]); \
107 LOG(" \E[0;37;1m)\E[0m\n"); \
109 # include "coregl_fastpath_state.h"
112 LOG("\E[0;40;34m===================================================================================================================\E[0m\n");