Update RGFW

This commit is contained in:
Milan Nikolic 2024-05-09 17:21:05 +02:00
parent 9b53342ac0
commit 4b3ab504c8
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
2 changed files with 27 additions and 35 deletions

View file

@ -130,16 +130,12 @@ extern "C" {
#define RGFW_WINDOWS #define RGFW_WINDOWS
#if defined(_WIN32) #if defined(_WIN32) && !defined(WIN32)
#ifndef WIN32
#define WIN32 #define WIN32
#endif #endif
#endif
#if defined(_WIN64) #if defined(_WIN64)
#ifndef WIN64 //#define WIN64
#define WIN64
#endif
#define _AMD64_ #define _AMD64_
#undef _X86_ #undef _X86_
#else #else
@ -893,13 +889,13 @@ typedef struct { i32 x, y; } RGFW_vector;
typedef void NSApplication; typedef void NSApplication;
typedef void NSScreen; typedef void NSScreen;
typedef void NSEvent; typedef void NSEvent;
//typedef void NSString; typedef void NSString;
typedef void NSOpenGLContext; typedef void NSOpenGLContext;
typedef void NSPasteboard; typedef void NSPasteboard;
typedef void NSColor; typedef void NSColor;
//typedef void NSArray; typedef void NSArray;
typedef void NSImageRep; typedef void NSImageRep;
//typedef void NSImage; typedef void NSImage;
typedef void NSOpenGLView; typedef void NSOpenGLView;
@ -997,29 +993,29 @@ typedef struct { i32 x, y; } RGFW_vector;
/* Creates an Objective-C method (SEL) from a regular C function with the option to set the register name.*/ /* Creates an Objective-C method (SEL) from a regular C function with the option to set the register name.*/
#define si_func_to_SEL_with_name(class_name, register_name, function) si_impl_func_to_SEL_with_name(class_name, register_name":", function) #define si_func_to_SEL_with_name(class_name, register_name, function) si_impl_func_to_SEL_with_name(class_name, register_name":", function)
//NSRect NSMakeRect(double x, double y, double width, double height) { NSRect NSMakeRect(double x, double y, double width, double height) {
//NSRect r; NSRect r;
//r.origin.x = x; r.origin.x = x;
//r.origin.y = y; r.origin.y = y;
//r.size.width = width; r.size.width = width;
//r.size.height = height; r.size.height = height;
//return r; return r;
//} }
//NSPoint NSMakePoint(double x, double y) { NSPoint NSMakePoint(double x, double y) {
//NSPoint point; NSPoint point;
//point.x = x; point.x = x;
//point.y = y; point.y = y;
//return point; return point;
//} }
//NSSize NSMakeSize(double w, double h) { NSSize NSMakeSize(double w, double h) {
//NSSize size; NSSize size;
//size.width = w; size.width = w;
//size.height = h; size.height = h;
//return size; return size;
//} }
void* si_array_init(void* allocator, size_t sizeof_element, size_t count) { void* si_array_init(void* allocator, size_t sizeof_element, size_t count) {
void* array = si_array_init_reserve(sizeof_element, count); void* array = si_array_init_reserve(sizeof_element, count);
@ -6078,7 +6074,7 @@ static HMODULE wglinstance = NULL;
} }
void RGFW_sleep(u32 ms) { void RGFW_sleep(u32 ms) {
#if !defined(_MSC_VER) && !defined(__MINGW32__) #ifndef RGFW_WINDOWS
struct timespec time; struct timespec time;
time.tv_sec = 0; time.tv_sec = 0;
time.tv_nsec = ms * 1000; time.tv_nsec = ms * 1000;

View file

@ -61,15 +61,11 @@ void CloseWindow(void);
#define _XTYPEDEF_FONT #define _XTYPEDEF_FONT
#define RGFW_IMPLEMENTATION #define RGFW_IMPLEMENTATION
#if defined(_WIN32)
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define Rectangle rectangle_win32 #define Rectangle rectangle_win32
#define CloseWindow CloseWindow_win32 #define CloseWindow CloseWindow_win32
#define ShowCursor __imp_ShowCursor #define ShowCursor __imp_ShowCursor
#endif // _WIN32
#define Point NSPOINT #define Point NSPOINT
#define Size NSSIZE #define Size NSSIZE
@ -79,11 +75,11 @@ __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int CodePage,
#include "../external/RGFW.h" #include "../external/RGFW.h"
#undef DrawText #undef DrawText
#undef Rectangle
#undef ShowCursor #undef ShowCursor
#undef CloseWindow #undef CloseWindow
#undef Point #undef Point
#undef Size #undef Size
#undef Rectangle
#define Rectangle struct Rectangle #define Rectangle struct Rectangle
void CloseWindow(void); void CloseWindow(void);