Browse Source

Review some comments

pull/249/head
Ray 8 years ago
parent
commit
59652c75b4
16 changed files with 83 additions and 80 deletions
  1. +8
    -10
      src/audio.c
  2. +1
    -1
      src/audio.h
  3. +2
    -2
      src/camera.h
  4. +9
    -9
      src/core.c
  5. +2
    -2
      src/gestures.h
  6. +1
    -1
      src/models.c
  7. +1
    -1
      src/raylib.h
  8. +1
    -1
      src/raymath.h
  9. +18
    -29
      src/rlgl.c
  10. +31
    -14
      src/rlgl.h
  11. +1
    -3
      src/rres.h
  12. +1
    -1
      src/shapes.c
  13. +1
    -1
      src/text.c
  14. +1
    -1
      src/textures.c
  15. +1
    -1
      src/utils.c
  16. +4
    -3
      src/utils.h

+ 8
- 10
src/audio.c View File

@ -2,15 +2,13 @@
* *
* raylib.audio - Basic funtionality to work with audio * raylib.audio - Basic funtionality to work with audio
* *
* DESCRIPTION: * FEATURES:
* * - Manage audio device (init/close)
* This module provides basic functionality to: * - Load and unload audio files
* - Manage audio device (init/close) * - Format wave data (sample rate, size, channels)
* - Load and unload audio files * - Play/Stop/Pause/Resume loaded audio
* - Format wave data (sample rate, size, channels) * - Manage mixing channels
* - Play/Stop/Pause/Resume loaded audio * - Manage raw audio context
* - Manage mixing channels
* - Manage raw audio context
* *
* CONFIGURATION: * CONFIGURATION:
* *
@ -51,7 +49,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 1
- 1
src/audio.h View File

@ -29,7 +29,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 2
- 2
src/camera.h View File

@ -1,6 +1,6 @@
/******************************************************************************************* /*******************************************************************************************
* *
* raylib Camera System - Camera Modes Setup and Control Functions * raylib.camera - Camera system with multiple modes support
* *
* NOTE: Memory footprint of this library is aproximately 52 bytes (global variables) * NOTE: Memory footprint of this library is aproximately 52 bytes (global variables)
* *
@ -22,7 +22,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2015-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2015-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 9
- 9
src/core.c View File

@ -2,14 +2,14 @@
* *
* raylib.core - Basic functions to manage windows, OpenGL context and input on multiple platforms * raylib.core - Basic functions to manage windows, OpenGL context and input on multiple platforms
* *
* The following platforms are supported: * PLATFORMS SUPPORTED:
* Windows (win32/Win64) * o">- Windows (win32/Win64)
* Linux (tested on Ubuntu) * o">- Linux (tested on Ubuntu)
* Mac (OSX) * o">- Mac (OSX)
* Android (API Level 9 or greater) * o">- Android (API Level 9 or greater)
* Raspberry Pi (Raspbian) * o">- Raspberry Pi (Raspbian)
* HTML5 (Chrome, Firefox) * o">- HTML5 (Chrome, Firefox)
* Oculus Rift CV1 * o">- Oculus Rift CV1
* *
* CONFIGURATION: * CONFIGURATION:
* *
@ -49,7 +49,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 2
- 2
src/gestures.h View File

@ -1,6 +1,6 @@
/********************************************************************************************** /**********************************************************************************************
* *
* raylib Gestures System - Gestures Processing based on input gesture events (touch/mouse) * raylib.gestures - Gestures system, gestures processing based on input events (touch/mouse)
* *
* NOTE: Memory footprint of this library is aproximately 128 bytes (global variables) * NOTE: Memory footprint of this library is aproximately 128 bytes (global variables)
* *
@ -24,7 +24,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 1
- 1
src/models.c View File

@ -13,7 +13,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 1
- 1
src/raylib.h View File

@ -47,7 +47,7 @@
* raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, * raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software: * BSD-like license that allows static linking with closed source software:
* *
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2013-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 1
- 1
src/raymath.h View File

@ -1,6 +1,6 @@
/********************************************************************************************** /**********************************************************************************************
* *
* raymath v1.0 - Some useful functions to work with Vector3, Matrix and Quaternions * raymath v1.0 - Math functions to work with Vector3, Matrix and Quaternions
* *
* CONFIGURATION: * CONFIGURATION:
* *

+ 18
- 29
src/rlgl.c View File

@ -2,10 +2,8 @@
* *
* rlgl - raylib OpenGL abstraction layer * rlgl - raylib OpenGL abstraction layer
* *
* DESCRIPTION: * rlgl is a wrapper for multiple OpenGL versions (1.1, 2.1, 3.3 Core, ES 2.0) to
* * pseudo-OpenGL 1.1 style functions (rlVertex, rlTranslate, rlRotate...).
* rlgl allows usage of OpenGL 1.1 style functions (rlVertex) that are internally mapped to
* selected OpenGL version (1.1, 2.1, 3.3 Core, ES 2.0).
* *
* When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal * When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal
* VBO buffers (and VAOs if available). It requires calling 3 functions: * VBO buffers (and VAOs if available). It requires calling 3 functions:
@ -16,32 +14,19 @@
* CONFIGURATION: * CONFIGURATION:
* *
* #define GRAPHICS_API_OPENGL_11 * #define GRAPHICS_API_OPENGL_11
* Use OpenGL 1.1 backend
*
* #define GRAPHICS_API_OPENGL_21 * #define GRAPHICS_API_OPENGL_21
* Use OpenGL 2.1 backend
*
* #define GRAPHICS_API_OPENGL_33 * #define GRAPHICS_API_OPENGL_33
* Use OpenGL 3.3 Core profile backend
*
* #define GRAPHICS_API_OPENGL_ES2 * #define GRAPHICS_API_OPENGL_ES2
* Use OpenGL ES 2.0 backend * Use selected OpenGL backend
* *
* #define RLGL_STANDALONE * #define RLGL_STANDALONE
* Use rlgl as standalone library (no raylib dependency) * Use rlgl as standalone library (no raylib dependency)
* *
* #define RLGL_NO_DISTORTION_SHADER * #define SUPPORT_VR_SIMULATION / SUPPORT_STEREO_RENDERING
* Avoid stereo rendering distortion sahder (shader_distortion.h) inclusion * Support VR simulation functionality (stereo rendering)
*
* #define SUPPORT_SHADER_DEFAULT / ENABLE_SHADER_DEFAULT
* *
* #define SUPPORT_SHADER_DISTORTION * #define SUPPORT_SHADER_DISTORTION
* * Include stereo rendering distortion shader (shader_distortion.h)
* #define SUPPORT_VR_SIMULATION
*
* #define SUPPORT_STEREO_RENDERING
*
* #define RLGL_NO_DEFAULT_SHADER
* *
* DEPENDENCIES: * DEPENDENCIES:
* raymath - 3D math functionality (Vector3, Matrix, Quaternion) * raymath - 3D math functionality (Vector3, Matrix, Quaternion)
@ -50,7 +35,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.
@ -295,6 +280,13 @@ static bool texCompETC1Supported = false; // ETC1 texture compression support
static bool texCompETC2Supported = false; // ETC2/EAC texture compression support static bool texCompETC2Supported = false; // ETC2/EAC texture compression support
static bool texCompPVRTSupported = false; // PVR texture compression support static bool texCompPVRTSupported = false; // PVR texture compression support
static bool texCompASTCSupported = false; // ASTC texture compression support static bool texCompASTCSupported = false; // ASTC texture compression support
// VR global variables
static VrDeviceInfo hmd; // Current VR device info
static VrStereoConfig vrConfig; // VR stereo configuration for simulator
static bool vrSimulatorReady = false; // VR simulator ready 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)
#endif #endif
// Extension supported flag: Anisotropic filtering // Extension supported flag: Anisotropic filtering
@ -304,13 +296,6 @@ static float maxAnisotropicLevel = 0.0f; // Maximum anisotropy level supp
// Extension supported flag: Clamp mirror wrap mode // Extension supported flag: Clamp mirror wrap mode
static bool texClampMirrorSupported = false; // Clamp mirror wrap mode supported static bool texClampMirrorSupported = false; // Clamp mirror wrap mode supported
// VR global variables
static VrDeviceInfo hmd; // Current VR device info
static VrStereoConfig vrConfig; // VR stereo configuration for simulator
static bool vrSimulatorReady = false; // VR simulator ready 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)
#if defined(GRAPHICS_API_OPENGL_ES2) #if defined(GRAPHICS_API_OPENGL_ES2)
// NOTE: VAO functionality is exposed through extensions (OES) // NOTE: VAO functionality is exposed through extensions (OES)
static PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays; static PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays;
@ -2636,7 +2621,11 @@ void CloseVrSimulator(void)
// Detect if VR simulator is running // Detect if VR simulator is running
bool IsVrSimulatorReady(void) bool IsVrSimulatorReady(void)
{ {
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
return vrSimulatorReady; return vrSimulatorReady;
#else
return false;
#endif
} }
// Enable/Disable VR experience (device or simulator) // Enable/Disable VR experience (device or simulator)

+ 31
- 14
src/rlgl.h View File

@ -2,8 +2,8 @@
* *
* rlgl - raylib OpenGL abstraction layer * rlgl - raylib OpenGL abstraction layer
* *
* rlgl allows usage of OpenGL 1.1 style functions (rlVertex) that are internally mapped to * rlgl is a wrapper for multiple OpenGL versions (1.1, 2.1, 3.3 Core, ES 2.0) to
* selected OpenGL version (1.1, 2.1, 3.3 Core, ES 2.0). * pseudo-OpenGL 1.1 style functions (rlVertex, rlTranslate, rlRotate...).
* *
* When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal * When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal
* VBO buffers (and VAOs if available). It requires calling 3 functions: * VBO buffers (and VAOs if available). It requires calling 3 functions:
@ -11,18 +11,29 @@
* rlglDraw() - Process internal buffers and send required draw calls * rlglDraw() - Process internal buffers and send required draw calls
* rlglClose() - De-initialize internal buffers data and other auxiliar resources * rlglClose() - De-initialize internal buffers data and other auxiliar resources
* *
* External libs: * CONFIGURATION:
*
* #define GRAPHICS_API_OPENGL_11
* #define GRAPHICS_API_OPENGL_21
* #define GRAPHICS_API_OPENGL_33
* #define GRAPHICS_API_OPENGL_ES2
* Use selected OpenGL backend
*
* #define RLGL_STANDALONE
* Use rlgl as standalone library (no raylib dependency)
*
* #define SUPPORT_VR_SIMULATION / SUPPORT_STEREO_RENDERING
* Support VR simulation functionality (stereo rendering)
*
* #define SUPPORT_SHADER_DISTORTION
* Include stereo rendering distortion shader (shader_distortion.h)
*
* DEPENDENCIES:
* raymath - 3D math functionality (Vector3, Matrix, Quaternion) * raymath - 3D math functionality (Vector3, Matrix, Quaternion)
* GLAD - OpenGL extensions loading (OpenGL 3.3 Core only) * GLAD - OpenGL extensions loading (OpenGL 3.3 Core only)
* *
* Module Configuration Flags:
* GRAPHICS_API_OPENGL_11 - Use OpenGL 1.1 backend
* GRAPHICS_API_OPENGL_21 - Use OpenGL 2.1 backend
* GRAPHICS_API_OPENGL_33 - Use OpenGL 3.3 Core profile backend
* GRAPHICS_API_OPENGL_ES2 - Use OpenGL ES 2.0 backend
*
* RLGL_STANDALONE - Use rlgl as standalone library (no raylib dependency)
* *
* LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
* *
@ -124,15 +135,21 @@
#define RL_WRAP_CLAMP 0x812F // GL_CLAMP_TO_EDGE #define RL_WRAP_CLAMP 0x812F // GL_CLAMP_TO_EDGE
#define RL_WRAP_CLAMP_MIRROR 0x8742 // GL_MIRROR_CLAMP_EXT #define RL_WRAP_CLAMP_MIRROR 0x8742 // GL_MIRROR_CLAMP_EXT
// Matrix modes (equivalent to OpenGL)
#define RL_MODELVIEW 0x1700 // GL_MODELVIEW
#define RL_PROJECTION 0x1701 // GL_PROJECTION
#define RL_TEXTURE 0x1702 // GL_TEXTURE
// Primitive assembly draw modes
#define RL_LINES 0x0001 // GL_LINES
#define RL_TRIANGLES 0x0004 // GL_TRIANGLES
#define RL_QUADS 0x0007 // GL_QUADS
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Types and Structures Definition // Types and Structures Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion;
typedef enum { RL_PROJECTION, RL_MODELVIEW, RL_TEXTURE } MatrixMode;
typedef enum { RL_LINES, RL_TRIANGLES, RL_QUADS } DrawMode;
typedef unsigned char byte; typedef unsigned char byte;
#if defined(RLGL_STANDALONE) #if defined(RLGL_STANDALONE)

+ 1
- 3
src/rres.h View File

@ -1,8 +1,6 @@
/********************************************************************************************** /**********************************************************************************************
* *
* rres - raylib Resource custom format management functions * rres v1.0 - raylib resource (rRES) custom fileformat management functions
*
* Basic functions to load/save rRES resource files
* *
* CONFIGURATION: * CONFIGURATION:
* *

+ 1
- 1
src/shapes.c View File

@ -13,7 +13,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 1
- 1
src/text.c View File

@ -18,7 +18,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 1
- 1
src/textures.c View File

@ -31,7 +31,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 1
- 1
src/utils.c View File

@ -25,7 +25,7 @@
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

+ 4
- 3
src/utils.h View File

@ -1,10 +1,11 @@
/********************************************************************************************** /**********************************************************************************************
* *
* raylib.utils * raylib.utils - Some common utility functions
* *
* Some utility functions
* *
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * LICENSE: zlib/libpng
*
* Copyright (c) 2014-2017 Ramon Santamaria (@raysan5)
* *
* This software is provided "as-is", without any express or implied warranty. In no event * This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software. * will the authors be held liable for any damages arising from the use of this software.

||||||
x
 
000:0
Loading…
Cancel
Save