Browse Source

Define some globals

pull/897/head
Ray 5 years ago
parent
commit
1b249ac1e1
4 changed files with 16 additions and 16 deletions
  1. +5
    -5
      src/core.c
  2. +9
    -9
      src/rlgl.h
  3. +1
    -1
      src/text.c
  4. +1
    -1
      src/utils.c

+ 5
- 5
src/core.c View File

@ -301,7 +301,7 @@ static int renderOffsetX = 0; // Offset X from render area (mu
static int renderOffsetY = 0; // Offset Y from render area (must be divided by 2) static int renderOffsetY = 0; // Offset Y from render area (must be divided by 2)
static bool fullscreen = false; // Fullscreen mode (useful only for PLATFORM_DESKTOP) static bool fullscreen = false; // Fullscreen mode (useful only for PLATFORM_DESKTOP)
static bool alwaysRun = false; // Keep window update/draw running on minimized static bool alwaysRun = false; // Keep window update/draw running on minimized
static Matrix screenScaling; // Matrix to scale screen (framebuffer rendering)
static Matrix screenScaling = { 0 }; // Matrix to scale screen (framebuffer rendering)
#if defined(PLATFORM_RPI) #if defined(PLATFORM_RPI)
static EGL_DISPMANX_WINDOW_T nativeWindow; // Native window (graphic device) static EGL_DISPMANX_WINDOW_T nativeWindow; // Native window (graphic device)
@ -312,7 +312,7 @@ static EGLDisplay display; // Native display device (physic
static EGLSurface surface; // Surface to draw on, framebuffers (connected to context) static EGLSurface surface; // Surface to draw on, framebuffers (connected to context)
static EGLContext context; // Graphic context, mode in which drawing can be done static EGLContext context; // Graphic context, mode in which drawing can be done
static EGLConfig config; // Graphic config static EGLConfig config; // Graphic config
static uint64_t baseTime; // Base time measure for hi-res timer
static uint64_t baseTime = 0; // Base time measure for hi-res timer
static bool windowShouldClose = false; // Flag to set window for closing static bool windowShouldClose = false; // Flag to set window for closing
#endif #endif
@ -342,7 +342,7 @@ static int exitKey = KEY_ESCAPE; // Default exit key (ESC)
#if defined(PLATFORM_RPI) #if defined(PLATFORM_RPI)
// NOTE: For keyboard we will use the standard input (but reconfigured...) // NOTE: For keyboard we will use the standard input (but reconfigured...)
static struct termios defaultKeyboardSettings; // Used to store default keyboard settings static struct termios defaultKeyboardSettings; // Used to store default keyboard settings
static int defaultKeyboardMode; // Used to store default keyboard mode
static int defaultKeyboardMode = 0; // Used to store default keyboard mode
#endif #endif
// Mouse states // Mouse states
@ -384,8 +384,8 @@ typedef struct{
char Tail; char Tail;
} KeyEventFifo; } KeyEventFifo;
static KeyEventFifo lastKeyPressedEvdev; // Buffer for holding keydown events as they arrive (Needed due to multitreading of event workers)
static char currentKeyStateEvdev[512] = { 0 }; // Registers current frame key state from event based driver (Needs to be seperate because the legacy console based method clears keys on every frame)
static KeyEventFifo lastKeyPressedEvdev = { 0 }; // Buffer for holding keydown events as they arrive (Needed due to multitreading of event workers)
static char currentKeyStateEvdev[512] = { 0 }; // Registers current frame key state from event based driver (Needs to be seperate because the legacy console based method clears keys on every frame)
#endif #endif
#if defined(PLATFORM_WEB) #if defined(PLATFORM_WEB)

+ 9
- 9
src/rlgl.h View File

@ -782,14 +782,14 @@ static DrawCall *draws = NULL;
static int drawsCounter = 0; static int drawsCounter = 0;
// Default texture (1px white) useful for plain color polys (required by shader) // Default texture (1px white) useful for plain color polys (required by shader)
static unsigned int defaultTextureId;
static unsigned int defaultTextureId = 0;
// Default shaders // Default shaders
static unsigned int defaultVShaderId; // Default vertex shader id (used by default shader program)
static unsigned int defaultFShaderId; // Default fragment shader Id (used by default shader program)
static unsigned int defaultVShaderId = 0; // Default vertex shader id (used by default shader program)
static unsigned int defaultFShaderId = 0; // Default fragment shader Id (used by default shader program)
static Shader defaultShader; // Basic shader, support vertex color and diffuse texture
static Shader currentShader; // Shader to be used on rendering (by default, defaultShader)
static Shader defaultShader = { 0 }; // Basic shader, support vertex color and diffuse texture
static Shader currentShader = { 0 }; // Shader to be used on rendering (by default, defaultShader)
// Extension supported flag: VAO // Extension supported flag: VAO
static bool vaoSupported = false; // VAO support (OpenGL ES2 could not support VAO extension) static bool vaoSupported = false; // VAO support (OpenGL ES2 could not support VAO extension)
@ -827,7 +827,7 @@ static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays;
#if defined(SUPPORT_VR_SIMULATOR) #if defined(SUPPORT_VR_SIMULATOR)
// VR global variables // VR global variables
static VrStereoConfig vrConfig = { 0 }; // VR stereo configuration for simulator static VrStereoConfig vrConfig = { 0 }; // VR stereo configuration for simulator
static RenderTexture2D stereoFbo; // VR stereo rendering framebuffer
static RenderTexture2D stereoFbo = { 0 }; // VR stereo rendering framebuffer
static bool vrSimulatorReady = false; // VR simulator ready flag static bool vrSimulatorReady = false; // VR simulator ready flag
static bool vrStereoRender = false; // VR stereo rendering enabled/disabled flag static bool vrStereoRender = false; // VR stereo rendering enabled/disabled flag
// NOTE: This flag is useful to render data over stereo image (i.e. FPS) // NOTE: This flag is useful to render data over stereo image (i.e. FPS)
@ -835,11 +835,11 @@ static bool vrStereoRender = false; // VR stereo rendering enabled/disab
#endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2 #endif // GRAPHICS_API_OPENGL_33 || GRAPHICS_API_OPENGL_ES2
static int blendMode = 0; // Track current blending mode
static int blendMode = 0; // Track current blending mode
// Default framebuffer size // Default framebuffer size
static int screenWidth; // Default framebuffer width
static int screenHeight; // Default framebuffer height
static int screenWidth = 0; // Default framebuffer width
static int screenHeighto">= 0; // Default framebuffer height
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module specific Functions Declaration // Module specific Functions Declaration

+ 1
- 1
src/text.c View File

@ -74,7 +74,7 @@
// Global variables // Global variables
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
#if defined(SUPPORT_DEFAULT_FONT) #if defined(SUPPORT_DEFAULT_FONT)
static Font defaultFont; // Default font provided by raylib
static Font defaultFont = { 0 }; // Default font provided by raylib
// NOTE: defaultFont is loaded on InitWindow and disposed on CloseWindow [module: core] // NOTE: defaultFont is loaded on InitWindow and disposed on CloseWindow [module: core]
#endif #endif

+ 1
- 1
src/utils.c View File

@ -62,7 +62,7 @@ static int logTypeExit = LOG_ERROR;
static TraceLogCallback logCallback = NULL; static TraceLogCallback logCallback = NULL;
#if defined(PLATFORM_ANDROID) #if defined(PLATFORM_ANDROID)
AAssetManager *assetManager;
AAssetManager *assetManager = NULL;
#endif #endif
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------

Loading…
Cancel
Save