Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphics: attempt to fix build error on win32 #41

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions graphics/include/aw/graphics/gl/api/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,27 @@ using GLcharARB = char;
using GLhalfARB = GLushort;
using GLhalf = GLushort;
using GLfixed = GLint;
using GLintptr = ptrdiff_t;
using GLsizeiptr = ptrdiff_t;
using GLintptrARB = ptrdiff_t;
using GLsizeiptrARB = ptrdiff_t;
using GLintptr = aw::ptrdiff_t;
using GLsizeiptr = aw::ptrdiff_t;
using GLintptrARB = aw::ptrdiff_t;
using GLsizeiptrARB = aw::ptrdiff_t;
using GLint64 = aw::i64;
using GLuint64 = aw::u64;
using GLint64EXT = aw::i64;
using GLuint64EXT = aw::u64;
using GLsync = struct __GLsync*;

#if (AW_PLATFORM == AW_PLATFORM_WIN32)
#define APIENTRY __stdcall
#define AWGL_API __stdcall
#else
#define APIENTRY
#define AWGL_API
#endif

#define AWGL_API APIENTRY

struct _cl_context;
struct _cl_event;
using GLDEBUGPROC = void (APIENTRY *)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
using GLDEBUGPROCARB = void (APIENTRY *)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
using GLDEBUGPROCAMD = void (APIENTRY *)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
using GLDEBUGPROC = void (AWGL_API *)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
using GLDEBUGPROCARB = void (AWGL_API *)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
using GLDEBUGPROCAMD = void (AWGL_API *)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);

using GLhalfNV = unsigned short;
using GLvdpauSurfaceNV = GLintptr;
Expand Down
8 changes: 5 additions & 3 deletions graphics/include/aw/graphics/gl/loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define aw_gl_loader_h
#include <aw/types/unknown.h>
#include <aw/config.h>
#include <type_traits>
namespace aw {
namespace gl {

Expand Down Expand Up @@ -42,8 +43,9 @@ unknown_fn* get_proc_address(const char* name);
#endif//AW_SUPPORT_PLATFORM_X11

namespace gl {
template <typename R, typename...Args>
void get_proc(R(*& func)(Args...), char const* name)
template <typename Function>
requires std::is_function_v<Function>
void get_proc(Function*& func, char const* name)
{
#if AW_SUPPORT_PLATFORM_APPLE
using apple::get_proc_address;
Expand All @@ -52,7 +54,7 @@ void get_proc(R(*& func)(Args...), char const* name)
#elif AW_SUPPORT_PLATFORM_X11
using glx::get_proc_address;
#endif
func = reinterpret_cast<R(*)(Args...)>( get_proc_address(name) );
func = reinterpret_cast<Function*>( get_proc_address(name) );
};
} // namespace gl
} // namespace aw
Expand Down