Merge branch 'raysan5:master' into master
This commit is contained in:
commit
7d2eee484f
57 changed files with 2194 additions and 1537 deletions
12
.gitignore
vendored
12
.gitignore
vendored
|
|
@ -1,6 +1,11 @@
|
|||
# Ignore generated files
|
||||
# ...
|
||||
|
||||
# Ignore all without extensions
|
||||
*
|
||||
!*.*
|
||||
!*/
|
||||
|
||||
# Ignore VIM's backup generated files
|
||||
*.swp
|
||||
*.swo
|
||||
|
|
@ -52,6 +57,13 @@ packages/
|
|||
*.a
|
||||
*.bc
|
||||
*.so
|
||||
*.so.*
|
||||
|
||||
# Ignore wasm data in examples/
|
||||
examples/**/*.wasm
|
||||
examples/**/*.data
|
||||
examples/**/*.js
|
||||
examples/**/*.html
|
||||
|
||||
# Ignore files build by xcode
|
||||
*.mode*v*
|
||||
|
|
|
|||
18
BINDINGS.md
18
BINDINGS.md
|
|
@ -1,13 +1,12 @@
|
|||
## raylib bindings
|
||||
# raylib bindings and wrappers
|
||||
|
||||
Some people ported raylib to other languages in form of bindings or wrappers to the library.
|
||||
Some people ported raylib to other languages in form of bindings or wrappers to the library. Here it is alist with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list.
|
||||
|
||||
Here it is a list with the ones I'm aware of:
|
||||
### Language Bindings
|
||||
|
||||
| name | raylib version | language | repo |
|
||||
|:------------------:|:-------------: | :--------:|----------------------------------------------------------------------|
|
||||
| raylib | **3.7** | [C](https://en.wikipedia.org/wiki/C_(programming_language)) | https://github.com/raysan5/raylib |
|
||||
| raylib-cpp | 3.7 | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | https://github.com/robloach/raylib-cpp |
|
||||
| raylib | **3.7** | [C/C++](https://en.wikipedia.org/wiki/C_(programming_language)) | https://github.com/raysan5/raylib |
|
||||
| Raylib-cs | 3.7 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/ChrisDill/Raylib-cs |
|
||||
| raylib-cppsharp | 2.5 | [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)) | https://github.com/phxvyper/raylib-cppsharp |
|
||||
| raylib-boo | 3.7 | [Boo](http://boo-language.github.io/) | https://github.com/Rabios/raylib-boo |
|
||||
|
|
@ -28,6 +27,7 @@ Here it is a list with the ones I'm aware of:
|
|||
| raylib-luamore | 3.0 | [Lua](http://www.lua.org/) | https://github.com/HDPLocust/raylib-luamore |
|
||||
| raylua | 3.7 | [Lua](http://www.lua.org/) | https://github.com/Rabios/raylua |
|
||||
| LuaJIT-Raylib | 2.6 | [Lua](http://www.lua.org/) | https://github.com/Bambofy/LuaJIT-Raylib |
|
||||
| raylib-nelua | 3.7 | [nelua](https://nelua.io/) | https://github.com/edubart/nelua-decl/tree/main/libs/raylib |
|
||||
| raylib-nelua | 3.0 | [Nelua](https://nelua.io/) | https://github.com/Andre-LA/raylib-nelua |
|
||||
| raylib-Nim | 1.7 | [Nim](https://nim-lang.org/) | https://gitlab.com/define-private-public/raylib-Nim |
|
||||
| raylib-nim | 2.0 | [Nim](https://nim-lang.org/) | https://github.com/Skrylar/raylib-nim |
|
||||
|
|
@ -96,10 +96,16 @@ Here it is a list with the ones I'm aware of:
|
|||
| raylib-never | 3.0 | [Never](https://github.com/never-lang/never) | https://github.com/never-lang/raylib-never |
|
||||
| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib |
|
||||
| Relib | 3.5 | [ReCT](https://github.com/RedCubeDev-ByteSpace/ReCT) | https://github.com/RedCubeDev-ByteSpace/Relib |
|
||||
| rayex | 3.7 | [elixir](https://elixir-lang.org/) | https://github.com/shiryel/rayex |
|
||||
| raylib.cbl | 2.0 | [COBOL](https://en.wikipedia.org/wiki/COBOL) | *[code examples](https://github.com/Martinfx/Cobol/tree/master/OpenCobol/Games/raylib)* |
|
||||
|
||||
### Utility Wrapers
|
||||
|
||||
| name | raylib version | language | repo |
|
||||
|:------------------:|:-------------: | :--------:|----------------------------------------------------------------------|
|
||||
| raylib-cpp | 3.7 | [C++](https://en.wikipedia.org/wiki/C%2B%2B) | https://github.com/robloach/raylib-cpp |
|
||||
|
||||
Missing some language? Feel free to create a new binding! :)
|
||||
Missing some language or wrapper? Feel free to create a new one! :)
|
||||
|
||||
Usually, raylib bindings follow the convention: `raylib-{language}`
|
||||
|
||||
|
|
|
|||
11
CHANGELOG
11
CHANGELOG
|
|
@ -3,6 +3,17 @@ changelog
|
|||
|
||||
Current Release: raylib 3.7.0 (26 April 2021)
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
Release: raylib 4.0 (November? 2021)
|
||||
-------------------------------------------------------------------------
|
||||
KEY CHANGES:
|
||||
-
|
||||
-
|
||||
-
|
||||
|
||||
Detailed changes:
|
||||
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
Release: raylib 3.7 (26 April 2021)
|
||||
-------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Defines | ALL_CAPS | `#define PLATFORM_DESKTOP`
|
|||
Macros | ALL_CAPS | `#define MIN(a,b) (((a)<(b))?(a):(b))`
|
||||
Variables | lowerCase | `int screenWidth = 0;`, `float targetFrameTime = 0.016f;`
|
||||
Local variables | lowerCase | `Vector2 playerPosition = { 0 };`
|
||||
Global variables | lowerCase | `bool fullscreen = false;`
|
||||
Global variables | lowerCase | `bool windowReady = false;`
|
||||
Constants | lowerCase | `const int maxValue = 8;`
|
||||
Pointers | MyType *pointer | `Texture2D *array = NULL;`
|
||||
float values | always x.xf | `float gravity = 10.0f`
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ Note that Sponsors donations vary between sponsors, I just decided not to make a
|
|||
- Merlyn Morgan-Graham ([@kavika13](https://github.com/kavika13))
|
||||
- Toby4213 ([@Toby4213](https://github.com/Toby4213))
|
||||
- linus ([@hochbaum](https://github.com/hochbaum))
|
||||
- Nawarian ([@nawarian](https://github.com/nawarian) - [thephp.website](https://thephp.website/))
|
||||
|
||||
|
||||
### Past raylib GitHub Sponsors
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ endif
|
|||
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
||||
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
||||
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
||||
CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces
|
||||
CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result
|
||||
|
||||
ifeq ($(BUILD_MODE),DEBUG)
|
||||
CFLAGS += -g
|
||||
|
|
@ -244,7 +244,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
|||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||
# --preload-file resources # specify a resources folder for data compilation
|
||||
# --source-map-base # allow debugging in browser with source map
|
||||
CFLAGS += -s USE_GLFW=3 -s ASYNCIFY -s TOTAL_MEMORY=67108864 -s FORCE_FILESYSTEM=1 $(dir $<)resources@resources
|
||||
CFLAGS += -s USE_GLFW=3 -s ASYNCIFY -s TOTAL_MEMORY=67108864 -s FORCE_FILESYSTEM=1 --preload-file $(dir $<)resources@resources
|
||||
|
||||
# NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
|
||||
# we can compile same code for ALL platforms with no change required, but, working on bigger
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
#include "raylib.h"
|
||||
#include "rlgl.h"
|
||||
|
||||
#include <math.h> // Required for: cosf(), sinf()
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Module Functions Declaration
|
||||
//------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "raylib.h"
|
||||
#include "rlgl.h"
|
||||
#include "raymath.h"
|
||||
|
||||
#if defined(PLATFORM_DESKTOP)
|
||||
#define GLSL_VERSION 330
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "raylib.h"
|
||||
|
||||
#define RNET_IMPLEMENTATION
|
||||
#include "rnet.h"
|
||||
#include "extras/rnet.h"
|
||||
|
||||
float elapsed = 0.0f;
|
||||
float delay = 1.0f;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "raylib.h"
|
||||
|
||||
#define RNET_IMPLEMENTATION
|
||||
#include "rnet.h"
|
||||
#include "extras/rnet.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "raylib.h"
|
||||
|
||||
#define RNET_IMPLEMENTATION
|
||||
#include "rnet.h"
|
||||
#include "extras/rnet.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "raylib.h"
|
||||
|
||||
#define RNET_IMPLEMENTATION
|
||||
#include "rnet.h"
|
||||
#include "extras/rnet.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "raylib.h"
|
||||
|
||||
#define RNET_IMPLEMENTATION
|
||||
#include "rnet.h"
|
||||
#include "extras/rnet.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "raylib.h"
|
||||
|
||||
#define RNET_IMPLEMENTATION
|
||||
#include "rnet.h"
|
||||
#include "extras/rnet.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "raylib.h"
|
||||
|
||||
#define RNET_IMPLEMENTATION
|
||||
#include "rnet.h"
|
||||
#include "extras/rnet.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
|||
146
examples/others/raylib_opengl_interop.c
Normal file
146
examples/others/raylib_opengl_interop.c
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
/*******************************************************************************************
|
||||
*
|
||||
* raylib [shaders] example - OpenGL point particle system
|
||||
*
|
||||
* This example has been created using raylib 3.8 (www.raylib.com)
|
||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||
*
|
||||
* Example contributed by Stephan Soller (@arkanis - http://arkanis.de/)
|
||||
* and reviewed by Ramon Santamaria (@raysan5)
|
||||
*
|
||||
* Copyright (c) 2021 Stephan Soller (@arkanis) and Ramon Santamaria (@raysan5)
|
||||
*
|
||||
********************************************************************************************
|
||||
*
|
||||
* Mixes raylib and plain OpenGL code to draw a GL_POINTS based particle system. The
|
||||
* primary point is to demonstrate raylib and OpenGL interop.
|
||||
*
|
||||
* rlgl batched draw operations internally so we have to flush the current batch before
|
||||
* doing our own OpenGL work (rlDrawRenderBatchActive()).
|
||||
*
|
||||
* The example also demonstrates how to get the current model view projection matrix of
|
||||
* raylib. That way raylib cameras and so on work as expected.
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#include "raylib.h"
|
||||
#include "rlgl.h" // Required for: rlDrawRenderBatchActive(), rlGetMatrixModelview(), rlGetMatrixProjection()
|
||||
#include "glad.h" // Required for: OpenGL functionality
|
||||
#include "raymath.h" // Required for: MatrixMultiply(), MatrixToFloat()
|
||||
|
||||
#if defined(PLATFORM_DESKTOP)
|
||||
#define GLSL_VERSION 330
|
||||
#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB
|
||||
#define GLSL_VERSION 100
|
||||
#endif
|
||||
|
||||
#define MAX_PARTICLES 1000
|
||||
|
||||
// Particle type
|
||||
typedef struct Particle {
|
||||
float x;
|
||||
float y;
|
||||
float period;
|
||||
} Particle;
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib - point particles");
|
||||
|
||||
Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/point_particle.vs", GLSL_VERSION),
|
||||
TextFormat("resources/shaders/glsl%i/point_particle.fs", GLSL_VERSION));
|
||||
|
||||
int currentTimeLoc = GetShaderLocation(shader, "currentTime");
|
||||
int colorLoc = GetShaderLocation(shader, "color");
|
||||
|
||||
// Initialize the vertex buffer for the particles and assign each particle random values
|
||||
Particle particles[MAX_PARTICLES] = { 0 };
|
||||
|
||||
for (int i = 0; i < MAX_PARTICLES; i++)
|
||||
{
|
||||
particles[i].x = (float)GetRandomValue(20, screenWidth - 20);
|
||||
particles[i].y = (float)GetRandomValue(50, screenHeight - 20);
|
||||
|
||||
// Give each particle a slightly different period. But don't spread it to much.
|
||||
// This way the particles line up every so often and you get a glimps of what is going on.
|
||||
particles[i].period = (float)GetRandomValue(10, 30)/10.0f;
|
||||
}
|
||||
|
||||
// Create a plain OpenGL vertex buffer with the data and an vertex array object
|
||||
// that feeds the data from the buffer into the vertexPosition shader attribute.
|
||||
GLuint vao = 0;
|
||||
GLuint vbo = 0;
|
||||
glGenVertexArrays(1, &vao);
|
||||
glBindVertexArray(vao);
|
||||
glGenBuffers(1, &vbo);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
||||
glBufferData(GL_ARRAY_BUFFER, MAX_PARTICLES*sizeof(Particle), particles, GL_STATIC_DRAW);
|
||||
// Note: LoadShader() automatically fetches the attribute index of "vertexPosition" and saves it in shader.locs[SHADER_LOC_VERTEX_POSITION]
|
||||
glVertexAttribPointer(shader.locs[SHADER_LOC_VERTEX_POSITION], 3, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
glEnableVertexAttribArray(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glBindVertexArray(0);
|
||||
|
||||
// Allows the vertex shader to set the point size of each particle individually
|
||||
glEnable(GL_PROGRAM_POINT_SIZE);
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
ClearBackground(WHITE);
|
||||
|
||||
DrawRectangle(10, 10, 210, 30, MAROON);
|
||||
DrawText(TextFormat("%zu particles in one vertex buffer", MAX_PARTICLES), 20, 20, 10, RAYWHITE);
|
||||
|
||||
rlDrawRenderBatchActive(); // Draw iternal buffers data (previous draw calls)
|
||||
|
||||
// Switch to plain OpenGL
|
||||
//------------------------------------------------------------------------------
|
||||
glUseProgram(shader.id);
|
||||
|
||||
glUniform1f(currentTimeLoc, GetTime());
|
||||
|
||||
Vector4 color = ColorNormalize((Color){ 255, 0, 0, 128 });
|
||||
glUniform4fv(colorLoc, 1, (float *)&color);
|
||||
|
||||
// Get the current modelview and projection matrix so the particle system is displayed and transformed
|
||||
Matrix modelViewProjection = MatrixMultiply(rlGetMatrixModelview(), rlGetMatrixProjection());
|
||||
|
||||
glUniformMatrix4fv(shader.locs[SHADER_LOC_MATRIX_MVP], 1, false, MatrixToFloat(modelViewProjection));
|
||||
|
||||
glBindVertexArray(vao);
|
||||
glDrawArrays(GL_POINTS, 0, MAX_PARTICLES);
|
||||
glBindVertexArray(0);
|
||||
|
||||
glUseProgram(0);
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
DrawFPS(screenWidth - 100, 10);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
glDeleteBuffers(1, &vbo);
|
||||
glDeleteVertexArrays(1, &vao);
|
||||
|
||||
UnloadShader(shader); // Unload shader
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
examples/others/raylib_opengl_interop.png
Normal file
BIN
examples/others/raylib_opengl_interop.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 263 KiB |
|
|
@ -2,18 +2,17 @@
|
|||
*
|
||||
* raylib [rlgl] example - Using rlgl module as standalone module
|
||||
*
|
||||
* NOTE: This example requires OpenGL 3.3 or ES2 versions for shaders support,
|
||||
* rlgl library is an abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, ES 2.0)
|
||||
* that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...)
|
||||
*
|
||||
* NOTE: This example requires OpenGL 3.3 or OpenGL ES 2.0 for shaders support,
|
||||
* OpenGL 1.1 does not support shaders but it can also be used.
|
||||
*
|
||||
* DEPENDENCIES:
|
||||
* rlgl.h - OpenGL 1.1 immediate-mode style coding translation layer
|
||||
* glad.h - OpenGL extensions initialization library (required by rlgl)
|
||||
* raymath.h - 3D math library (required by rlgl)
|
||||
* glfw3 - Windows and context initialization library
|
||||
*
|
||||
* rlgl library is provided as a single-file header-only library, this library
|
||||
* allows coding in a pseudo-OpenGL 1.1 style while translating calls to multiple
|
||||
* OpenGL versions backends (1.1, 2.1, 3.3, ES 2.0).
|
||||
* rlgl.h - OpenGL abstraction layer to OpenGL 1.1, 3.3 or ES2
|
||||
* glad.h - OpenGL extensions initialization library (required by rlgl)
|
||||
* raymath.h - 3D math library
|
||||
*
|
||||
* WINDOWS COMPILATION:
|
||||
* gcc -o rlgl_standalone.exe rlgl_standalone.c -s -Iexternal\include -I..\..\src \
|
||||
|
|
@ -21,15 +20,16 @@
|
|||
*
|
||||
* APPLE COMPILATION:
|
||||
* gcc -o rlgl_standalone rlgl_standalone.c -I../../src -Iexternal/include -Lexternal/lib \
|
||||
* -lglfw3 -std=c99 -framework CoreVideo -framework OpenGL -framework OpenAL \
|
||||
* -framework IOKit -framework Cocoa -Wno-deprecated-declarations
|
||||
* -lglfw3 -framework CoreVideo -framework OpenGL -framework IOKit -framework Cocoa
|
||||
* -Wno-deprecated-declarations -std=c99 -DGRAPHICS_API_OPENGL_33
|
||||
*
|
||||
*
|
||||
* LICENSE: zlib/libpng
|
||||
*
|
||||
* This example is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||
* BSD-like license that allows static linking with closed source software:
|
||||
*
|
||||
* Copyright (c) 2014-2019 Ramon Santamaria (@raysan5)
|
||||
* Copyright (c) 2014-2021 Ramon Santamaria (@raysan5)
|
||||
*
|
||||
* 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.
|
||||
|
|
@ -48,15 +48,25 @@
|
|||
*
|
||||
********************************************************************************************/
|
||||
|
||||
// NOTE: rlgl can be configured just re-defining the following values:
|
||||
//#define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch elements limits
|
||||
//#define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering)
|
||||
//#define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture)
|
||||
//#define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
|
||||
//#define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack
|
||||
//#define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
|
||||
//#define RL_CULL_DISTANCE_NEAR 0.01 // Default projection matrix near cull distance
|
||||
//#define RL_CULL_DISTANCE_FAR 1000.0 // Default projection matrix far cull distance
|
||||
|
||||
#define RLGL_IMPLEMENTATION
|
||||
#define RLGL_STANDALONE
|
||||
#define RLGL_SUPPORT_TRACELOG
|
||||
#include "rlgl.h" // OpenGL 1.1 immediate-mode style coding
|
||||
#include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2
|
||||
|
||||
#define RAYMATH_STATIC_INLINE
|
||||
#include "raymath.h" // Vector2, Vector3, Quaternion and Matrix functionality
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
#define GLFW_INCLUDE_ES2
|
||||
#endif
|
||||
|
||||
#include "GLFW/glfw3.h" // Windows/Context and inputs management
|
||||
|
||||
#include <stdio.h> // Required for: printf()
|
||||
|
|
@ -65,6 +75,9 @@
|
|||
#define RAYWHITE (Color){ 245, 245, 245, 255 } // My own White (raylib logo)
|
||||
#define DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Structures Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
// Color, 4 components, R8G8B8A8 (32bit)
|
||||
typedef struct Color {
|
||||
unsigned char r; // Color red value
|
||||
|
|
@ -94,6 +107,12 @@ static void DrawCube(Vector3 position, float width, float height, float length,
|
|||
static void DrawCubeWires(Vector3 position, float width, float height, float length, Color color);
|
||||
static void DrawRectangleV(Vector2 position, Vector2 size, Color color);
|
||||
|
||||
// NOTE: We use raymath to get this functionality but it could be implemented in this module
|
||||
//static Matrix MatrixIdentity(void);
|
||||
//static Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far);
|
||||
//static Matrix MatrixPerspective(double fovy, double aspect, double near, double far);
|
||||
//static Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Main Entry point
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
@ -125,7 +144,6 @@ int main(void)
|
|||
glfwWindowHint( GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE );
|
||||
#endif
|
||||
|
||||
|
||||
GLFWwindow *window = glfwCreateWindow(screenWidth, screenHeight, "rlgl standalone", NULL, NULL);
|
||||
|
||||
if (!window)
|
||||
|
|
@ -200,8 +218,8 @@ int main(void)
|
|||
|
||||
// Draw '2D' elements in the scene (GUI)
|
||||
//-----------------------------------------------
|
||||
#define RLGL_CREATE_MATRIX_MANUALLY
|
||||
#if defined(RLGL_CREATE_MATRIX_MANUALLY)
|
||||
#define RLGL_SET_MATRIX_MANUALLY
|
||||
#if defined(RLGL_SET_MATRIX_MANUALLY)
|
||||
matProj = MatrixOrtho(0.0, screenWidth, screenHeight, 0.0, 0.0, 1.0);
|
||||
matView = MatrixIdentity();
|
||||
|
||||
|
|
@ -218,7 +236,7 @@ int main(void)
|
|||
#endif
|
||||
DrawRectangleV((Vector2){ 10.0f, 10.0f }, (Vector2){ 780.0f, 20.0f }, DARKGRAY);
|
||||
|
||||
// Draw internal render batch buffers (3D data)
|
||||
// Draw internal render batch buffers (2D data)
|
||||
rlDrawRenderBatchActive();
|
||||
//-----------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "raylib.h"
|
||||
|
||||
#define PHYSAC_IMPLEMENTATION
|
||||
#include "physac.h"
|
||||
#include "extras/physac.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "raylib.h"
|
||||
|
||||
#define PHYSAC_IMPLEMENTATION
|
||||
#include "physac.h"
|
||||
#include "extras/physac.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue