change defined() to 0/1 check
This commit is contained in:
parent
f23a900e91
commit
898501e9e1
|
|
@ -85,11 +85,11 @@
|
||||||
// However, it can also reduce overall system performance, because the thread scheduler switches tasks more often
|
// However, it can also reduce overall system performance, because the thread scheduler switches tasks more often
|
||||||
#define SUPPORT_WINMM_HIGHRES_TIMER 1
|
#define SUPPORT_WINMM_HIGHRES_TIMER 1
|
||||||
#endif
|
#endif
|
||||||
#if !defined(SUPPORT_BUSY_WAIT_LOOP) && !SUPPORT_PARTIALBUSY_WAIT_LOOP
|
#if !SUPPORT_BUSY_WAIT_LOOP && !SUPPORT_PARTIALBUSY_WAIT_LOOP
|
||||||
// Use busy wait loop for timing sync, if not defined, a high-resolution timer is set up and used
|
// Use busy wait loop for timing sync, if not defined, a high-resolution timer is set up and used
|
||||||
#define SUPPORT_BUSY_WAIT_LOOP 0 // Disabled by default
|
#define SUPPORT_BUSY_WAIT_LOOP 0 // Disabled by default
|
||||||
#endif
|
#endif
|
||||||
#if !defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) && !SUPPORT_BUSY_WAIT_LOOP
|
#if !SUPPORT_PARTIALBUSY_WAIT_LOOP && !SUPPORT_BUSY_WAIT_LOOP
|
||||||
// Use a partial-busy wait loop, in this case frame sleeps for most of the time,
|
// Use a partial-busy wait loop, in this case frame sleeps for most of the time,
|
||||||
// but then runs a busy loop at the end for accuracy
|
// but then runs a busy loop at the end for accuracy
|
||||||
#define SUPPORT_PARTIALBUSY_WAIT_LOOP 1
|
#define SUPPORT_PARTIALBUSY_WAIT_LOOP 1
|
||||||
|
|
|
||||||
|
|
@ -2049,7 +2049,7 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int
|
||||||
CORE.Input.Mouse.currentButtonState[button] = action;
|
CORE.Input.Mouse.currentButtonState[button] = action;
|
||||||
CORE.Input.Touch.currentTouchState[button] = action;
|
CORE.Input.Touch.currentTouchState[button] = action;
|
||||||
|
|
||||||
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
|
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
|
||||||
// Process mouse events as touches to be able to use mouse-gestures
|
// Process mouse events as touches to be able to use mouse-gestures
|
||||||
GestureEvent gestureEvent = { 0 };
|
GestureEvent gestureEvent = { 0 };
|
||||||
|
|
||||||
|
|
@ -2084,7 +2084,7 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y)
|
||||||
CORE.Input.Mouse.currentPosition.y = (float)y;
|
CORE.Input.Mouse.currentPosition.y = (float)y;
|
||||||
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
|
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
|
||||||
|
|
||||||
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
|
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
|
||||||
// Process mouse events as touches to be able to use mouse-gestures
|
// Process mouse events as touches to be able to use mouse-gestures
|
||||||
GestureEvent gestureEvent = { 0 };
|
GestureEvent gestureEvent = { 0 };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -992,7 +992,7 @@ const char *GetClipboardText(void)
|
||||||
return RGFW_readClipboard(NULL);
|
return RGFW_readClipboard(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SUPPORT_CLIPBOARD_IMAGE)
|
#if SUPPORT_CLIPBOARD_IMAGE
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#define WIN32_CLIPBOARD_IMPLEMENTATION
|
#define WIN32_CLIPBOARD_IMPLEMENTATION
|
||||||
#define WINUSER_ALREADY_INCLUDED
|
#define WINUSER_ALREADY_INCLUDED
|
||||||
|
|
@ -1006,7 +1006,7 @@ const char *GetClipboardText(void)
|
||||||
Image GetClipboardImage(void)
|
Image GetClipboardImage(void)
|
||||||
{
|
{
|
||||||
Image image = { 0 };
|
Image image = { 0 };
|
||||||
#if defined(SUPPORT_CLIPBOARD_IMAGE)
|
#if SUPPORT_CLIPBOARD_IMAGE
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
unsigned long long int dataSize = 0; // moved into _WIN32 scope until other platforms gain support
|
unsigned long long int dataSize = 0; // moved into _WIN32 scope until other platforms gain support
|
||||||
void *fileData = NULL; // moved into _WIN32 scope until other platforms gain support
|
void *fileData = NULL; // moved into _WIN32 scope until other platforms gain support
|
||||||
|
|
@ -1142,7 +1142,7 @@ const char *GetKeyName(int key)
|
||||||
// Register all input events
|
// Register all input events
|
||||||
void PollInputEvents(void)
|
void PollInputEvents(void)
|
||||||
{
|
{
|
||||||
#if defined(SUPPORT_GESTURES_SYSTEM)
|
#if SUPPORT_GESTURES_SYSTEM
|
||||||
// NOTE: Gestures update must be called every frame to reset gestures correctly
|
// NOTE: Gestures update must be called every frame to reset gestures correctly
|
||||||
// because ProcessGestureEvent() is just called on an event, not every frame
|
// because ProcessGestureEvent() is just called on an event, not every frame
|
||||||
UpdateGestures();
|
UpdateGestures();
|
||||||
|
|
@ -1408,7 +1408,7 @@ void PollInputEvents(void)
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SUPPORT_GESTURES_SYSTEM)
|
#if SUPPORT_GESTURES_SYSTEM
|
||||||
if (touchAction > -1)
|
if (touchAction > -1)
|
||||||
{
|
{
|
||||||
// Process mouse events as touches to be able to use mouse-gestures
|
// Process mouse events as touches to be able to use mouse-gestures
|
||||||
|
|
|
||||||
|
|
@ -405,7 +405,7 @@ const char *GetKeyName(int key)
|
||||||
// Register all input events
|
// Register all input events
|
||||||
void PollInputEvents(void)
|
void PollInputEvents(void)
|
||||||
{
|
{
|
||||||
#if defined(SUPPORT_GESTURES_SYSTEM)
|
#if SUPPORT_GESTURES_SYSTEM
|
||||||
// NOTE: Gestures update must be called every frame to reset gestures correctly
|
// NOTE: Gestures update must be called every frame to reset gestures correctly
|
||||||
// because ProcessGestureEvent() is just called on an event, not every frame
|
// because ProcessGestureEvent() is just called on an event, not every frame
|
||||||
UpdateGestures();
|
UpdateGestures();
|
||||||
|
|
|
||||||
|
|
@ -1564,7 +1564,7 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int
|
||||||
CORE.Input.Mouse.currentButtonState[button] = action;
|
CORE.Input.Mouse.currentButtonState[button] = action;
|
||||||
CORE.Input.Touch.currentTouchState[button] = action;
|
CORE.Input.Touch.currentTouchState[button] = action;
|
||||||
|
|
||||||
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
|
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
|
||||||
// Process mouse events as touches to be able to use mouse-gestures
|
// Process mouse events as touches to be able to use mouse-gestures
|
||||||
GestureEvent gestureEvent = { 0 };
|
GestureEvent gestureEvent = { 0 };
|
||||||
|
|
||||||
|
|
@ -1605,7 +1605,7 @@ static void MouseMoveCallback(GLFWwindow *window, double x, double y)
|
||||||
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
|
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
|
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
|
||||||
// Process mouse events as touches to be able to use mouse-gestures
|
// Process mouse events as touches to be able to use mouse-gestures
|
||||||
GestureEvent gestureEvent = { 0 };
|
GestureEvent gestureEvent = { 0 };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1457,7 +1457,7 @@ static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
|
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
|
||||||
// Process mouse events as touches to be able to use mouse-gestures
|
// Process mouse events as touches to be able to use mouse-gestures
|
||||||
GestureEvent gestureEvent = { 0 };
|
GestureEvent gestureEvent = { 0 };
|
||||||
|
|
||||||
|
|
@ -1529,7 +1529,7 @@ static EM_BOOL EmscriptenMouseMoveCallback(int eventType, const EmscriptenMouseE
|
||||||
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
|
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
|
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
|
||||||
// Process mouse events as touches to be able to use mouse-gestures
|
// Process mouse events as touches to be able to use mouse-gestures
|
||||||
GestureEvent gestureEvent = { 0 };
|
GestureEvent gestureEvent = { 0 };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1607,7 +1607,7 @@ int GetFPS(void)
|
||||||
{
|
{
|
||||||
int fps = 0;
|
int fps = 0;
|
||||||
|
|
||||||
#if !defined(SUPPORT_CUSTOM_FRAME_CONTROL)
|
#if !SUPPORT_CUSTOM_FRAME_CONTROL
|
||||||
#define FPS_CAPTURE_FRAMES_COUNT 30 // 30 captures
|
#define FPS_CAPTURE_FRAMES_COUNT 30 // 30 captures
|
||||||
#define FPS_AVERAGE_TIME_SECONDS 0.5f // 500 milliseconds
|
#define FPS_AVERAGE_TIME_SECONDS 0.5f // 500 milliseconds
|
||||||
#define FPS_STEP (FPS_AVERAGE_TIME_SECONDS/FPS_CAPTURE_FRAMES_COUNT)
|
#define FPS_STEP (FPS_AVERAGE_TIME_SECONDS/FPS_CAPTURE_FRAMES_COUNT)
|
||||||
|
|
@ -4582,7 +4582,7 @@ static void RecordAutomationEvent(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SUPPORT_MODULE_RTEXT)
|
#if !SUPPORT_MODULE_RTEXT
|
||||||
// Formatting of text with variables to 'embed'
|
// Formatting of text with variables to 'embed'
|
||||||
// WARNING: String returned will expire after this function is called MAX_TEXTFORMAT_BUFFERS times
|
// WARNING: String returned will expire after this function is called MAX_TEXTFORMAT_BUFFERS times
|
||||||
const char *TextFormat(const char *text, ...)
|
const char *TextFormat(const char *text, ...)
|
||||||
|
|
|
||||||
|
|
@ -71,31 +71,31 @@
|
||||||
#include <stdio.h> // Required for: sprintf() [Used in ExportImageAsCode()]
|
#include <stdio.h> // Required for: sprintf() [Used in ExportImageAsCode()]
|
||||||
|
|
||||||
// Support only desired texture formats on stb_image
|
// Support only desired texture formats on stb_image
|
||||||
#if !defined(SUPPORT_FILEFORMAT_BMP)
|
#if !SUPPORT_FILEFORMAT_BMP
|
||||||
#define STBI_NO_BMP
|
#define STBI_NO_BMP
|
||||||
#endif
|
#endif
|
||||||
#if !defined(SUPPORT_FILEFORMAT_PNG)
|
#if !SUPPORT_FILEFORMAT_PNG
|
||||||
#define STBI_NO_PNG
|
#define STBI_NO_PNG
|
||||||
#endif
|
#endif
|
||||||
#if !defined(SUPPORT_FILEFORMAT_TGA)
|
#if !SUPPORT_FILEFORMAT_TGA
|
||||||
#define STBI_NO_TGA
|
#define STBI_NO_TGA
|
||||||
#endif
|
#endif
|
||||||
#if !defined(SUPPORT_FILEFORMAT_JPG)
|
#if !SUPPORT_FILEFORMAT_JPG
|
||||||
#define STBI_NO_JPEG // Image format .jpg and .jpeg
|
#define STBI_NO_JPEG // Image format .jpg and .jpeg
|
||||||
#endif
|
#endif
|
||||||
#if !defined(SUPPORT_FILEFORMAT_PSD)
|
#if !SUPPORT_FILEFORMAT_PSD
|
||||||
#define STBI_NO_PSD
|
#define STBI_NO_PSD
|
||||||
#endif
|
#endif
|
||||||
#if !defined(SUPPORT_FILEFORMAT_GIF)
|
#if !SUPPORT_FILEFORMAT_GIF
|
||||||
#define STBI_NO_GIF
|
#define STBI_NO_GIF
|
||||||
#endif
|
#endif
|
||||||
#if !defined(SUPPORT_FILEFORMAT_PIC)
|
#if !SUPPORT_FILEFORMAT_PIC
|
||||||
#define STBI_NO_PIC
|
#define STBI_NO_PIC
|
||||||
#endif
|
#endif
|
||||||
#if !defined(SUPPORT_FILEFORMAT_HDR)
|
#if !SUPPORT_FILEFORMAT_HDR
|
||||||
#define STBI_NO_HDR
|
#define STBI_NO_HDR
|
||||||
#endif
|
#endif
|
||||||
#if !defined(SUPPORT_FILEFORMAT_PNM)
|
#if !SUPPORT_FILEFORMAT_PNM
|
||||||
#define STBI_NO_PNM
|
#define STBI_NO_PNM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -150,11 +150,11 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(SUPPORT_FILEFORMAT_DDS) || \
|
#if (SUPPORT_FILEFORMAT_DDS || \
|
||||||
defined(SUPPORT_FILEFORMAT_PKM) || \
|
SUPPORT_FILEFORMAT_PKM || \
|
||||||
defined(SUPPORT_FILEFORMAT_KTX) || \
|
SUPPORT_FILEFORMAT_KTX || \
|
||||||
defined(SUPPORT_FILEFORMAT_PVR) || \
|
SUPPORT_FILEFORMAT_PVR || \
|
||||||
defined(SUPPORT_FILEFORMAT_ASTC))
|
SUPPORT_FILEFORMAT_ASTC)
|
||||||
|
|
||||||
#if defined(__GNUC__) // GCC and Clang
|
#if defined(__GNUC__) // GCC and Clang
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user