diff --git a/src/Bitmap.h b/src/Bitmap.h index cd1f27b0b..7b36393f4 100644 --- a/src/Bitmap.h +++ b/src/Bitmap.h @@ -95,7 +95,7 @@ BitmapCol BitmapColor_Scale(BitmapCol a, float t); /* A 2D array of BitmapCol pixels */ struct Bitmap { BitmapCol* scan0; int width, height; }; /* Returns number of bytes a bitmap consumes. */ -#define Bitmap_DataSize(width, height) ((cc_uint32)(width) * (cc_uint32)(height) * 4) +#define Bitmap_DataSize(width, height) ((cc_uint32)(width) * (cc_uint32)(height) * BITMAPCOLOR_SIZE) /* Gets the yth row of the given bitmap. */ #define Bitmap_GetRow(bmp, y) ((bmp)->scan0 + (y) * (bmp)->width) /* Gets the pixel at (x,y) in the given bitmap. */ diff --git a/src/Platform.h b/src/Platform.h index 19811dbe6..a884a2379 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -124,6 +124,9 @@ CC_API cc_bool DynamicLib_DescribeError(cc_string* dst); /* The default file extension used for dynamic libraries on this platform. */ extern const cc_string DynamicLib_Ext; +CC_API cc_result DynamicLib_Load(const cc_string* path, void** lib); /* OBSOLETE */ +CC_API cc_result DynamicLib_Get(void* lib, const char* name, void** symbol); /* OBSOLETE */ + #define DYNAMICLIB_QUOTE(x) #x #define DynamicLib_Sym(sym) { DYNAMICLIB_QUOTE(sym), (void**)&_ ## sym } #define DynamicLib_Sym2(name, sym) { name, (void**)&_ ## sym } @@ -131,8 +134,6 @@ extern const cc_string DynamicLib_Ext; #define DynamicLib_SymC(sym) { DYNAMICLIB_QUOTE(_ ## sym), (void**)&_ ## sym } #endif -CC_API cc_result DynamicLib_Load(const cc_string* path, void** lib); /* OBSOLETE */ -CC_API cc_result DynamicLib_Get(void* lib, const char* name, void** symbol); /* OBSOLETE */ /* Contains a name and a pointer to variable that will hold the loaded symbol */ /* static int (APIENTRY *_myGetError)(void); --- (for example) */ /* static struct DynamicLibSym sym = { "myGetError", (void**)&_myGetError }; */ diff --git a/src/Window_Win.c b/src/Window_Win.c index 7824ee8cb..c038ec52a 100644 --- a/src/Window_Win.c +++ b/src/Window_Win.c @@ -824,8 +824,10 @@ void Window_DisableRawMouse(void) { #if CC_GFX_BACKEND_IS_GL() && !defined CC_BUILD_EGL static HGLRC ctx_handle; static HDC ctx_DC; + typedef BOOL (WINAPI *FP_SWAPINTERVAL)(int interval); static FP_SWAPINTERVAL wglSwapIntervalEXT; + static void* gl_lib; static void GLContext_SelectGraphicsMode(struct GraphicsMode* mode) { @@ -885,7 +887,7 @@ void GLContext_Free(void) { ctx_handle = NULL; } -static PROC (WINAPI *_wglGetProcAddress)(LPCSTR); +static PROC (WINAPI *_wglGetProcAddress)(LPCSTR func); /* https://www.khronos.org/opengl/wiki/Load_OpenGL_Functions#Windows */ #define GLContext_IsInvalidAddress(ptr) (ptr == (void*)0 || ptr == (void*)1 || ptr == (void*)-1 || ptr == (void*)2)