Skip to content

Commit

Permalink
Merge pull request #3 from grahamsellers/master
Browse files Browse the repository at this point in the history
Fix calling conventions for GL functions.
  • Loading branch information
vMcJohn committed May 22, 2014
2 parents c2f49d8 + 56d9348 commit 5d948b3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
7 changes: 7 additions & 0 deletions src/voglcommon/gl_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,14 @@ struct _cl_event;

typedef GLintptr GLvdpauSurfaceNV;

#ifndef GLAPIENTRY
#if (VOGL_PLATFORM_HAS_WGL)
#define GLAPIENTRY __stdcall
#else
#define GLAPIENTRY
#endif
#endif

typedef void(GLAPIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam);
typedef void(GLAPIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam);
typedef void(GLAPIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam);
Expand Down
4 changes: 2 additions & 2 deletions src/voglcommon/vogl_entrypoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static void *g_gl_func_epilog_func_user_data;
// a user provided prolog/epilog funcs. This is where the *actual* GL/GLX driver funcs are called.
//----------------------------------------------------------------------------------------------------------------------
#define DEF_PROTO(exported, category, ret, ret_type, num_params, func_name, args, params) \
static ret VOGL_GLUER(vogl_direct_wrapper_, func_name) args \
static ret GLAPIENTRY VOGL_GLUER(vogl_direct_wrapper_, func_name) args \
{ \
void *pStack_data = NULL; \
if (g_gl_func_prolog_func_ptr) \
Expand All @@ -61,7 +61,7 @@ static void *g_gl_func_epilog_func_user_data;
}

#define DEF_PROTO_VOID(exported, category, ret, ret_type, num_params, func_name, args, params) \
static void VOGL_GLUER(vogl_direct_wrapper_, func_name) args \
static void GLAPIENTRY VOGL_GLUER(vogl_direct_wrapper_, func_name) args \
{ \
void *pStack_data = NULL; \
if (g_gl_func_prolog_func_ptr) \
Expand Down
4 changes: 2 additions & 2 deletions src/voglcommon/vogl_entrypoints.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
// define GL/GLX function pointer typedefs, i.e. glXGetProcAddress_func_ptr_t
//----------------------------------------------------------------------------------------------------------------------

#define DEF_PROTO(exported, category, ret, ret_type, num_params, name, args, params) typedef ret(*name##_func_ptr_t) args;
#define DEF_PROTO_VOID(exported, category, ret, ret_type, num_params, name, args, params) typedef ret(*name##_func_ptr_t) args;
#define DEF_PROTO(exported, category, ret, ret_type, num_params, name, args, params) typedef ret(GLAPIENTRY *name##_func_ptr_t) args;
#define DEF_PROTO_VOID(exported, category, ret, ret_type, num_params, name, args, params) typedef ret(GLAPIENTRY *name##_func_ptr_t) args;
#include "gl_glx_wgl_protos.inc"
#undef DEF_PROTO
#undef DEF_PROTO_VOID
Expand Down
4 changes: 2 additions & 2 deletions src/voglcommon/vogl_gl_replayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1303,8 +1303,8 @@ class vogl_gl_replayer
status_t switch_contexts(vogl_trace_context_ptr_value trace_context);

// Loosely derived from http://www.altdevblogaday.com/2011/06/23/improving-opengl-error-messages/
static void debug_callback_arb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *pUser_param);
static void debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *pUser_param);
static void GLAPIENTRY debug_callback_arb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *pUser_param);
static void GLAPIENTRY debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *pUser_param);

bool is_extension_supported(const char *pExt);

Expand Down
2 changes: 1 addition & 1 deletion src/voglcommon/vogl_gl_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ void vogl_format_debug_output_arb(char out_str[], size_t out_str_size, GLenum so
//----------------------------------------------------------------------------------------------------------------------
// vogl_generic_arb_debug_callback
//----------------------------------------------------------------------------------------------------------------------
void vogl_generic_arb_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *pUser_param)
void GLAPIENTRY vogl_generic_arb_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *pUser_param)
{
VOGL_FUNC_TRACER

Expand Down
2 changes: 1 addition & 1 deletion src/voglcommon/vogl_gl_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ inline bool vogl_json_deserialize_vec4F(const json_node &src_node, vec4F &vec)
// vogl_format_debug_output_arb
//----------------------------------------------------------------------------------------------------------------------
void vogl_format_debug_output_arb(char out_str[], size_t out_str_size, GLenum source, GLenum type, GLuint id, GLenum severity, const char *msg);
void vogl_generic_arb_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *pUser_param);
void GLAPIENTRY vogl_generic_arb_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *pUser_param);
void vogl_enable_generic_context_debug_messages();

//----------------------------------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/vogltrace/vogl_intercept.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2725,7 +2725,7 @@ class vogl_context
int m_current_display_list_handle;
GLenum m_current_display_list_mode;

static void debug_callback_arb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *pUser_param)
static void GLAPIENTRY debug_callback_arb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *pUser_param)
{
(void)length;

Expand Down Expand Up @@ -4198,7 +4198,7 @@ static inline void vogl_write_packet_to_trace(vogl_trace_packet &packet)
// gl/glx override functions
//----------------------------------------------------------------------------------------------------------------------
template <typename GLFuncType, typename ProcNameType>
static GLFuncType vogl_get_proc_address_helper_return_wrapper(GLFuncType (*realGetProcAddressFunc)(ProcNameType), ProcNameType procName)
static GLFuncType vogl_get_proc_address_helper_return_wrapper(GLFuncType (GLAPIENTRY *realGetProcAddressFunc)(ProcNameType), ProcNameType procName)
{
if (!procName)
return NULL;
Expand Down

0 comments on commit 5d948b3

Please sign in to comment.