Some defines tweaks for consistency

This commit is contained in:
Ray 2017-05-08 02:47:44 +02:00
parent 83aba22e49
commit 822c2ddad5
4 changed files with 18 additions and 24 deletions

View file

@ -79,7 +79,7 @@
#include "utils.h" // Required for: fopen() Android mapping #include "utils.h" // Required for: fopen() Android mapping
#endif #endif
#ifdef __APPLE__ #if defined(__APPLE__)
#include "OpenAL/al.h" // OpenAL basic header #include "OpenAL/al.h" // OpenAL basic header
#include "OpenAL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work) #include "OpenAL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work)
#else #else
@ -1326,7 +1326,7 @@ void TraceLog(int msgType, const char *text, ...)
va_list args; va_list args;
int traceDebugMsgs = 0; int traceDebugMsgs = 0;
#ifdef DO_NOT_TRACE_DEBUG_MSGS #if defined(DO_NOT_TRACE_DEBUG_MSGS)
traceDebugMsgs = 0; traceDebugMsgs = 0;
#endif #endif

View file

@ -118,7 +118,7 @@
//#define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3 //#define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3
#include <GLFW/glfw3.h> // GLFW3 library: Windows, OpenGL context and Input management #include <GLFW/glfw3.h> // GLFW3 library: Windows, OpenGL context and Input management
#ifdef(__linux__) #if defined(__linux__)
#define GLFW_EXPOSE_NATIVE_X11 // Linux specific definitions for getting #define GLFW_EXPOSE_NATIVE_X11 // Linux specific definitions for getting
#define GLFW_EXPOSE_NATIVE_GLX // native functions like glfwGetX11Window #define GLFW_EXPOSE_NATIVE_GLX // native functions like glfwGetX11Window
#include <GLFW/glfw3native.h> // which are required for hiding mouse #include <GLFW/glfw3native.h> // which are required for hiding mouse
@ -668,7 +668,7 @@ int GetScreenHeight(void)
void ShowCursor() void ShowCursor()
{ {
#if defined(PLATFORM_DESKTOP) #if defined(PLATFORM_DESKTOP)
#ifdef __linux__ #if defined(__linux__)
XUndefineCursor(glfwGetX11Display(), glfwGetX11Window(window)); XUndefineCursor(glfwGetX11Display(), glfwGetX11Window(window));
#else #else
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
@ -681,7 +681,7 @@ void ShowCursor()
void HideCursor() void HideCursor()
{ {
#if defined(PLATFORM_DESKTOP) #if defined(PLATFORM_DESKTOP)
#ifdef __linux__ #if defined(__linux__)
XColor col; XColor col;
const char nil[] = {0}; const char nil[] = {0};
@ -1679,7 +1679,7 @@ static void InitGraphicsDevice(int width, int height)
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); // Choose OpenGL minor version (just hint) glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); // Choose OpenGL minor version (just hint)
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above! glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above!
// Other values: GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE // Other values: GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE
#ifdef __APPLE__ #if defined(__APPLE__)
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires
#else #else
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above! glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above!
@ -1964,7 +1964,7 @@ static void InitGraphicsDevice(int width, int height)
// Set viewport parameters // Set viewport parameters
static void SetupViewport(void) static void SetupViewport(void)
{ {
#ifdef __APPLE__ #if defined(__APPLE__)
// Get framebuffer size of current window // Get framebuffer size of current window
// NOTE: Required to handle HighDPI display correctly on OSX because framebuffer // NOTE: Required to handle HighDPI display correctly on OSX because framebuffer
// is automatically reasized to adapt to new DPI. // is automatically reasized to adapt to new DPI.
@ -3279,7 +3279,7 @@ static void *GamepadThread(void *arg)
// Plays raylib logo appearing animation // Plays raylib logo appearing animation
static void LogoAnimation(void) static void LogoAnimation(void)
{ {
#ifndef PLATFORM_WEB #if !defined(PLATFORM_WEB)
int logoPositionX = screenWidth/2 - 128; int logoPositionX = screenWidth/2 - 128;
int logoPositionY = screenHeight/2 - 128; int logoPositionY = screenHeight/2 - 128;

View file

@ -67,12 +67,12 @@
#include <string.h> // Required for: strcmp(), strlen(), strtok() [Used only in extensions loading] #include <string.h> // Required for: strcmp(), strlen(), strtok() [Used only in extensions loading]
#include <math.h> // Required for: atan2() #include <math.h> // Required for: atan2()
#ifndef RLGL_STANDALONE #if !defined(RLGL_STANDALONE)
#include "raymath.h" // Required for: Vector3 and Matrix functions #include "raymath.h" // Required for: Vector3 and Matrix functions
#endif #endif
#if defined(GRAPHICS_API_OPENGL_11) #if defined(GRAPHICS_API_OPENGL_11)
#ifdef __APPLE__ #if defined(__APPLE__)
#include <OpenGL/gl.h> // OpenGL 1.1 library for OSX #include <OpenGL/gl.h> // OpenGL 1.1 library for OSX
#else #else
#include <GL/gl.h> // OpenGL 1.1 library #include <GL/gl.h> // OpenGL 1.1 library
@ -84,7 +84,7 @@
#endif #endif
#if defined(GRAPHICS_API_OPENGL_33) #if defined(GRAPHICS_API_OPENGL_33)
#ifdef __APPLE__ #if defined(__APPLE__)
#include <OpenGL/gl3.h> // OpenGL 3 library for OSX #include <OpenGL/gl3.h> // OpenGL 3 library for OSX
#else #else
#define GLAD_IMPLEMENTATION #define GLAD_IMPLEMENTATION
@ -1286,17 +1286,13 @@ void rlglLoadExtensions(void *loader)
{ {
#if defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_33) #if defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_33)
// NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions (and lower versions) // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions (and lower versions)
#ifndef __APPLE__ #if !defined(__APPLE__)
if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions");
else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully");
#endif
#if defined(GRAPHICS_API_OPENGL_21) #if defined(GRAPHICS_API_OPENGL_21)
#ifndef __APPLE__
if (GLAD_GL_VERSION_2_1) TraceLog(INFO, "OpenGL 2.1 profile supported"); if (GLAD_GL_VERSION_2_1) TraceLog(INFO, "OpenGL 2.1 profile supported");
#endif
#elif defined(GRAPHICS_API_OPENGL_33) #elif defined(GRAPHICS_API_OPENGL_33)
#ifndef __APPLE__
if(GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); if(GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported");
else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported");
#endif #endif

View file

@ -59,12 +59,10 @@
#ifndef RLGL_H #ifndef RLGL_H
#define RLGL_H #define RLGL_H
#ifndef RLGL_STANDALONE #if defined(RLGL_STANDALONE)
#include "raylib.h" // Required for: Model, Shader, Texture2D, TraceLog()
#endif
#ifdef RLGL_STANDALONE
#define RAYMATH_STANDALONE #define RAYMATH_STANDALONE
#else
#include "raylib.h" // Required for: Model, Shader, Texture2D, TraceLog()
#endif #endif
#include "raymath.h" // Required for: Vector3, Matrix #include "raymath.h" // Required for: Vector3, Matrix