From 63c65f8cc5d3173fedb74164ed2b89b9e2b776ea Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 12 Mar 2017 12:37:43 +0100 Subject: Updated game to raylib v1.7 --- docs/images/wave_collector_gameplay.png | Bin 0 -> 1004094 bytes docs/images/wave_collector_title.png | Bin 0 -> 1093734 bytes games/wave_collector/screens/screen_ending.c | 6 +++--- games/wave_collector/screens/screen_gameplay.c | 12 ++++++------ games/wave_collector/screens/screen_title.c | 2 +- games/wave_collector/wave_collector.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 docs/images/wave_collector_gameplay.png create mode 100644 docs/images/wave_collector_title.png diff --git a/docs/images/wave_collector_gameplay.png b/docs/images/wave_collector_gameplay.png new file mode 100644 index 00000000..c74ad744 Binary files /dev/null and b/docs/images/wave_collector_gameplay.png differ diff --git a/docs/images/wave_collector_title.png b/docs/images/wave_collector_title.png new file mode 100644 index 00000000..3456caca Binary files /dev/null and b/docs/images/wave_collector_title.png differ diff --git a/games/wave_collector/screens/screen_ending.c b/games/wave_collector/screens/screen_ending.c index d246005c..3e323ad2 100644 --- a/games/wave_collector/screens/screen_ending.c +++ b/games/wave_collector/screens/screen_ending.c @@ -77,12 +77,12 @@ void DrawEndingScreen(void) if (endingStatus == 1) // Win { DrawTexture(texWin, GetScreenWidth()/2 - texWin.width/2, 90, WHITE); - DrawTextEx(font, "congrats, you got the wave!", (Vector2){ 200, 335 }, font.size, 0, WHITE); + DrawTextEx(font, "congrats, you got the wave!", (Vector2){ 200, 335 }, font.baseSize, 0, WHITE); } else if (endingStatus == 2) // Lose { DrawTexture(texLose, GetScreenWidth()/2 - texWin.width/2, 90, WHITE); - DrawTextEx(font, "it seems you lose the wave...", (Vector2){ 205, 335 }, font.size, 0, WHITE); + DrawTextEx(font, "it seems you lose the wave...", (Vector2){ 205, 335 }, font.baseSize, 0, WHITE); } DrawRectangle(0, GetScreenHeight() - 70, 560, 40, Fade(RAYWHITE, 0.8f)); @@ -91,7 +91,7 @@ void DrawEndingScreen(void) DrawText("powered by", GetScreenWidth() - 162, GetScreenHeight() - 190, 20, DARKGRAY); DrawTexture(texLogo, GetScreenWidth() - 128 - 34, GetScreenHeight() - 128 - 36, WHITE); - if ((framesCounter > 80) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to return", (Vector2){ 300, 464 }, font.size, 0, SKYBLUE); + if ((framesCounter > 80) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to return", (Vector2){ 300, 464 }, font.baseSize, 0, SKYBLUE); } // Ending Screen Unload logic diff --git a/games/wave_collector/screens/screen_gameplay.c b/games/wave_collector/screens/screen_gameplay.c index c35ccad6..32e89402 100644 --- a/games/wave_collector/screens/screen_gameplay.c +++ b/games/wave_collector/screens/screen_gameplay.c @@ -399,15 +399,15 @@ void DrawGameplayScreen(void) DrawTexture(texPlayer, player.position.x - 32, player.position.y - 24, WHITE); // Draw pause message - if (pause) DrawTextEx(font, "WAVE PAUSED", (Vector2){ 235, 400 }, font.size*2, 0, WHITE); + if (pause) DrawTextEx(font, "WAVE PAUSED", (Vector2){ 235, 400 }, font.baseSize*2, 0, WHITE); // Draw number of samples //DrawText(FormatText("%05i", collectedSamples), 900, 200, 40, GRAY); //DrawText(FormatText("%05i", totalSamples), 900, 250, 40, GRAY); - DrawTextEx(font, FormatText("%05i / %05i", collectedSamples, totalSamples), (Vector2){810, 170}, font.size, -2, SKYBLUE); + DrawTextEx(font, FormatText("%05i / %05i", collectedSamples, totalSamples), (Vector2){810, 170}, font.baseSize, -2, SKYBLUE); // Draw combo - DrawTextEx(font, FormatText("Combo: %02i [max: %02i]", combo, maxCombo), (Vector2){200, 170}, font.size/2, -2, SKYBLUE); + DrawTextEx(font, FormatText("Combo: %02i [max: %02i]", combo, maxCombo), (Vector2){200, 170}, font.baseSize/2, -2, SKYBLUE); // Draw synchonicity level DrawRectangle(99, 622, 395, 32, Fade(RAYWHITE, 0.8f)); @@ -419,15 +419,15 @@ void DrawGameplayScreen(void) DrawRectangleLines(99, 622, 395, 32, MAROON); - if (synchro == 1.0f) DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.size, -2, GREEN); - else DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.size, -2, SKYBLUE); + if (synchro == 1.0f) DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.baseSize, -2, GREEN); + else DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.baseSize, -2, SKYBLUE); // Draw time warp coool-down bar DrawRectangle(754, 622, 395, 32, Fade(RAYWHITE, 0.8f)); DrawRectangle(754, 622, warpCounter, 32, Fade(SKYBLUE, 0.8f)); DrawRectangleLines(754, 622, 395, 32, DARKGRAY); //DrawText(FormatText("%02i%%", (int)(synchro*100)), 754 + 410, 628, 20, DARKGRAY); - DrawTextEx(font, FormatText("%02i%%", (int)((float)warpCounter/395.0f*100.0f)), (Vector2){754 + 390, 600}, font.size, -2, SKYBLUE); + DrawTextEx(font, FormatText("%02i%%", (int)((float)warpCounter/395.0f*100.0f)), (Vector2){754 + 390, 600}, font.baseSize, -2, SKYBLUE); // Draw wave // NOTE: Old drawing method, replaced by rendertarget diff --git a/games/wave_collector/screens/screen_title.c b/games/wave_collector/screens/screen_title.c index 1d33e3ba..59249db3 100644 --- a/games/wave_collector/screens/screen_title.c +++ b/games/wave_collector/screens/screen_title.c @@ -91,7 +91,7 @@ void DrawTitleScreen(void) DrawText("powered by", GetScreenWidth() - 162, GetScreenHeight() - 190, 20, DARKGRAY); DrawTexture(texLogo, GetScreenWidth() - 128 - 34, GetScreenHeight() - 128 - 36, WHITE); - if ((framesCounter > 160) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to start", (Vector2){ 325, 500 }, font.size, 0, SKYBLUE); + if ((framesCounter > 160) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to start", (Vector2){ 325, 500 }, font.baseSize, 0, SKYBLUE); } // Title Screen Unload logic diff --git a/games/wave_collector/wave_collector.c b/games/wave_collector/wave_collector.c index 76370319..53b4b713 100644 --- a/games/wave_collector/wave_collector.c +++ b/games/wave_collector/wave_collector.c @@ -7,7 +7,7 @@ * The level is actually the wave and the wave is the level! * Be fast! Be smart! Be the best wave collector! * -* This game has been created using raylib (www.raylib.com) +* This game has been created using raylib v1.7 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * * Copyright (c) 2017 Ramon Santamaria (@raysan5) -- cgit v1.2.3 From 3813722f170066c3113d4a3ef6a21ec53af71034 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 14 Mar 2017 00:22:53 +0100 Subject: Added function: DrawLineBezier() --- src/raylib.h | 1 + src/shapes.c | 42 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/raylib.h b/src/raylib.h index b0f03bbe..85689378 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -764,6 +764,7 @@ RLAPI void DrawPixelV(Vector2 position, Color color); RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness +RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) diff --git a/src/shapes.c b/src/shapes.c index 9cbe1da4..5ed633f6 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -57,7 +57,7 @@ //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -// No private (static) functions in this module (.c file) +static float EaseCubicInOut(float t, float b, float c, float d); // Cubic easing //---------------------------------------------------------------------------------- // Module Functions Definition @@ -106,6 +106,13 @@ void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) // Draw a line defining thickness void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color) { + if (startPos.x > endPos.x) + { + Vector2 tempPos = startPos; + startPos = endPos; + endPos = tempPos; + } + float dx = endPos.x - startPos.x; float dy = endPos.y - startPos.y; @@ -133,6 +140,27 @@ void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color) rlDisableTexture(); } +// Draw line using cubic-bezier curves in-out +void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color) +{ + #define LINE_DIVISIONS 24 // Bezier line divisions + + Vector2 previous = startPos; + Vector2 current; + + for (int i = 1; i <= LINE_DIVISIONS; i++) + { + // Cubic easing in-out + // NOTE: Easing is calcutated only for y position value + current.y = EaseCubicInOut(i, startPos.y, endPos.y - startPos.y, LINE_DIVISIONS); + current.x = previous.x + (endPos.x - startPos.x)/LINE_DIVISIONS; + + DrawLineEx(previous, current, thick, color); + + previous = current; + } +} + // Draw a color-filled circle void DrawCircle(int centerX, int centerY, float radius, Color color) { @@ -590,3 +618,15 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) return retRec; } + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- + +// Cubic easing in-out +// NOTE: Required for DrawLineBezier() +static float EaseCubicInOut(float t, float b, float c, float d) +{ + if ((t/=d/2) < 1) return (c/2*t*t*t + b); + return (c/2*((t-=2)*t*t + 2) + b); +} \ No newline at end of file -- cgit v1.2.3 From 5d1f6616618d52f173a918f6a0378aeae1cb05ad Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 14 Mar 2017 01:05:22 +0100 Subject: Remove Oculus support from code Moved to custom example, now raylib only supports simulated VR rendering. Oculus code was too device dependant... waiting for OpenXR. --- examples/core_oculus_rift.c | 469 ++++++++++++++++++++++++++++- src/core.c | 7 +- src/raylib.h | 14 +- src/rlgl.c | 703 +++++++++----------------------------------- src/rlgl.h | 15 +- 5 files changed, 610 insertions(+), 598 deletions(-) diff --git a/examples/core_oculus_rift.c b/examples/core_oculus_rift.c index eb628cd7..f1b0bd3b 100644 --- a/examples/core_oculus_rift.c +++ b/examples/core_oculus_rift.c @@ -3,7 +3,12 @@ * raylib [core] example - Oculus Rift CV1 * * Compile example using: -* gcc -o $(NAME_PART).exe $(FILE_NAME) -L. -L..\src\external\OculusSDK\LibOVR -lLibOVRRT32_1 -lraylib -lglfw3 -lopengl32 -lgdi32 -std=c99 +* gcc -o $(NAME_PART).exe $(FILE_NAME) -I..\src\external -I..\src\external\OculusSDK\LibOVR\Include / +* -L. -L..\src\external\OculusSDK\LibOVR -lLibOVRRT32_1 -lraylib -lglfw3 -lopengl32 -lgdi32 -std=c99 / +* -Wl,-allow-multiple-definition +* +* #define SUPPORT_OCULUS_RIFT_CV1 / RLGL_OCULUS_SUPPORT +* Enable Oculus Rift CV1 functionality * * This example has been created using raylib 1.5 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) @@ -14,6 +19,95 @@ #include "raylib.h" +#include "glad.h" // Required for: OpenGL types and functions declarations +#include "raymath.h" // Required for: Vector3, Quaternion and Matrix functionality + +#include // Required for: memset() +#include // Required for: exit() +#include // required for: vfprintf() +#include // Required for: va_list, va_start(), vfprintf(), va_end() + +#define RLGL_OCULUS_SUPPORT // Enable Oculus Rift code +#if defined(RLGL_OCULUS_SUPPORT) + #include "OVR_CAPI_GL.h" // Oculus SDK for OpenGL +#endif + +//---------------------------------------------------------------------------------- +// Defines and Macros +//---------------------------------------------------------------------------------- +// ... + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- + +// TraceLog message types +typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; + +#if defined(RLGL_OCULUS_SUPPORT) +// Oculus buffer type +typedef struct OculusBuffer { + ovrTextureSwapChain textureChain; + GLuint depthId; + GLuint fboId; + int width; + int height; +} OculusBuffer; + +// Oculus mirror texture type +typedef struct OculusMirror { + ovrMirrorTexture texture; + GLuint fboId; + int width; + int height; +} OculusMirror; + +// Oculus layer type +typedef struct OculusLayer { + ovrViewScaleDesc viewScaleDesc; + ovrLayerEyeFov eyeLayer; // layer 0 + //ovrLayerQuad quadLayer; // TODO: layer 1: '2D' quad for GUI + Matrix eyeProjections[2]; + int width; + int height; +} OculusLayer; +#endif + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- +#if defined(RLGL_OCULUS_SUPPORT) +// OVR device variables +static ovrSession session; // Oculus session (pointer to ovrHmdStruct) +static ovrHmdDesc hmdDesc; // Oculus device descriptor parameters +static ovrGraphicsLuid luid; // Oculus locally unique identifier for the program (64 bit) +static OculusLayer layer; // Oculus drawing layer (similar to photoshop) +static OculusBuffer buffer; // Oculus internal buffers (texture chain and fbo) +static OculusMirror mirror; // Oculus mirror texture and fbo +static unsigned int frameIndex = 0; // Oculus frames counter, used to discard frames from chain +#endif + +//---------------------------------------------------------------------------------- +// Module specific Functions Declaration +//---------------------------------------------------------------------------------- +#if defined(RLGL_OCULUS_SUPPORT) +static bool InitOculusDevice(void); // Initialize Oculus device (returns true if success) +static void CloseOculusDevice(void); // Close Oculus device +static void UpdateOculusTracking(Camera *camera); // Update Oculus head position-orientation tracking +static void BeginOculusDrawing(void); // Setup Oculus buffers for drawing +static void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror + +static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height); // Load Oculus required buffers +static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer); // Unload texture required buffers +static OculusMirror LoadOculusMirror(ovrSession session, int width, int height); // Load Oculus mirror buffers +static void UnloadOculusMirror(ovrSession session, OculusMirror mirror); // Unload Oculus mirror buffers +static void BlitOculusMirror(ovrSession session, OculusMirror mirror); // Copy Oculus screen buffer to mirror texture +static OculusLayer InitOculusLayer(ovrSession session); // Init Oculus layer (similar to photoshop) +static Matrix FromOvrMatrix(ovrMatrix4f ovrM); // Convert from Oculus ovrMatrix4f struct to raymath Matrix struct +#endif + +static void TraceLog(int msgType, const char *text, ...); + int main() { // Initialization @@ -25,8 +119,9 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [core] example - oculus rift"); - // NOTE: If device is not available, it fallbacks to default device (simulator) - InitVrDevice(HMD_OCULUS_RIFT_CV1); // Init VR device (Oculus Rift CV1) + bool vrDeviceReady = InitOculusDevice(); // Init VR device Oculus Rift CV1 + + if (!vrDeviceReady) InitVrSimulator(HMD_OCULUS_RIFT_CV1); // Init VR simulator if device fails // Define the camera to look into our 3d world Camera camera; @@ -47,10 +142,10 @@ int main() { // Update //---------------------------------------------------------------------------------- - if (IsVrSimulator()) UpdateCamera(&camera); // Update camera (simulator mode) - else if (IsVrDeviceReady()) UpdateVrTracking(&camera); // Update camera with device tracking data - - if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); // Toggle VR mode + if (!vrDeviceReady) UpdateCamera(&camera); // Update camera (simulator mode) + else UpdateOculusTracking(&camera); // Update camera with device tracking data + + if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); // Toggle VR mode //---------------------------------------------------------------------------------- // Draw @@ -58,6 +153,9 @@ int main() BeginDrawing(); ClearBackground(RAYWHITE); + + if (vrDeviceReady) BeginOculusDrawing(); + else BeginVrDrawing(); Begin3dMode(camera); @@ -67,6 +165,9 @@ int main() DrawGrid(40, 1.0f); End3dMode(); + + if (vrDeviceReady) EndOculusDrawing(); + else EndVrDrawing(); DrawFPS(10, 10); @@ -76,10 +177,362 @@ int main() // De-Initialization //-------------------------------------------------------------------------------------- - CloseVrDevice(); // Close VR device + if (vrDeviceReady) CloseOculusDevice(); + else CloseVrSimulator(); CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- return 0; } + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- + +#if defined(RLGL_OCULUS_SUPPORT) +// Set internal projection and modelview matrix depending on eyes tracking data +static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) +{ + Matrix eyeProjection = matProjection; + Matrix eyeModelView = matModelView; + + glViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, + layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); + + Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, + layer.eyeLayer.RenderPose[eye].Orientation.y, + layer.eyeLayer.RenderPose[eye].Orientation.z, + layer.eyeLayer.RenderPose[eye].Orientation.w }; + QuaternionInvert(&eyeRenderPose); + Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); + Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, + -layer.eyeLayer.RenderPose[eye].Position.y, + -layer.eyeLayer.RenderPose[eye].Position.z); + + Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement + eyeModelView = MatrixMultiply(matModelView, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement + + eyeProjection = layer.eyeProjections[eye]; +} + +// Initialize Oculus device (returns true if success) +static bool InitOculusDevice(void) +{ + bool oculusReady = false; + + ovrResult result = ovr_Initialize(NULL); + + if (OVR_FAILURE(result)) TraceLog(WARNING, "OVR: Could not initialize Oculus device"); + else + { + result = ovr_Create(&session, &luid); + if (OVR_FAILURE(result)) + { + TraceLog(WARNING, "OVR: Could not create Oculus session"); + ovr_Shutdown(); + } + else + { + hmdDesc = ovr_GetHmdDesc(session); + + TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); + TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); + TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); + TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); + //TraceLog(INFO, "OVR: Serial Number: %s", hmdDesc.SerialNumber); + TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); + + // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... + // ...ideally, it should be (hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2) + + // Initialize Oculus Buffers + layer = InitOculusLayer(session); + buffer = LoadOculusBuffer(session, layer.width, layer.height); + mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); // NOTE: hardcoded... + layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); + + // Recenter OVR tracking origin + ovr_RecenterTrackingOrigin(session); + + oculusReady = true; + } + } + + return oculusReady; +} + +// Close Oculus device (and unload buffers) +static void CloseOculusDevice(void) +{ + UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer + UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers + + ovr_Destroy(session); // Free Oculus session data + ovr_Shutdown(); // Close Oculus device connection +} + +// Update Oculus head position-orientation tracking +static void UpdateOculusTracking(Camera *camera) +{ + frameIndex++; + + ovrPosef eyePoses[2]; + ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); + + layer.eyeLayer.RenderPose[0] = eyePoses[0]; + layer.eyeLayer.RenderPose[1] = eyePoses[1]; + + // TODO: Update external camera with eyePoses data (position, orientation) + // NOTE: We can simplify to simple camera if we consider IPD and HMD device configuration again later + // it will be useful for the user to draw, lets say, billboards oriented to camera + + // Get session status information + ovrSessionStatus sessionStatus; + ovr_GetSessionStatus(session, &sessionStatus); + + if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); + if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); + //if (sessionStatus.HmdPresent) // HMD is present. + //if (sessionStatus.DisplayLost) // HMD was unplugged or the display driver was manually disabled or encountered a TDR. + //if (sessionStatus.HmdMounted) // HMD is on the user's head. + //if (sessionStatus.IsVisible) // the game or experience has VR focus and is visible in the HMD. +} + +// Setup Oculus buffers for drawing +static void BeginOculusDrawing(void) +{ + GLuint currentTexId; + int currentIndex; + + ovr_GetTextureSwapChainCurrentIndex(session, buffer.textureChain, ¤tIndex); + ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, currentIndex, ¤tTexId); + + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); + //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded +} + +// Finish Oculus drawing and blit framebuffer to mirror +static void EndOculusDrawing(void) +{ + // Unbind current framebuffer (Oculus buffer) + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + + ovr_CommitTextureSwapChain(session, buffer.textureChain); + + ovrLayerHeader *layers = &layer.eyeLayer.Header; + ovr_SubmitFrame(session, frameIndex, &layer.viewScaleDesc, &layers, 1); + + // Blit mirror texture to back buffer + BlitOculusMirror(session, mirror); +} + +// Load Oculus required buffers: texture-swap-chain, fbo, texture-depth +static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height) +{ + OculusBuffer buffer; + buffer.width = width; + buffer.height = height; + + // Create OVR texture chain + ovrTextureSwapChainDesc desc = {}; + desc.Type = ovrTexture_2D; + desc.ArraySize = 1; + desc.Width = width; + desc.Height = height; + desc.MipLevels = 1; + desc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; // Requires glEnable(GL_FRAMEBUFFER_SRGB); + desc.SampleCount = 1; + desc.StaticImage = ovrFalse; + + ovrResult result = ovr_CreateTextureSwapChainGL(session, &desc, &buffer.textureChain); + + if (!OVR_SUCCESS(result)) TraceLog(WARNING, "OVR: Failed to create swap textures buffer"); + + int textureCount = 0; + ovr_GetTextureSwapChainLength(session, buffer.textureChain, &textureCount); + + if (!OVR_SUCCESS(result) || !textureCount) TraceLog(WARNING, "OVR: Unable to count swap chain textures"); + + for (int i = 0; i < textureCount; ++i) + { + GLuint chainTexId; + ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, i, &chainTexId); + glBindTexture(GL_TEXTURE_2D, chainTexId); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + } + + glBindTexture(GL_TEXTURE_2D, 0); + + /* + // Setup framebuffer object (using depth texture) + glGenFramebuffers(1, &buffer.fboId); + glGenTextures(1, &buffer.depthId); + glBindTexture(GL_TEXTURE_2D, buffer.depthId); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, buffer.width, buffer.height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + */ + + // Setup framebuffer object (using depth renderbuffer) + glGenFramebuffers(1, &buffer.fboId); + glGenRenderbuffers(1, &buffer.depthId); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); + glBindRenderbuffer(GL_RENDERBUFFER, buffer.depthId); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, buffer.width, buffer.height); + glBindRenderbuffer(GL_RENDERBUFFER, 0); + glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, buffer.depthId); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + + return buffer; +} + +// Unload texture required buffers +static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer) +{ + if (buffer.textureChain) + { + ovr_DestroyTextureSwapChain(session, buffer.textureChain); + buffer.textureChain = NULL; + } + + if (buffer.depthId != 0) glDeleteTextures(1, &buffer.depthId); + if (buffer.fboId != 0) glDeleteFramebuffers(1, &buffer.fboId); +} + +// Load Oculus mirror buffers +static OculusMirror LoadOculusMirror(ovrSession session, int width, int height) +{ + OculusMirror mirror; + mirror.width = width; + mirror.height = height; + + ovrMirrorTextureDesc mirrorDesc; + memset(&mirrorDesc, 0, sizeof(mirrorDesc)); + mirrorDesc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; + mirrorDesc.Width = mirror.width; + mirrorDesc.Height = mirror.height; + + if (!OVR_SUCCESS(ovr_CreateMirrorTextureGL(session, &mirrorDesc, &mirror.texture))) TraceLog(WARNING, "Could not create mirror texture"); + + glGenFramebuffers(1, &mirror.fboId); + + return mirror; +} + +// Unload Oculus mirror buffers +static void UnloadOculusMirror(ovrSession session, OculusMirror mirror) +{ + if (mirror.fboId != 0) glDeleteFramebuffers(1, &mirror.fboId); + if (mirror.texture) ovr_DestroyMirrorTexture(session, mirror.texture); +} + +// Copy Oculus screen buffer to mirror texture +static void BlitOculusMirror(ovrSession session, OculusMirror mirror) +{ + GLuint mirrorTextureId; + + ovr_GetMirrorTextureBufferGL(session, mirror.texture, &mirrorTextureId); + + glBindFramebuffer(GL_READ_FRAMEBUFFER, mirror.fboId); + glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mirrorTextureId, 0); +#if defined(GRAPHICS_API_OPENGL_33) + // NOTE: glBlitFramebuffer() requires extension: GL_EXT_framebuffer_blit (not available in OpenGL ES 2.0) + glBlitFramebuffer(0, 0, mirror.width, mirror.height, 0, mirror.height, mirror.width, 0, GL_COLOR_BUFFER_BIT, GL_NEAREST); +#endif + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); +} + +// Init Oculus layer (similar to photoshop) +static OculusLayer InitOculusLayer(ovrSession session) +{ + OculusLayer layer = { 0 }; + + layer.viewScaleDesc.HmdSpaceToWorldScaleInMeters = 1.0f; + + memset(&layer.eyeLayer, 0, sizeof(ovrLayerEyeFov)); + layer.eyeLayer.Header.Type = ovrLayerType_EyeFov; + layer.eyeLayer.Header.Flags = ovrLayerFlag_TextureOriginAtBottomLeft; + + ovrEyeRenderDesc eyeRenderDescs[2]; + + for (int eye = 0; eye < 2; eye++) + { + eyeRenderDescs[eye] = ovr_GetRenderDesc(session, eye, hmdDesc.DefaultEyeFov[eye]); + ovrMatrix4f ovrPerspectiveProjection = ovrMatrix4f_Projection(eyeRenderDescs[eye].Fov, 0.01f, 10000.0f, ovrProjection_None); //ovrProjection_ClipRangeOpenGL); + layer.eyeProjections[eye] = FromOvrMatrix(ovrPerspectiveProjection); // NOTE: struct ovrMatrix4f { float M[4][4] } --> struct Matrix + + layer.viewScaleDesc.HmdToEyeOffset[eye] = eyeRenderDescs[eye].HmdToEyeOffset; + layer.eyeLayer.Fov[eye] = eyeRenderDescs[eye].Fov; + + ovrSizei eyeSize = ovr_GetFovTextureSize(session, eye, layer.eyeLayer.Fov[eye], 1.0f); + layer.eyeLayer.Viewport[eye].Size = eyeSize; + layer.eyeLayer.Viewport[eye].Pos.x = layer.width; + layer.eyeLayer.Viewport[eye].Pos.y = 0; + + layer.height = eyeSize.h; //std::max(renderTargetSize.y, (uint32_t)eyeSize.h); + layer.width += eyeSize.w; + } + + return layer; +} + +// Convert from Oculus ovrMatrix4f struct to raymath Matrix struct +static Matrix FromOvrMatrix(ovrMatrix4f ovrmat) +{ + Matrix rmat; + + rmat.m0 = ovrmat.M[0][0]; + rmat.m1 = ovrmat.M[1][0]; + rmat.m2 = ovrmat.M[2][0]; + rmat.m3 = ovrmat.M[3][0]; + rmat.m4 = ovrmat.M[0][1]; + rmat.m5 = ovrmat.M[1][1]; + rmat.m6 = ovrmat.M[2][1]; + rmat.m7 = ovrmat.M[3][1]; + rmat.m8 = ovrmat.M[0][2]; + rmat.m9 = ovrmat.M[1][2]; + rmat.m10 = ovrmat.M[2][2]; + rmat.m11 = ovrmat.M[3][2]; + rmat.m12 = ovrmat.M[0][3]; + rmat.m13 = ovrmat.M[1][3]; + rmat.m14 = ovrmat.M[2][3]; + rmat.m15 = ovrmat.M[3][3]; + + MatrixTranspose(&rmat); + + return rmat; +} +#endif + +// Output a trace log message +// NOTE: Expected msgType: (0)Info, (1)Error, (2)Warning +static void TraceLog(int msgType, const char *text, ...) +{ + va_list args; + va_start(args, text); + + switch (msgType) + { + case INFO: fprintf(stdout, "INFO: "); break; + case ERROR: fprintf(stdout, "ERROR: "); break; + case WARNING: fprintf(stdout, "WARNING: "); break; + case DEBUG: fprintf(stdout, "DEBUG: "); break; + default: break; + } + + vfprintf(stdout, text, args); + fprintf(stdout, "\n"); + + va_end(args); + + if (msgType == ERROR) exit(1); +} + diff --git a/src/core.c b/src/core.c index c0f5be83..38549354 100644 --- a/src/core.c +++ b/src/core.c @@ -755,11 +755,8 @@ void End2dMode(void) void Begin3dMode(Camera camera) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) - - if (IsVrDeviceReady() || IsVrSimulator()) BeginVrDrawing(); - + rlMatrixMode(RL_PROJECTION); // Switch to projection matrix - rlPushMatrix(); // Save previous matrix, which contains the settings for the 2d ortho projection rlLoadIdentity(); // Reset current matrix (PROJECTION) @@ -786,8 +783,6 @@ void End3dMode(void) { rlglDraw(); // Process internal buffers (update + draw) - if (IsVrDeviceReady() || IsVrSimulator()) EndVrDrawing(); - rlMatrixMode(RL_PROJECTION); // Switch to projection matrix rlPopMatrix(); // Restore previous matrix (PROJECTION) from matrix stack diff --git a/src/raylib.h b/src/raylib.h index 85689378..e679e011 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -687,6 +687,7 @@ RLAPI Color Fade(Color color, float alpha); // Color fade- RLAPI void SetConfigFlags(char flags); // Setup some window configuration flags RLAPI void ShowLogo(void); // Activates raylib logo at startup (can be done with flags) +//RLAPI void TraceLog(int logType, const char *text, ...); // Trace log messages showing (INFO, WARNING, ERROR, DEBUG) RLAPI bool IsFileDropped(void); // Check if a file have been dropped into window RLAPI char **GetDroppedFiles(int *count); // Retrieve dropped files into window @@ -944,12 +945,13 @@ RLAPI void EndBlendMode(void); // End // VR experience Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 //------------------------------------------------------------------------------------ -RLAPI void InitVrDevice(int vdDevice); // Init VR device -RLAPI void CloseVrDevice(void); // Close VR device -RLAPI bool IsVrDeviceReady(void); // Detect if VR device is ready -RLAPI bool IsVrSimulator(void); // Detect if VR simulator is running -RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera -RLAPI void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) +RLAPI void InitVrSimulator(int vrDevice); // Init VR simulator for selected device +RLAPI void CloseVrSimulator(void); // Close VR simulator for current device +RLAPI bool IsVrSimulatorReady(void); // Detect if VR device is ready +RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera +RLAPI void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) +RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering +RLAPI void EndVrDrawing(void); // End VR simulator stereo rendering //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) diff --git a/src/rlgl.c b/src/rlgl.c index ffc9d741..00998624 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -37,9 +37,7 @@ * * #define SUPPORT_SHADER_DISTORTION * -* -* #define SUPPORT_OCULUS_RIFT_CV1 / RLGL_OCULUS_SUPPORT -* Enable Oculus Rift CV1 functionality +* #define SUPPORT_VR_SIMULATION * * #define SUPPORT_STEREO_RENDERING * @@ -121,17 +119,6 @@ #include "shader_distortion.h" // Distortion shader to be embedded #endif -//#define RLGL_OCULUS_SUPPORT // Enable Oculus Rift code -#if defined(RLGL_OCULUS_SUPPORT) - #include "external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h" // Oculus SDK for OpenGL -#endif - -#if defined(RLGL_STANDALONE) - #define OCULUSAPI -#else - #define OCULUSAPI static -#endif - //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -187,15 +174,15 @@ #endif #if defined(GRAPHICS_API_OPENGL_11) - #define GL_UNSIGNED_SHORT_5_6_5 0x8363 - #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 - #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 + #define GL_UNSIGNED_SHORT_5_6_5 0x8363 + #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 + #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #endif #if defined(GRAPHICS_API_OPENGL_ES2) - #define glClearDepth glClearDepthf - #define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER - #define GL_DRAW_FRAMEBUFFER GL_FRAMEBUFFER + #define glClearDepth glClearDepthf + #define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER + #define GL_DRAW_FRAMEBUFFER GL_FRAMEBUFFER #endif // Default vertex attribute names on shader to set location points @@ -267,32 +254,6 @@ typedef struct VrStereoConfig { Matrix eyesViewOffset[2]; // VR stereo rendering eyes view offset matrices } VrStereoConfig; -#if defined(RLGL_OCULUS_SUPPORT) -typedef struct OculusBuffer { - ovrTextureSwapChain textureChain; - GLuint depthId; - GLuint fboId; - int width; - int height; -} OculusBuffer; - -typedef struct OculusMirror { - ovrMirrorTexture texture; - GLuint fboId; - int width; - int height; -} OculusMirror; - -typedef struct OculusLayer { - ovrViewScaleDesc viewScaleDesc; - ovrLayerEyeFov eyeLayer; // layer 0 - //ovrLayerQuad quadLayer; // TODO: layer 1: '2D' quad for GUI - Matrix eyeProjections[2]; - int width; - int height; -} OculusLayer; -#endif - //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- @@ -343,24 +304,11 @@ static float maxAnisotropicLevel = 0.0f; // Maximum anisotropy level supp // Extension supported flag: Clamp mirror wrap mode static bool texClampMirrorSupported = false; // Clamp mirror wrap mode supported -#if defined(RLGL_OCULUS_SUPPORT) -// OVR device variables -static ovrSession session; // Oculus session (pointer to ovrHmdStruct) -static ovrHmdDesc hmdDesc; // Oculus device descriptor parameters -static ovrGraphicsLuid luid; // Oculus locally unique identifier for the program (64 bit) -static OculusLayer layer; // Oculus drawing layer (similar to photoshop) -static OculusBuffer buffer; // Oculus internal buffers (texture chain and fbo) -static OculusMirror mirror; // Oculus mirror texture and fbo -static unsigned int frameIndex = 0; // Oculus frames counter, used to discard frames from chain -#endif - // VR global variables static VrDeviceInfo hmd; // Current VR device info static VrStereoConfig vrConfig; // VR stereo configuration for simulator -static bool vrDeviceReady = false; // VR device ready flag -static bool vrSimulator = false; // VR simulator enabled flag -static bool vrEnabled = false; // VR experience enabled (device or simulator) -static bool vrRendering = true; // VR stereo rendering enabled/disabled flag +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) @@ -380,7 +328,7 @@ static int blendMode = 0; // Track current blending mode // White texture useful for plain color polys (required by shader) static unsigned int whiteTexture; -// Default framebuffer size (required by Oculus device) +// Default framebuffer size static int screenWidth; // Default framebuffer width static int screenHeight; // Default framebuffer height @@ -397,7 +345,7 @@ static void UnloadDefaultShader(void); // Unload default shader static void LoadDefaultBuffers(void); // Load default internal buffers (lines, triangles, quads) static void UpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data -static void DrawDefaultBuffers(int eyesCount); // Draw default internal buffers vertex data +static void DrawDefaultBuffers(void); // Draw default internal buffers vertex data static void UnloadDefaultBuffers(void); // Unload default internal buffers vertex data from CPU and GPU // Configure stereo rendering (including distortion shader) with HMD device parameters @@ -407,26 +355,6 @@ static void SetStereoConfig(VrDeviceInfo info); static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView); #endif -#if defined(RLGL_OCULUS_SUPPORT) -#if !defined(RLGL_STANDALONE) -static bool InitOculusDevice(void); // Initialize Oculus device (returns true if success) -static void CloseOculusDevice(void); // Close Oculus device -static void UpdateOculusTracking(Camera *camera); // Update Oculus head position-orientation tracking -static void BeginOculusDrawing(void); // Setup Oculus buffers for drawing -static void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror -#endif - -static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height); // Load Oculus required buffers -static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer); // Unload texture required buffers -static OculusMirror LoadOculusMirror(ovrSession session, int width, int height); // Load Oculus mirror buffers -static void UnloadOculusMirror(ovrSession session, OculusMirror mirror); // Unload Oculus mirror buffers -static void BlitOculusMirror(ovrSession session, OculusMirror mirror); // Copy Oculus screen buffer to mirror texture -static OculusLayer InitOculusLayer(ovrSession session); // Init Oculus layer (similar to photoshop) -static Matrix FromOvrMatrix(ovrMatrix4f ovrM); // Convert from Oculus ovrMatrix4f struct to raymath Matrix struct -#endif - - - #if defined(GRAPHICS_API_OPENGL_11) static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight); static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight); @@ -1352,9 +1280,7 @@ void rlglDraw(void) // NOTE: Default buffers upload and draw UpdateDefaultBuffers(); - - if (vrEnabled && vrRendering) DrawDefaultBuffers(2); - else DrawDefaultBuffers(1); + DrawDefaultBuffers(); // NOTE: Stereo rendering is checked inside #endif } @@ -2018,9 +1944,6 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) #endif #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - int eyesCount = 1; - if (vrEnabled) eyesCount = 2; - glUseProgram(material.shader.id); // Upload to shader material.colDiffuse @@ -2153,6 +2076,9 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); } + int eyesCount = 1; + if (vrStereoRender) eyesCount = 2; + for (int eye = 0; eye < eyesCount; eye++) { if (eyesCount == 2) SetStereoView(eye, matProjection, matModelView); @@ -2617,146 +2543,119 @@ void EndBlendMode(void) BeginBlendMode(BLEND_ALPHA); } -// Init VR device (or simulator) -// NOTE: If device is not available, it fallbacks to default device (simulator) +// Init VR simulator for selected device // NOTE: It modifies the global variable: VrDeviceInfo hmd -void InitVrDevice(int vrDevice) +void InitVrSimulator(int vrDevice) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - switch (vrDevice) - { - case HMD_DEFAULT_DEVICE: TraceLog(INFO, "Initializing default VR Device (Oculus Rift CV1)"); - case HMD_OCULUS_RIFT_DK2: - case HMD_OCULUS_RIFT_CV1: - { -#if defined(RLGL_OCULUS_SUPPORT) - vrDeviceReady = InitOculusDevice(); -#else - TraceLog(WARNING, "Oculus Rift not supported by default, recompile raylib with Oculus support"); -#endif - } break; - case HMD_VALVE_HTC_VIVE: - case HMD_SAMSUNG_GEAR_VR: - case HMD_GOOGLE_CARDBOARD: - case HMD_SONY_PLAYSTATION_VR: - case HMD_RAZER_OSVR: - case HMD_FOVE_VR: TraceLog(WARNING, "VR Device not supported"); - default: break; - } - - if (!vrDeviceReady) - { - TraceLog(WARNING, "VR Device not found: Initializing VR Simulator (Oculus Rift CV1)"); - - if (vrDevice == HMD_OCULUS_RIFT_DK2) - { - // Oculus Rift DK2 parameters - hmd.hResolution = 1280; // HMD horizontal resolution in pixels - hmd.vResolution = 800; // HMD vertical resolution in pixels - hmd.hScreenSize = 0.14976f; // HMD horizontal size in meters - hmd.vScreenSize = 0.09356f; // HMD vertical size in meters - hmd.vScreenCenter = 0.04678f; // HMD screen center in meters - hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters - hmd.lensSeparationDistance = 0.0635f; // HMD lens separation distance in meters - hmd.interpupillaryDistance = 0.064f; // HMD IPD (distance between pupils) in meters - hmd.distortionK[0] = 1.0f; // HMD lens distortion constant parameter 0 - hmd.distortionK[1] = 0.22f; // HMD lens distortion constant parameter 1 - hmd.distortionK[2] = 0.24f; // HMD lens distortion constant parameter 2 - hmd.distortionK[3] = 0.0f; // HMD lens distortion constant parameter 3 - hmd.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 - hmd.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 - hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 - hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 - } - else if ((vrDevice == HMD_DEFAULT_DEVICE) || (vrDevice == HMD_OCULUS_RIFT_CV1)) - { - // Oculus Rift CV1 parameters - // NOTE: CV1 represents a complete HMD redesign compared to previous versions, - // new Fresnel-hybrid-asymmetric lenses have been added and, consequently, - // previous parameters (DK2) and distortion shader (DK2) doesn't work any more. - // I just defined a set of parameters for simulator that approximate to CV1 stereo rendering - // but result is not the same obtained with Oculus PC SDK. - hmd.hResolution = 2160; // HMD horizontal resolution in pixels - hmd.vResolution = 1200; // HMD vertical resolution in pixels - hmd.hScreenSize = 0.133793f; // HMD horizontal size in meters - hmd.vScreenSize = 0.0669f; // HMD vertical size in meters - hmd.vScreenCenter = 0.04678f; // HMD screen center in meters - hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters - hmd.lensSeparationDistance = 0.07f; // HMD lens separation distance in meters - hmd.interpupillaryDistance = 0.07f; // HMD IPD (distance between pupils) in meters - hmd.distortionK[0] = 1.0f; // HMD lens distortion constant parameter 0 - hmd.distortionK[1] = 0.22f; // HMD lens distortion constant parameter 1 - hmd.distortionK[2] = 0.24f; // HMD lens distortion constant parameter 2 - hmd.distortionK[3] = 0.0f; // HMD lens distortion constant parameter 3 - hmd.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 - hmd.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 - hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 - hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 - } - - // Initialize framebuffer and textures for stereo rendering - // NOTE: screen size should match HMD aspect ratio - vrConfig.stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); - - // Load distortion shader (initialized by default with Oculus Rift CV1 parameters) - vrConfig.distortionShader.id = LoadShaderProgram(vDistortionShaderStr, fDistortionShaderStr); - if (vrConfig.distortionShader.id != 0) LoadDefaultShaderLocations(&vrConfig.distortionShader); - - SetStereoConfig(hmd); - - vrSimulator = true; - vrEnabled = true; - } + if (vrDevice == HMD_OCULUS_RIFT_DK2) + { + // Oculus Rift DK2 parameters + hmd.hResolution = 1280; // HMD horizontal resolution in pixels + hmd.vResolution = 800; // HMD vertical resolution in pixels + hmd.hScreenSize = 0.14976f; // HMD horizontal size in meters + hmd.vScreenSize = 0.09356f; // HMD vertical size in meters + hmd.vScreenCenter = 0.04678f; // HMD screen center in meters + hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters + hmd.lensSeparationDistance = 0.0635f; // HMD lens separation distance in meters + hmd.interpupillaryDistance = 0.064f; // HMD IPD (distance between pupils) in meters + hmd.distortionK[0] = 1.0f; // HMD lens distortion constant parameter 0 + hmd.distortionK[1] = 0.22f; // HMD lens distortion constant parameter 1 + hmd.distortionK[2] = 0.24f; // HMD lens distortion constant parameter 2 + hmd.distortionK[3] = 0.0f; // HMD lens distortion constant parameter 3 + hmd.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 + hmd.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 + hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 + hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 + + TraceLog(WARNING, "Initializing VR Simulator (Oculus Rift DK2)"); + } + else if ((vrDevice == HMD_DEFAULT_DEVICE) || (vrDevice == HMD_OCULUS_RIFT_CV1)) + { + // Oculus Rift CV1 parameters + // NOTE: CV1 represents a complete HMD redesign compared to previous versions, + // new Fresnel-hybrid-asymmetric lenses have been added and, consequently, + // previous parameters (DK2) and distortion shader (DK2) doesn't work any more. + // I just defined a set of parameters for simulator that approximate to CV1 stereo rendering + // but result is not the same obtained with Oculus PC SDK. + hmd.hResolution = 2160; // HMD horizontal resolution in pixels + hmd.vResolution = 1200; // HMD vertical resolution in pixels + hmd.hScreenSize = 0.133793f; // HMD horizontal size in meters + hmd.vScreenSize = 0.0669f; // HMD vertical size in meters + hmd.vScreenCenter = 0.04678f; // HMD screen center in meters + hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters + hmd.lensSeparationDistance = 0.07f; // HMD lens separation distance in meters + hmd.interpupillaryDistance = 0.07f; // HMD IPD (distance between pupils) in meters + hmd.distortionK[0] = 1.0f; // HMD lens distortion constant parameter 0 + hmd.distortionK[1] = 0.22f; // HMD lens distortion constant parameter 1 + hmd.distortionK[2] = 0.24f; // HMD lens distortion constant parameter 2 + hmd.distortionK[3] = 0.0f; // HMD lens distortion constant parameter 3 + hmd.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 + hmd.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 + hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 + hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 + + TraceLog(WARNING, "Initializing VR Simulator (Oculus Rift CV1)"); + } + else + { + TraceLog(WARNING, "VR Simulator doesn't support current device yet,"); + TraceLog(WARNING, "using default VR Simulator parameters"); + } + + // Initialize framebuffer and textures for stereo rendering + // NOTE: screen size should match HMD aspect ratio + vrConfig.stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); + + // Load distortion shader (initialized by default with Oculus Rift CV1 parameters) + vrConfig.distortionShader.id = LoadShaderProgram(vDistortionShaderStr, fDistortionShaderStr); + if (vrConfig.distortionShader.id != 0) LoadDefaultShaderLocations(&vrConfig.distortionShader); + + SetStereoConfig(hmd); + + vrSimulatorReady = true; #endif #if defined(GRAPHICS_API_OPENGL_11) - TraceLog(WARNING, "VR device or simulator not supported on OpenGL 1.1"); + TraceLog(WARNING, "VR Simulator not supported on OpenGL 1.1"); #endif } -// Close VR device (or simulator) -void CloseVrDevice(void) +// Close VR simulator for current device +void CloseVrSimulator(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -#if defined(RLGL_OCULUS_SUPPORT) - if (vrDeviceReady) CloseOculusDevice(); - else -#endif + if (vrSimulatorReady) { rlDeleteRenderTextures(vrConfig.stereoFbo); // Unload stereo framebuffer and texture UnloadShader(vrConfig.distortionShader); // Unload distortion shader } #endif - vrDeviceReady = false; -} - -// Detect if VR device is available -bool IsVrDeviceReady(void) -{ - return (vrDeviceReady && vrEnabled); } // Detect if VR simulator is running -bool IsVrSimulator(void) +bool IsVrSimulatorReady(void) { - return (vrSimulator && vrEnabled); + return vrSimulatorReady; } // Enable/Disable VR experience (device or simulator) void ToggleVrMode(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (vrDeviceReady || vrSimulator) vrEnabled = !vrEnabled; - else vrEnabled = false; + vrSimulatorReady = !vrSimulatorReady; - if (!vrEnabled) + if (!vrSimulatorReady) { + vrStereoRender = false; + // Reset viewport and default projection-modelview matrices rlViewport(0, 0, screenWidth, screenHeight); projection = MatrixOrtho(0, screenWidth, screenHeight, 0, 0.0f, 1.0f); MatrixTranspose(&projection); modelview = MatrixIdentity(); } + else vrStereoRender = true; #endif } @@ -2764,37 +2663,29 @@ void ToggleVrMode(void) // NOTE: Camera (position, target, up) gets update with head tracking information void UpdateVrTracking(Camera *camera) { -#if defined(RLGL_OCULUS_SUPPORT) - if (vrDeviceReady) UpdateOculusTracking(camera); -#endif + // TODO: Simulate 1st person camera system } // Begin Oculus drawing configuration void BeginVrDrawing(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -#if defined(RLGL_OCULUS_SUPPORT) - if (vrDeviceReady) - { - BeginOculusDrawing(); - } - else -#endif + if (vrSimulatorReady) { // Setup framebuffer for stereo rendering rlEnableRenderTexture(vrConfig.stereoFbo.id); - } - // NOTE: If your application is configured to treat the texture as a linear format (e.g. GL_RGBA) - // and performs linear-to-gamma conversion in GLSL or does not care about gamma-correction, then: - // - Require OculusBuffer format to be OVR_FORMAT_R8G8B8A8_UNORM_SRGB - // - Do NOT enable GL_FRAMEBUFFER_SRGB - //glEnable(GL_FRAMEBUFFER_SRGB); + // NOTE: If your application is configured to treat the texture as a linear format (e.g. GL_RGBA) + // and performs linear-to-gamma conversion in GLSL or does not care about gamma-correction, then: + // - Require OculusBuffer format to be OVR_FORMAT_R8G8B8A8_UNORM_SRGB + // - Do NOT enable GL_FRAMEBUFFER_SRGB + //glEnable(GL_FRAMEBUFFER_SRGB); - //glViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) - rlClearScreenBuffers(); // Clear current framebuffer(s) - - vrRendering = true; + //glViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) + rlClearScreenBuffers(); // Clear current framebuffer(s) + + vrStereoRender = true; + } #endif } @@ -2802,18 +2693,13 @@ void BeginVrDrawing(void) void EndVrDrawing(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -#if defined(RLGL_OCULUS_SUPPORT) - if (vrDeviceReady) - { - EndOculusDrawing(); - } - else -#endif + if (vrSimulatorReady) { - // Unbind current framebuffer - rlDisableRenderTexture(); + vrStereoRender = false; // Disable stereo render + + rlDisableRenderTexture(); // Unbind current framebuffer - rlClearScreenBuffers(); // Clear current framebuffer + rlClearScreenBuffers(); // Clear current framebuffer // Set viewport to default framebuffer size (screen size) rlViewport(0, 0, screenWidth, screenHeight); @@ -2855,15 +2741,21 @@ void EndVrDrawing(void) rlDisableTexture(); + // Update and draw render texture fbo with distortion to backbuffer UpdateDefaultBuffers(); - DrawDefaultBuffers(1); - + DrawDefaultBuffers(); + + // Restore defaultShader currentShader = defaultShader; - } - - rlDisableDepthTest(); - vrRendering = false; + // Reset viewport and default projection-modelview matrices + rlViewport(0, 0, screenWidth, screenHeight); + projection = MatrixOrtho(0, screenWidth, screenHeight, 0, 0.0f, 1.0f); + MatrixTranspose(&projection); + modelview = MatrixIdentity(); + + rlDisableDepthTest(); + } #endif } @@ -3405,10 +3297,13 @@ static void UpdateDefaultBuffers(void) // Draw default internal buffers vertex data // NOTE: We draw in this order: lines, triangles, quads -static void DrawDefaultBuffers(int eyesCount) +static void DrawDefaultBuffers() { Matrix matProjection = projection; Matrix matModelView = modelview; + + int eyesCount = 1; + if (vrStereoRender) eyesCount = 2; for (int eye = 0; eye < eyesCount; eye++) { @@ -3693,47 +3588,19 @@ static void SetStereoConfig(VrDeviceInfo hmd) // Set internal projection and modelview matrix depending on eyes tracking data static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) { - if (vrEnabled) - { - Matrix eyeProjection = matProjection; - Matrix eyeModelView = matModelView; + Matrix eyeProjection = matProjection; + Matrix eyeModelView = matModelView; -#if defined(RLGL_OCULUS_SUPPORT) - if (vrDeviceReady) - { - rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, - layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); - - Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, - layer.eyeLayer.RenderPose[eye].Orientation.y, - layer.eyeLayer.RenderPose[eye].Orientation.z, - layer.eyeLayer.RenderPose[eye].Orientation.w }; - QuaternionInvert(&eyeRenderPose); - Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); - Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, - -layer.eyeLayer.RenderPose[eye].Position.y, - -layer.eyeLayer.RenderPose[eye].Position.z); - - Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement - eyeModelView = MatrixMultiply(matModelView, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement - - eyeProjection = layer.eyeProjections[eye]; - } - else -#endif - { - // Setup viewport and projection/modelview matrices using tracking data - rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); + // Setup viewport and projection/modelview matrices using tracking data + rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); - // Apply view offset to modelview matrix - eyeModelView = MatrixMultiply(matModelView, vrConfig.eyesViewOffset[eye]); + // Apply view offset to modelview matrix + eyeModelView = MatrixMultiply(matModelView, vrConfig.eyesViewOffset[eye]); - eyeProjection = vrConfig.eyesProjection[eye]; - } + eyeProjection = vrConfig.eyesProjection[eye]; - SetMatrixModelview(eyeModelView); - SetMatrixProjection(eyeProjection); - } + SetMatrixModelview(eyeModelView); + SetMatrixProjection(eyeProjection); } #endif //defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) @@ -3864,304 +3731,6 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) } #endif -#if defined(RLGL_OCULUS_SUPPORT) -// Initialize Oculus device (returns true if success) -OCULUSAPI bool InitOculusDevice(void) -{ - bool oculusReady = false; - - ovrResult result = ovr_Initialize(NULL); - - if (OVR_FAILURE(result)) TraceLog(WARNING, "OVR: Could not initialize Oculus device"); - else - { - result = ovr_Create(&session, &luid); - if (OVR_FAILURE(result)) - { - TraceLog(WARNING, "OVR: Could not create Oculus session"); - ovr_Shutdown(); - } - else - { - hmdDesc = ovr_GetHmdDesc(session); - - TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); - TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); - TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); - TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); - //TraceLog(INFO, "OVR: Serial Number: %s", hmdDesc.SerialNumber); - TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); - - // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... - // ...ideally, it should be (hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2) - - // Initialize Oculus Buffers - layer = InitOculusLayer(session); - buffer = LoadOculusBuffer(session, layer.width, layer.height); - mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); // NOTE: hardcoded... - layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); - - // Recenter OVR tracking origin - ovr_RecenterTrackingOrigin(session); - - oculusReady = true; - vrEnabled = true; - } - } - - return oculusReady; -} - -// Close Oculus device (and unload buffers) -OCULUSAPI void CloseOculusDevice(void) -{ - UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer - UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers - - ovr_Destroy(session); // Free Oculus session data - ovr_Shutdown(); // Close Oculus device connection -} - -// Update Oculus head position-orientation tracking -OCULUSAPI void UpdateOculusTracking(Camera *camera) -{ - frameIndex++; - - ovrPosef eyePoses[2]; - ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); - - layer.eyeLayer.RenderPose[0] = eyePoses[0]; - layer.eyeLayer.RenderPose[1] = eyePoses[1]; - - // TODO: Update external camera with eyePoses data (position, orientation) - // NOTE: We can simplify to simple camera if we consider IPD and HMD device configuration again later - // it will be useful for the user to draw, lets say, billboards oriented to camera - - // Get session status information - ovrSessionStatus sessionStatus; - ovr_GetSessionStatus(session, &sessionStatus); - - if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); - if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); - //if (sessionStatus.HmdPresent) // HMD is present. - //if (sessionStatus.DisplayLost) // HMD was unplugged or the display driver was manually disabled or encountered a TDR. - //if (sessionStatus.HmdMounted) // HMD is on the user's head. - //if (sessionStatus.IsVisible) // the game or experience has VR focus and is visible in the HMD. -} - -// Setup Oculus buffers for drawing -OCULUSAPI void BeginOculusDrawing(void) -{ - GLuint currentTexId; - int currentIndex; - - ovr_GetTextureSwapChainCurrentIndex(session, buffer.textureChain, ¤tIndex); - ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, currentIndex, ¤tTexId); - - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); - //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded -} - -// Finish Oculus drawing and blit framebuffer to mirror -OCULUSAPI void EndOculusDrawing(void) -{ - // Unbind current framebuffer (Oculus buffer) - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - - ovr_CommitTextureSwapChain(session, buffer.textureChain); - - ovrLayerHeader *layers = &layer.eyeLayer.Header; - ovr_SubmitFrame(session, frameIndex, &layer.viewScaleDesc, &layers, 1); - - // Blit mirror texture to back buffer - BlitOculusMirror(session, mirror); -} - -// Load Oculus required buffers: texture-swap-chain, fbo, texture-depth -static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height) -{ - OculusBuffer buffer; - buffer.width = width; - buffer.height = height; - - // Create OVR texture chain - ovrTextureSwapChainDesc desc = {}; - desc.Type = ovrTexture_2D; - desc.ArraySize = 1; - desc.Width = width; - desc.Height = height; - desc.MipLevels = 1; - desc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; // Requires glEnable(GL_FRAMEBUFFER_SRGB); - desc.SampleCount = 1; - desc.StaticImage = ovrFalse; - - ovrResult result = ovr_CreateTextureSwapChainGL(session, &desc, &buffer.textureChain); - - if (!OVR_SUCCESS(result)) TraceLog(WARNING, "OVR: Failed to create swap textures buffer"); - - int textureCount = 0; - ovr_GetTextureSwapChainLength(session, buffer.textureChain, &textureCount); - - if (!OVR_SUCCESS(result) || !textureCount) TraceLog(WARNING, "OVR: Unable to count swap chain textures"); - - for (int i = 0; i < textureCount; ++i) - { - GLuint chainTexId; - ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, i, &chainTexId); - glBindTexture(GL_TEXTURE_2D, chainTexId); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - } - - glBindTexture(GL_TEXTURE_2D, 0); - - /* - // Setup framebuffer object (using depth texture) - glGenFramebuffers(1, &buffer.fboId); - glGenTextures(1, &buffer.depthId); - glBindTexture(GL_TEXTURE_2D, buffer.depthId); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, buffer.width, buffer.height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); - */ - - // Setup framebuffer object (using depth renderbuffer) - glGenFramebuffers(1, &buffer.fboId); - glGenRenderbuffers(1, &buffer.depthId); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); - glBindRenderbuffer(GL_RENDERBUFFER, buffer.depthId); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, buffer.width, buffer.height); - glBindRenderbuffer(GL_RENDERBUFFER, 0); - glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, buffer.depthId); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - - return buffer; -} - -// Unload texture required buffers -static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer) -{ - if (buffer.textureChain) - { - ovr_DestroyTextureSwapChain(session, buffer.textureChain); - buffer.textureChain = NULL; - } - - if (buffer.depthId != 0) glDeleteTextures(1, &buffer.depthId); - if (buffer.fboId != 0) glDeleteFramebuffers(1, &buffer.fboId); -} - -// Load Oculus mirror buffers -static OculusMirror LoadOculusMirror(ovrSession session, int width, int height) -{ - OculusMirror mirror; - mirror.width = width; - mirror.height = height; - - ovrMirrorTextureDesc mirrorDesc; - memset(&mirrorDesc, 0, sizeof(mirrorDesc)); - mirrorDesc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; - mirrorDesc.Width = mirror.width; - mirrorDesc.Height = mirror.height; - - if (!OVR_SUCCESS(ovr_CreateMirrorTextureGL(session, &mirrorDesc, &mirror.texture))) TraceLog(WARNING, "Could not create mirror texture"); - - glGenFramebuffers(1, &mirror.fboId); - - return mirror; -} - -// Unload Oculus mirror buffers -static void UnloadOculusMirror(ovrSession session, OculusMirror mirror) -{ - if (mirror.fboId != 0) glDeleteFramebuffers(1, &mirror.fboId); - if (mirror.texture) ovr_DestroyMirrorTexture(session, mirror.texture); -} - -// Copy Oculus screen buffer to mirror texture -static void BlitOculusMirror(ovrSession session, OculusMirror mirror) -{ - GLuint mirrorTextureId; - - ovr_GetMirrorTextureBufferGL(session, mirror.texture, &mirrorTextureId); - - glBindFramebuffer(GL_READ_FRAMEBUFFER, mirror.fboId); - glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mirrorTextureId, 0); -#if defined(GRAPHICS_API_OPENGL_33) - // NOTE: glBlitFramebuffer() requires extension: GL_EXT_framebuffer_blit (not available in OpenGL ES 2.0) - glBlitFramebuffer(0, 0, mirror.width, mirror.height, 0, mirror.height, mirror.width, 0, GL_COLOR_BUFFER_BIT, GL_NEAREST); -#endif - glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); -} - -// Init Oculus layer (similar to photoshop) -static OculusLayer InitOculusLayer(ovrSession session) -{ - OculusLayer layer = { 0 }; - - layer.viewScaleDesc.HmdSpaceToWorldScaleInMeters = 1.0f; - - memset(&layer.eyeLayer, 0, sizeof(ovrLayerEyeFov)); - layer.eyeLayer.Header.Type = ovrLayerType_EyeFov; - layer.eyeLayer.Header.Flags = ovrLayerFlag_TextureOriginAtBottomLeft; - - ovrEyeRenderDesc eyeRenderDescs[2]; - - for (int eye = 0; eye < 2; eye++) - { - eyeRenderDescs[eye] = ovr_GetRenderDesc(session, eye, hmdDesc.DefaultEyeFov[eye]); - ovrMatrix4f ovrPerspectiveProjection = ovrMatrix4f_Projection(eyeRenderDescs[eye].Fov, 0.01f, 10000.0f, ovrProjection_None); //ovrProjection_ClipRangeOpenGL); - layer.eyeProjections[eye] = FromOvrMatrix(ovrPerspectiveProjection); // NOTE: struct ovrMatrix4f { float M[4][4] } --> struct Matrix - - layer.viewScaleDesc.HmdToEyeOffset[eye] = eyeRenderDescs[eye].HmdToEyeOffset; - layer.eyeLayer.Fov[eye] = eyeRenderDescs[eye].Fov; - - ovrSizei eyeSize = ovr_GetFovTextureSize(session, eye, layer.eyeLayer.Fov[eye], 1.0f); - layer.eyeLayer.Viewport[eye].Size = eyeSize; - layer.eyeLayer.Viewport[eye].Pos.x = layer.width; - layer.eyeLayer.Viewport[eye].Pos.y = 0; - - layer.height = eyeSize.h; //std::max(renderTargetSize.y, (uint32_t)eyeSize.h); - layer.width += eyeSize.w; - } - - return layer; -} - -// Convert from Oculus ovrMatrix4f struct to raymath Matrix struct -static Matrix FromOvrMatrix(ovrMatrix4f ovrmat) -{ - Matrix rmat; - - rmat.m0 = ovrmat.M[0][0]; - rmat.m1 = ovrmat.M[1][0]; - rmat.m2 = ovrmat.M[2][0]; - rmat.m3 = ovrmat.M[3][0]; - rmat.m4 = ovrmat.M[0][1]; - rmat.m5 = ovrmat.M[1][1]; - rmat.m6 = ovrmat.M[2][1]; - rmat.m7 = ovrmat.M[3][1]; - rmat.m8 = ovrmat.M[0][2]; - rmat.m9 = ovrmat.M[1][2]; - rmat.m10 = ovrmat.M[2][2]; - rmat.m11 = ovrmat.M[3][2]; - rmat.m12 = ovrmat.M[0][3]; - rmat.m13 = ovrmat.M[1][3]; - rmat.m14 = ovrmat.M[2][3]; - rmat.m15 = ovrmat.M[3][3]; - - MatrixTranspose(&rmat); - - return rmat; -} -#endif - #if defined(RLGL_STANDALONE) // Output a trace log message // NOTE: Expected msgType: (0)Info, (1)Error, (2)Warning diff --git a/src/rlgl.h b/src/rlgl.h index 41f671e6..344da987 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -399,19 +399,12 @@ void EndBlendMode(void); // End blend void TraceLog(int msgType, const char *text, ...); float *MatrixToFloat(Matrix mat); -void InitVrDevice(int vrDevice); // Init VR device -void CloseVrDevice(void); // Close VR device -bool IsVrDeviceReady(void); // Detect if VR device is ready -bool IsVrSimulator(void); // Detect if VR simulator is running +void InitVrSimulator(int vrDevice); // Init VR simulator for selected device +void CloseVrSimulator(void); // Close VR simulator for current device void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) - -// Oculus Rift API for direct access the device (no simulator) -bool InitOculusDevice(void); // Initialize Oculus device (returns true if success) -void CloseOculusDevice(void); // Close Oculus device -void UpdateOculusTracking(Camera *camera); // Update Oculus head position-orientation tracking (and camera) -void BeginOculusDrawing(void); // Setup Oculus buffers for drawing -void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror +void BeginVrDrawing(void); // Begin VR stereo rendering +void EndVrDrawing(void); // End VR stereo rendering #endif #ifdef __cplusplus -- cgit v1.2.3 From ca8c56561792a58d9b66fef668cf9d3a0fc4e876 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 19 Mar 2017 12:52:13 +0100 Subject: Review contact information --- HELPME.md | 2 +- README.md | 2 +- ROADMAP.md | 2 +- docs/examples/src/text_ttf_loading.c | 2 +- docs/helpme.html | 2 +- examples/text_ttf_loading.c | 2 +- games/drturtle/00_drturtle_screens.c | 2 +- games/drturtle/01_drturtle_scrolling.c | 2 +- games/drturtle/02_drturtle_player.c | 2 +- games/drturtle/03_drturtle_enemies.c | 2 +- games/drturtle/04_drturtle_gui.c | 2 +- games/drturtle/05_drturtle_audio.c | 2 +- games/drturtle/06_drturtle_final.c | 2 +- games/drturtle/drturtle_final_web.c | 2 +- games/drturtle/makefile | 2 +- games/just_do/just_do.c | 2 +- games/just_do/makefile | 2 +- games/just_do/screens/screen_level00.c | 2 +- games/just_do/screens/screen_level01.c | 2 +- games/just_do/screens/screen_level02.c | 2 +- games/just_do/screens/screen_level03.c | 2 +- games/just_do/screens/screen_level04.c | 2 +- games/just_do/screens/screen_level05.c | 2 +- games/just_do/screens/screen_level06.c | 2 +- games/just_do/screens/screen_level07.c | 2 +- games/just_do/screens/screen_level08.c | 2 +- games/just_do/screens/screen_level09.c | 2 +- games/just_do/screens/screen_level10.c | 2 +- games/just_do/screens/screen_logo.c | 2 +- games/just_do/screens/screens.h | 2 +- games/light_my_ritual/light_my_ritual.c | 2 +- games/light_my_ritual/makefile | 2 +- games/light_my_ritual/screens/screen_gameplay.c | 2 +- games/light_my_ritual/screens/screen_logo_raylib.c | 2 +- games/light_my_ritual/screens/screen_title.c | 2 +- games/light_my_ritual/screens/screens.h | 2 +- games/raylib_demo/makefile | 2 +- games/raylib_demo/raylib_demo.c | 2 +- games/skully_escape/makefile | 2 +- games/skully_escape/monster.c | 2 +- games/skully_escape/monster.h | 2 +- games/skully_escape/player.c | 2 +- games/skully_escape/screens/screen_aisle01.c | 2 +- games/skully_escape/screens/screen_aisle02.c | 2 +- games/skully_escape/screens/screen_armory.c | 2 +- games/skully_escape/screens/screen_attic.c | 2 +- games/skully_escape/screens/screen_bathroom.c | 2 +- games/skully_escape/screens/screen_ending.c | 2 +- games/skully_escape/screens/screen_kitchen.c | 2 +- games/skully_escape/screens/screen_livingroom.c | 2 +- games/skully_escape/screens/screen_logo.c | 2 +- games/skully_escape/screens/screen_logo_raylib.c | 2 +- games/skully_escape/screens/screen_title.c | 2 +- games/skully_escape/screens/screens.h | 2 +- games/skully_escape/skully_escape.c | 2 +- games/wave_collector/Makefile | 2 +- games/wave_collector/screens/screen_ending.c | 2 +- games/wave_collector/screens/screen_gameplay.c | 2 +- games/wave_collector/screens/screen_logo.c | 2 +- games/wave_collector/screens/screen_title.c | 2 +- games/wave_collector/screens/screens.h | 2 +- templates/advance_game/Makefile | 2 +- templates/advance_game/advance_game.c | 2 +- templates/advance_game/screens/screen_ending.c | 2 +- templates/advance_game/screens/screen_gameplay.c | 2 +- templates/advance_game/screens/screen_logo.c | 2 +- templates/advance_game/screens/screen_options.c | 2 +- templates/advance_game/screens/screen_title.c | 2 +- templates/advance_game/screens/screens.h | 2 +- templates/android_project/jni/basic_game.c | 2 +- templates/basic_game/Makefile | 2 +- templates/basic_test/Makefile | 2 +- templates/basic_test/basic_test.c | 2 +- templates/simple_game/Makefile | 2 +- templates/simple_game/screens.c | 2 +- templates/simple_game/screens.h | 2 +- templates/simple_game/simple_game.c | 2 +- templates/standard_game/Makefile | 2 +- templates/standard_game/screens/screen_ending.c | 2 +- templates/standard_game/screens/screen_gameplay.c | 2 +- templates/standard_game/screens/screen_logo.c | 2 +- templates/standard_game/screens/screen_options.c | 2 +- templates/standard_game/screens/screen_title.c | 2 +- templates/standard_game/screens/screens.h | 2 +- templates/standard_game/standard_game.c | 2 +- 85 files changed, 85 insertions(+), 85 deletions(-) diff --git a/HELPME.md b/HELPME.md index a58dca55..85f60c45 100644 --- a/HELPME.md +++ b/HELPME.md @@ -34,4 +34,4 @@ contact * Twitch: [http://www.twitch.tv/raysan5](http://www.twitch.tv/raysan5) * Patreon: [https://www.patreon.com/raysan5](https://www.patreon.com/raysan5) -[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San" +[raysan5]: mailto:ray@raylib.com "Ramon Santamaria - Ray San" diff --git a/README.md b/README.md index 85ad7943..b868172e 100644 --- a/README.md +++ b/README.md @@ -278,4 +278,4 @@ contributing (in some way or another) to make raylib project better. Huge thanks Please, if I forget someone in this list, excuse me and write me an email to remind me to add you! -[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San" +[raysan5]: mailto:ray@raylib.com "Ramon Santamaria - Ray San" diff --git a/ROADMAP.md b/ROADMAP.md index a7d51f0d..d0682f4a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -44,5 +44,5 @@ raylib 1.4 Any feature missing? Do you have a request? [Let me know!][raysan5] -[raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San" +[raysan5]: mailto:ray@raylib.com "Ramon Santamaria - Ray San" [isssues]: https://github.com/raysan5/raylib/issues diff --git a/docs/examples/src/text_ttf_loading.c b/docs/examples/src/text_ttf_loading.c index 918209dd..33cda7f5 100644 --- a/docs/examples/src/text_ttf_loading.c +++ b/docs/examples/src/text_ttf_loading.c @@ -5,7 +5,7 @@ * This example has been created using raylib 1.3.0 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2015 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2015 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/docs/helpme.html b/docs/helpme.html index c692077b..1948c623 100644 --- a/docs/helpme.html +++ b/docs/helpme.html @@ -53,7 +53,7 @@

I’m working hard on raylib but my resources are quite limited. - If you enjoy raylib and want to help / contribute, please, let me know.

+ If you enjoy raylib and want to help / contribute, please, let me know.


The following help is highly appreciated:


diff --git a/examples/text_ttf_loading.c b/examples/text_ttf_loading.c index 10025c2f..4aa0bef4 100644 --- a/examples/text_ttf_loading.c +++ b/examples/text_ttf_loading.c @@ -5,7 +5,7 @@ * This example has been created using raylib 1.3.0 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2015 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2015 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/drturtle/00_drturtle_screens.c b/games/drturtle/00_drturtle_screens.c index 16ae5c3c..fd9b3dad 100644 --- a/games/drturtle/00_drturtle_screens.c +++ b/games/drturtle/00_drturtle_screens.c @@ -15,7 +15,7 @@ * This game has been created using raylib 1.1 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/drturtle/01_drturtle_scrolling.c b/games/drturtle/01_drturtle_scrolling.c index e3215b20..b8a091de 100644 --- a/games/drturtle/01_drturtle_scrolling.c +++ b/games/drturtle/01_drturtle_scrolling.c @@ -15,7 +15,7 @@ * This game has been created using raylib 1.1 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/drturtle/02_drturtle_player.c b/games/drturtle/02_drturtle_player.c index 0d8defa2..bf49abe5 100644 --- a/games/drturtle/02_drturtle_player.c +++ b/games/drturtle/02_drturtle_player.c @@ -15,7 +15,7 @@ * This game has been created using raylib 1.1 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/drturtle/03_drturtle_enemies.c b/games/drturtle/03_drturtle_enemies.c index de67ee82..f659a19a 100644 --- a/games/drturtle/03_drturtle_enemies.c +++ b/games/drturtle/03_drturtle_enemies.c @@ -15,7 +15,7 @@ * This game has been created using raylib 1.1 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/drturtle/04_drturtle_gui.c b/games/drturtle/04_drturtle_gui.c index bbfd3492..081ba437 100644 --- a/games/drturtle/04_drturtle_gui.c +++ b/games/drturtle/04_drturtle_gui.c @@ -15,7 +15,7 @@ * This game has been created using raylib 1.1 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/drturtle/05_drturtle_audio.c b/games/drturtle/05_drturtle_audio.c index b94de106..f3660633 100644 --- a/games/drturtle/05_drturtle_audio.c +++ b/games/drturtle/05_drturtle_audio.c @@ -15,7 +15,7 @@ * This game has been created using raylib 1.6 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/drturtle/06_drturtle_final.c b/games/drturtle/06_drturtle_final.c index 48708094..b75cce81 100644 --- a/games/drturtle/06_drturtle_final.c +++ b/games/drturtle/06_drturtle_final.c @@ -15,7 +15,7 @@ * This game has been created using raylib 1.6 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/drturtle/drturtle_final_web.c b/games/drturtle/drturtle_final_web.c index bec7ebd0..21e8067a 100644 --- a/games/drturtle/drturtle_final_web.c +++ b/games/drturtle/drturtle_final_web.c @@ -15,7 +15,7 @@ * This game has been created using raylib 1.6 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/drturtle/makefile b/games/drturtle/makefile index 0a45e18a..52f95c77 100644 --- a/games/drturtle/makefile +++ b/games/drturtle/makefile @@ -2,7 +2,7 @@ # # raylib - makefile to compile Dr.Turtle game # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/games/just_do/just_do.c b/games/just_do/just_do.c index 811150d3..2ec178a4 100644 --- a/games/just_do/just_do.c +++ b/games/just_do/just_do.c @@ -9,7 +9,7 @@ * This game has been created using raylib 1.6 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* raylib - Copyright (c) 2015 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* raylib - Copyright (c) 2015 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/just_do/makefile b/games/just_do/makefile index 1a971081..a3b5da2d 100644 --- a/games/just_do/makefile +++ b/games/just_do/makefile @@ -4,7 +4,7 @@ # # makefile to compile advance game for desktop platforms, Raspberry Pi and HTML5 (emscripten) # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level00.c b/games/just_do/screens/screen_level00.c index 99f29849..e72e3812 100644 --- a/games/just_do/screens/screen_level00.c +++ b/games/just_do/screens/screen_level00.c @@ -4,7 +4,7 @@ * * Level00 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level01.c b/games/just_do/screens/screen_level01.c index cedcb2e0..8cb76bf1 100644 --- a/games/just_do/screens/screen_level01.c +++ b/games/just_do/screens/screen_level01.c @@ -4,7 +4,7 @@ * * Level01 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level02.c b/games/just_do/screens/screen_level02.c index ccfa355e..a2d5e562 100644 --- a/games/just_do/screens/screen_level02.c +++ b/games/just_do/screens/screen_level02.c @@ -4,7 +4,7 @@ * * Level02 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level03.c b/games/just_do/screens/screen_level03.c index e8732414..7c3aa286 100644 --- a/games/just_do/screens/screen_level03.c +++ b/games/just_do/screens/screen_level03.c @@ -4,7 +4,7 @@ * * Level03 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level04.c b/games/just_do/screens/screen_level04.c index c4e4e2c0..7a8a21f1 100644 --- a/games/just_do/screens/screen_level04.c +++ b/games/just_do/screens/screen_level04.c @@ -4,7 +4,7 @@ * * Level04 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level05.c b/games/just_do/screens/screen_level05.c index f2e4d852..5d5d23d6 100644 --- a/games/just_do/screens/screen_level05.c +++ b/games/just_do/screens/screen_level05.c @@ -4,7 +4,7 @@ * * Level05 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level06.c b/games/just_do/screens/screen_level06.c index b5881db4..a5536aa4 100644 --- a/games/just_do/screens/screen_level06.c +++ b/games/just_do/screens/screen_level06.c @@ -4,7 +4,7 @@ * * Level06 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level07.c b/games/just_do/screens/screen_level07.c index d305b025..2ed4f944 100644 --- a/games/just_do/screens/screen_level07.c +++ b/games/just_do/screens/screen_level07.c @@ -4,7 +4,7 @@ * * Level07 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level08.c b/games/just_do/screens/screen_level08.c index 4cb0443b..1caced49 100644 --- a/games/just_do/screens/screen_level08.c +++ b/games/just_do/screens/screen_level08.c @@ -4,7 +4,7 @@ * * Level08 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level09.c b/games/just_do/screens/screen_level09.c index d20f4bfb..91b0a6f7 100644 --- a/games/just_do/screens/screen_level09.c +++ b/games/just_do/screens/screen_level09.c @@ -4,7 +4,7 @@ * * Level09 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_level10.c b/games/just_do/screens/screen_level10.c index 33806006..f42b1e66 100644 --- a/games/just_do/screens/screen_level10.c +++ b/games/just_do/screens/screen_level10.c @@ -4,7 +4,7 @@ * * Level10 Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screen_logo.c b/games/just_do/screens/screen_logo.c index 9639602d..ab078289 100644 --- a/games/just_do/screens/screen_logo.c +++ b/games/just_do/screens/screen_logo.c @@ -4,7 +4,7 @@ * * Logo Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/just_do/screens/screens.h b/games/just_do/screens/screens.h index 7fa59405..13bd8d72 100644 --- a/games/just_do/screens/screens.h +++ b/games/just_do/screens/screens.h @@ -4,7 +4,7 @@ * * Screens Functions Declarations (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/light_my_ritual/light_my_ritual.c b/games/light_my_ritual/light_my_ritual.c index 000eca36..152bdeb6 100644 --- a/games/light_my_ritual/light_my_ritual.c +++ b/games/light_my_ritual/light_my_ritual.c @@ -10,7 +10,7 @@ * This game has been created using raylib (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2015 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2015 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/light_my_ritual/makefile b/games/light_my_ritual/makefile index 84d7e994..b86809c3 100644 --- a/games/light_my_ritual/makefile +++ b/games/light_my_ritual/makefile @@ -4,7 +4,7 @@ # # makefile to compile advance game for desktop platforms, Raspberry Pi and HTML5 (emscripten) # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/games/light_my_ritual/screens/screen_gameplay.c b/games/light_my_ritual/screens/screen_gameplay.c index c1779f73..ae929013 100644 --- a/games/light_my_ritual/screens/screen_gameplay.c +++ b/games/light_my_ritual/screens/screen_gameplay.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/light_my_ritual/screens/screen_logo_raylib.c b/games/light_my_ritual/screens/screen_logo_raylib.c index f21055d7..87a2282e 100644 --- a/games/light_my_ritual/screens/screen_logo_raylib.c +++ b/games/light_my_ritual/screens/screen_logo_raylib.c @@ -4,7 +4,7 @@ * * Logo Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/light_my_ritual/screens/screen_title.c b/games/light_my_ritual/screens/screen_title.c index c1ecaf12..8f40c8c5 100644 --- a/games/light_my_ritual/screens/screen_title.c +++ b/games/light_my_ritual/screens/screen_title.c @@ -4,7 +4,7 @@ * * Title Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/light_my_ritual/screens/screens.h b/games/light_my_ritual/screens/screens.h index 8fee5274..ff12a01c 100644 --- a/games/light_my_ritual/screens/screens.h +++ b/games/light_my_ritual/screens/screens.h @@ -4,7 +4,7 @@ * * Screens Functions Declarations (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/raylib_demo/makefile b/games/raylib_demo/makefile index 0c22261c..7a5737ac 100644 --- a/games/raylib_demo/makefile +++ b/games/raylib_demo/makefile @@ -4,7 +4,7 @@ # # makefile to compile advance game for desktop platforms, Raspberry Pi and HTML5 (emscripten) # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/games/raylib_demo/raylib_demo.c b/games/raylib_demo/raylib_demo.c index 722d8ce6..b1267c26 100644 --- a/games/raylib_demo/raylib_demo.c +++ b/games/raylib_demo/raylib_demo.c @@ -5,7 +5,7 @@ * This show has been created using raylib v1.4 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/skully_escape/makefile b/games/skully_escape/makefile index 967c3da7..ee2e08c0 100644 --- a/games/skully_escape/makefile +++ b/games/skully_escape/makefile @@ -4,7 +4,7 @@ # # makefile to compile advance game # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/games/skully_escape/monster.c b/games/skully_escape/monster.c index 643d0a73..469cd9ca 100644 --- a/games/skully_escape/monster.c +++ b/games/skully_escape/monster.c @@ -8,7 +8,7 @@ * This game has been created using raylib (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ************************************************************************************/ diff --git a/games/skully_escape/monster.h b/games/skully_escape/monster.h index e7e01856..2ef4eb6a 100644 --- a/games/skully_escape/monster.h +++ b/games/skully_escape/monster.h @@ -4,7 +4,7 @@ * * Screens Functions Declarations (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/player.c b/games/skully_escape/player.c index 11006f65..857ff538 100644 --- a/games/skully_escape/player.c +++ b/games/skully_escape/player.c @@ -8,7 +8,7 @@ * This game has been created using raylib (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ************************************************************************************/ diff --git a/games/skully_escape/screens/screen_aisle01.c b/games/skully_escape/screens/screen_aisle01.c index 17d25058..3ddf7da5 100644 --- a/games/skully_escape/screens/screen_aisle01.c +++ b/games/skully_escape/screens/screen_aisle01.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screen_aisle02.c b/games/skully_escape/screens/screen_aisle02.c index 6186a1fc..43bb226b 100644 --- a/games/skully_escape/screens/screen_aisle02.c +++ b/games/skully_escape/screens/screen_aisle02.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screen_armory.c b/games/skully_escape/screens/screen_armory.c index 622299f0..54c40059 100644 --- a/games/skully_escape/screens/screen_armory.c +++ b/games/skully_escape/screens/screen_armory.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screen_attic.c b/games/skully_escape/screens/screen_attic.c index a8bc0a6b..f19b8856 100644 --- a/games/skully_escape/screens/screen_attic.c +++ b/games/skully_escape/screens/screen_attic.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screen_bathroom.c b/games/skully_escape/screens/screen_bathroom.c index 176967a7..170898bf 100644 --- a/games/skully_escape/screens/screen_bathroom.c +++ b/games/skully_escape/screens/screen_bathroom.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screen_ending.c b/games/skully_escape/screens/screen_ending.c index 120d9071..4f2cc1bb 100644 --- a/games/skully_escape/screens/screen_ending.c +++ b/games/skully_escape/screens/screen_ending.c @@ -4,7 +4,7 @@ * * Ending Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screen_kitchen.c b/games/skully_escape/screens/screen_kitchen.c index a6b8924d..36f56443 100644 --- a/games/skully_escape/screens/screen_kitchen.c +++ b/games/skully_escape/screens/screen_kitchen.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screen_livingroom.c b/games/skully_escape/screens/screen_livingroom.c index b2b09d9a..d66ec819 100644 --- a/games/skully_escape/screens/screen_livingroom.c +++ b/games/skully_escape/screens/screen_livingroom.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screen_logo.c b/games/skully_escape/screens/screen_logo.c index f07f5f54..3e5e311d 100644 --- a/games/skully_escape/screens/screen_logo.c +++ b/games/skully_escape/screens/screen_logo.c @@ -4,7 +4,7 @@ * * Logo Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screen_logo_raylib.c b/games/skully_escape/screens/screen_logo_raylib.c index e5efe843..1eb6cca4 100644 --- a/games/skully_escape/screens/screen_logo_raylib.c +++ b/games/skully_escape/screens/screen_logo_raylib.c @@ -4,7 +4,7 @@ * * Logo Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screen_title.c b/games/skully_escape/screens/screen_title.c index 837b5112..ad231dcd 100644 --- a/games/skully_escape/screens/screen_title.c +++ b/games/skully_escape/screens/screen_title.c @@ -4,7 +4,7 @@ * * Title Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/screens/screens.h b/games/skully_escape/screens/screens.h index 790df9ff..ce35ae70 100644 --- a/games/skully_escape/screens/screens.h +++ b/games/skully_escape/screens/screens.h @@ -4,7 +4,7 @@ * * Screens Functions Declarations (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/skully_escape/skully_escape.c b/games/skully_escape/skully_escape.c index 83f9732b..fb872955 100644 --- a/games/skully_escape/skully_escape.c +++ b/games/skully_escape/skully_escape.c @@ -5,7 +5,7 @@ * This game has been created using raylib 1.6 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/games/wave_collector/Makefile b/games/wave_collector/Makefile index bac51ef1..5b4ee0bf 100644 --- a/games/wave_collector/Makefile +++ b/games/wave_collector/Makefile @@ -4,7 +4,7 @@ # # makefile to compile advance game for desktop platforms, Raspberry Pi and HTML5 (emscripten) # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/games/wave_collector/screens/screen_ending.c b/games/wave_collector/screens/screen_ending.c index 3e323ad2..7dc21965 100644 --- a/games/wave_collector/screens/screen_ending.c +++ b/games/wave_collector/screens/screen_ending.c @@ -4,7 +4,7 @@ * * Ending Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/wave_collector/screens/screen_gameplay.c b/games/wave_collector/screens/screen_gameplay.c index 32e89402..4019e64c 100644 --- a/games/wave_collector/screens/screen_gameplay.c +++ b/games/wave_collector/screens/screen_gameplay.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/wave_collector/screens/screen_logo.c b/games/wave_collector/screens/screen_logo.c index e855752e..5f18a321 100644 --- a/games/wave_collector/screens/screen_logo.c +++ b/games/wave_collector/screens/screen_logo.c @@ -4,7 +4,7 @@ * * Logo Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/wave_collector/screens/screen_title.c b/games/wave_collector/screens/screen_title.c index 59249db3..5c414f4f 100644 --- a/games/wave_collector/screens/screen_title.c +++ b/games/wave_collector/screens/screen_title.c @@ -4,7 +4,7 @@ * * Title Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/games/wave_collector/screens/screens.h b/games/wave_collector/screens/screens.h index 9c9c5175..1bbcf0fe 100644 --- a/games/wave_collector/screens/screens.h +++ b/games/wave_collector/screens/screens.h @@ -4,7 +4,7 @@ * * Screens Functions Declarations (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/advance_game/Makefile b/templates/advance_game/Makefile index b3947205..0be29360 100644 --- a/templates/advance_game/Makefile +++ b/templates/advance_game/Makefile @@ -4,7 +4,7 @@ # # makefile to compile advance game for desktop platforms, Raspberry Pi and HTML5 (emscripten) # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/templates/advance_game/advance_game.c b/templates/advance_game/advance_game.c index 891bbaf1..5e837f87 100644 --- a/templates/advance_game/advance_game.c +++ b/templates/advance_game/advance_game.c @@ -8,7 +8,7 @@ * This game has been created using raylib (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/templates/advance_game/screens/screen_ending.c b/templates/advance_game/screens/screen_ending.c index 3d9f81a1..c776be3e 100644 --- a/templates/advance_game/screens/screen_ending.c +++ b/templates/advance_game/screens/screen_ending.c @@ -4,7 +4,7 @@ * * Ending Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/advance_game/screens/screen_gameplay.c b/templates/advance_game/screens/screen_gameplay.c index 307f2ea3..f70ddb09 100644 --- a/templates/advance_game/screens/screen_gameplay.c +++ b/templates/advance_game/screens/screen_gameplay.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/advance_game/screens/screen_logo.c b/templates/advance_game/screens/screen_logo.c index 1cd42830..cb60e516 100644 --- a/templates/advance_game/screens/screen_logo.c +++ b/templates/advance_game/screens/screen_logo.c @@ -4,7 +4,7 @@ * * Logo Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/advance_game/screens/screen_options.c b/templates/advance_game/screens/screen_options.c index 87d32264..1f69a3b9 100644 --- a/templates/advance_game/screens/screen_options.c +++ b/templates/advance_game/screens/screen_options.c @@ -4,7 +4,7 @@ * * Options Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/advance_game/screens/screen_title.c b/templates/advance_game/screens/screen_title.c index 9c288fb5..8f2cf4af 100644 --- a/templates/advance_game/screens/screen_title.c +++ b/templates/advance_game/screens/screen_title.c @@ -4,7 +4,7 @@ * * Title Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/advance_game/screens/screens.h b/templates/advance_game/screens/screens.h index 88537d9b..43c335a6 100644 --- a/templates/advance_game/screens/screens.h +++ b/templates/advance_game/screens/screens.h @@ -4,7 +4,7 @@ * * Screens Functions Declarations (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/android_project/jni/basic_game.c b/templates/android_project/jni/basic_game.c index c801cbaa..1109f9e8 100644 --- a/templates/android_project/jni/basic_game.c +++ b/templates/android_project/jni/basic_game.c @@ -8,7 +8,7 @@ * This game has been created using raylib v1.2 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/templates/basic_game/Makefile b/templates/basic_game/Makefile index 76337490..b9704b4b 100644 --- a/templates/basic_game/Makefile +++ b/templates/basic_game/Makefile @@ -4,7 +4,7 @@ # # makefile to compile basic game for desktop platforms, Raspberry Pi and HTML5 (emscripten) # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/templates/basic_test/Makefile b/templates/basic_test/Makefile index b6fd44a7..7986f375 100644 --- a/templates/basic_test/Makefile +++ b/templates/basic_test/Makefile @@ -4,7 +4,7 @@ # # makefile to compile basic test for desktop platforms, Raspberry Pi and HTML5 (emscripten) # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/templates/basic_test/basic_test.c b/templates/basic_test/basic_test.c index d4359df5..7e732149 100644 --- a/templates/basic_test/basic_test.c +++ b/templates/basic_test/basic_test.c @@ -7,7 +7,7 @@ * This example has been created using raylib v1.2 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/templates/simple_game/Makefile b/templates/simple_game/Makefile index 3d303082..bea25125 100644 --- a/templates/simple_game/Makefile +++ b/templates/simple_game/Makefile @@ -4,7 +4,7 @@ # # makefile to compile simple game for desktop platforms, Raspberry Pi and HTML5 (emscripten) # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/templates/simple_game/screens.c b/templates/simple_game/screens.c index 742cf6f8..af5a9dfb 100644 --- a/templates/simple_game/screens.c +++ b/templates/simple_game/screens.c @@ -4,7 +4,7 @@ * * Screens Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/simple_game/screens.h b/templates/simple_game/screens.h index 7afaebeb..5aa53617 100644 --- a/templates/simple_game/screens.h +++ b/templates/simple_game/screens.h @@ -4,7 +4,7 @@ * * Screens Functions Declarations (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/simple_game/simple_game.c b/templates/simple_game/simple_game.c index b4d75719..d8de3c28 100644 --- a/templates/simple_game/simple_game.c +++ b/templates/simple_game/simple_game.c @@ -8,7 +8,7 @@ * This game has been created using raylib (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* raylib - Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* raylib - Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/templates/standard_game/Makefile b/templates/standard_game/Makefile index c7cb7add..1abdbabc 100644 --- a/templates/standard_game/Makefile +++ b/templates/standard_game/Makefile @@ -4,7 +4,7 @@ # # makefile to compile standard game for desktop platforms, Raspberry Pi and HTML5 (emscripten) # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014 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. diff --git a/templates/standard_game/screens/screen_ending.c b/templates/standard_game/screens/screen_ending.c index e01cd6ad..de16fc8f 100644 --- a/templates/standard_game/screens/screen_ending.c +++ b/templates/standard_game/screens/screen_ending.c @@ -4,7 +4,7 @@ * * Ending Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/standard_game/screens/screen_gameplay.c b/templates/standard_game/screens/screen_gameplay.c index 13752d01..e6e45156 100644 --- a/templates/standard_game/screens/screen_gameplay.c +++ b/templates/standard_game/screens/screen_gameplay.c @@ -4,7 +4,7 @@ * * Gameplay Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/standard_game/screens/screen_logo.c b/templates/standard_game/screens/screen_logo.c index 41cb5678..2cfa0ca4 100644 --- a/templates/standard_game/screens/screen_logo.c +++ b/templates/standard_game/screens/screen_logo.c @@ -4,7 +4,7 @@ * * Logo Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/standard_game/screens/screen_options.c b/templates/standard_game/screens/screen_options.c index bb490672..9ac852d9 100644 --- a/templates/standard_game/screens/screen_options.c +++ b/templates/standard_game/screens/screen_options.c @@ -4,7 +4,7 @@ * * Options Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/standard_game/screens/screen_title.c b/templates/standard_game/screens/screen_title.c index 0082fa12..c9700e8b 100644 --- a/templates/standard_game/screens/screen_title.c +++ b/templates/standard_game/screens/screen_title.c @@ -4,7 +4,7 @@ * * Title Screen Functions Definitions (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/standard_game/screens/screens.h b/templates/standard_game/screens/screens.h index eb4aa8b7..9d558508 100644 --- a/templates/standard_game/screens/screens.h +++ b/templates/standard_game/screens/screens.h @@ -4,7 +4,7 @@ * * Screens Functions Declarations (Init, Update, Draw, Unload) * -* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 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. diff --git a/templates/standard_game/standard_game.c b/templates/standard_game/standard_game.c index e4dafc70..36ca30f9 100644 --- a/templates/standard_game/standard_game.c +++ b/templates/standard_game/standard_game.c @@ -8,7 +8,7 @@ * This game has been created using raylib (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* raylib - Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* raylib - Copyright (c) 2014 Ramon Santamaria (@raysan5) * ********************************************************************************************/ -- cgit v1.2.3 From 8f5ff64420dda659583c156b9c5e42e60384e247 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 19 Mar 2017 12:52:58 +0100 Subject: Working on file header comments... --- src/audio.c | 41 ++++++++++++++++++++------------------ src/audio.h | 28 +++++++++++++++----------- src/core.c | 11 ++++++++-- src/easings.h | 2 +- src/models.c | 4 +++- src/raylib.h | 64 ++++++++++++++++++++++++++++++----------------------------- src/utils.c | 19 ++++++++++++++---- src/utils.h | 6 ++++++ 8 files changed, 105 insertions(+), 70 deletions(-) diff --git a/src/audio.c b/src/audio.c index 659ead0f..e0964e02 100644 --- a/src/audio.c +++ b/src/audio.c @@ -1,26 +1,24 @@ /********************************************************************************************** * -* raylib.audio +* raylib.audio - Basic funtionality to work with audio * -* This module provides basic functionality to work with audio: -* Manage audio device (init/close) -* Load and Unload audio files (WAV, OGG, FLAC, XM, MOD) -* Play/Stop/Pause/Resume loaded audio -* Manage mixing channels -* Manage raw audio context +* DESCRIPTION: * -* NOTES: -* -* Only up to two channels supported: MONO and STEREO (for additional channels, use AL_EXT_MCFORMATS) -* Only the following sample sizes supported: 8bit PCM, 16bit PCM, 32-bit float PCM (using AL_EXT_FLOAT32) +* This module provides basic functionality to: +* - Manage audio device (init/close) +* - Load and unload audio files +* - Format wave data (sample rate, size, channels) +* - Play/Stop/Pause/Resume loaded audio +* - Manage mixing channels +* - Manage raw audio context * * CONFIGURATION: * * #define AUDIO_STANDALONE -* If defined, the module can be used as standalone library (independently of raylib). +* Define to use the module as standalone library (independently of raylib). * Required types and functions are defined in the same module. * -* #define SUPPORT_FILEFORMAT_WAV / SUPPORT_LOAD_WAV / ENABLE_LOAD_WAV +* #define SUPPORT_FILEFORMAT_WAV / SUPPORT_LOAD_WAV * #define SUPPORT_FILEFORMAT_OGG * #define SUPPORT_FILEFORMAT_XM * #define SUPPORT_FILEFORMAT_MOD @@ -29,6 +27,12 @@ * supported by default, to remove support, just comment unrequired #define in this module * * #define SUPPORT_RAW_AUDIO_BUFFERS +* Support creating raw audio buffers to send raw data. Buffers must be managed by the user, +* it means initialization, refilling and cleaning. +* +* LIMITATIONS: +* Only up to two channels supported: MONO and STEREO (for additional channels, use AL_EXT_MCFORMATS) +* Only the following sample sizes supported: 8bit PCM, 16bit PCM, 32-bit float PCM (using AL_EXT_FLOAT32) * * DEPENDENCIES: * OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html) @@ -38,12 +42,11 @@ * dr_flac - FLAC audio file loading * * CONTRIBUTORS: -* -* Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: -* XM audio module support (jar_xm) -* MOD audio module support (jar_mod) -* Mixing channels support -* Raw audio context support +* Joshua Reisenauer (github: @kd7tck): +* - XM audio module support (jar_xm) +* - MOD audio module support (jar_mod) +* - Mixing channels support +* - Raw audio context support * * * LICENSE: zlib/libpng diff --git a/src/audio.h b/src/audio.h index 01ed9f72..a0279e3a 100644 --- a/src/audio.h +++ b/src/audio.h @@ -1,13 +1,16 @@ /********************************************************************************************** * -* raylib.audio +* raylib.audio - Basic funtionality to work with audio * -* This module provides basic functionality to work with audio: -* Manage audio device (init/close) -* Load and Unload audio files (WAV, OGG, FLAC, XM, MOD) -* Play/Stop/Pause/Resume loaded audio -* Manage mixing channels -* Manage raw audio context +* DESCRIPTION: +* +* This module provides basic functionality to: +* - Manage audio device (init/close) +* - Load and unload audio files +* - Format wave data (sample rate, size, channels) +* - Play/Stop/Pause/Resume loaded audio +* - Manage mixing channels +* - Manage raw audio context * * DEPENDENCIES: * OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html) @@ -16,11 +19,12 @@ * jar_mod - MOD audio file loading * dr_flac - FLAC audio file loading * -* Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: -* XM audio module support (jar_xm) -* MOD audio module support (jar_mod) -* Mixing channels support -* Raw audio context support +* CONTRIBUTORS: +* Joshua Reisenauer (github: @kd7tck): +* - XM audio module support (jar_xm) +* - MOD audio module support (jar_mod) +* - Mixing channels support +* - Raw audio context support * * * LICENSE: zlib/libpng diff --git a/src/core.c b/src/core.c index 38549354..f55a70db 100644 --- a/src/core.c +++ b/src/core.c @@ -2,7 +2,14 @@ * * raylib.core - Basic functions to manage windows, OpenGL context and input on multiple platforms * -* The following platforms are supported: Windows, Linux, Mac (OSX), Android, Raspberry Pi, HTML5, Oculus Rift CV1 +* The following platforms are supported: +* Windows (win32/Win64) +* Linux (tested on Ubuntu) +* Mac (OSX) +* Android (API Level 9 or greater) +* Raspberry Pi (Raspbian) +* HTML5 (Chrome, Firefox) +* Oculus Rift CV1 * * CONFIGURATION: * @@ -2006,7 +2013,7 @@ static double GetTime(void) // Wait for some milliseconds (stop program execution) static void Wait(float ms) { -#define SUPPORT_BUSY_WAIT_LOOP +//#define SUPPORT_BUSY_WAIT_LOOP #if defined(SUPPORT_BUSY_WAIT_LOOP) double prevTime = GetTime(); double nextTime = 0.0; diff --git a/src/easings.h b/src/easings.h index 527970ab..9ad27313 100644 --- a/src/easings.h +++ b/src/easings.h @@ -122,7 +122,7 @@ EASEDEF float EaseCubicOut(float t, float b, float c, float d) { return (c*((t=t EASEDEF float EaseCubicInOut(float t, float b, float c, float d) { if ((t/=d/2) < 1) return (c/2*t*t*t + b); - return (c/2*((t-=2)*t*t + 2) + b); + return (c/2*((t-=2)*t*t + 2) + b); } // Quadratic Easing functions diff --git a/src/models.c b/src/models.c index bef19e10..8297358b 100644 --- a/src/models.c +++ b/src/models.c @@ -1,12 +1,14 @@ /********************************************************************************************** * -* raylib.models - Basic functions to draw 3d shapes and 3d models +* raylib.models - Basic functions to deal with 3d shapes and 3d models * * CONFIGURATION: * * #define SUPPORT_FILEFORMAT_OBJ / SUPPORT_LOAD_OBJ +* Selected desired fileformats to be supported for loading. * * #define SUPPORT_FILEFORMAT_MTL +* Selected desired fileformats to be supported for loading. * * * LICENSE: zlib/libpng diff --git a/src/raylib.h b/src/raylib.h index e679e011..4fd4b5df 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1,43 +1,45 @@ /********************************************************************************************** * -* raylib v1.7.0 (www.raylib.com) +* raylib v1.7.0 * -* A simple and easy-to-use library to learn videogames programming +* A simple and easy-to-use library to learn videogames programming (www.raylib.com) * * FEATURES: -* Library written in plain C code (C99) -* Uses PascalCase/camelCase notation -* Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) -* Unique OpenGL abstraction layer (usable as standalone module): [rlgl] -* Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) -* Multiple textures support, including compressed formats and mipmaps generation -* Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps -* Powerful math module for Vector, Matrix and Quaternion operations: [raymath] -* Audio loading and playing with streaming support and mixing channels [audio] -* VR stereo rendering support with configurable HMD device parameters -* Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 -* Custom color palette for fancy visuals on raywhite background -* Minimal external dependencies (GLFW3, OpenGL, OpenAL) -* Complete binding for Lua [rlua] +* - Library written in plain C code (C99) +* - Uses PascalCase/camelCase notation +* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) +* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] +* - Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) +* - Multiple textures support, including compressed formats and mipmaps generation +* - Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps +* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] +* - Audio loading and playing with streaming support and mixing channels [audio] +* - VR stereo rendering support with configurable HMD device parameters +* - Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 +* - Custom color palette for fancy visuals on raywhite background +* - Minimal external dependencies (GLFW3, OpenGL, OpenAL) +* - Complete bindings for Lua, Go and Pascal * * NOTES: -* 32bit Colors - All defined color are always RGBA (struct Color is 4 byte) -* One custom default font could be loaded automatically when InitWindow() [core] -* If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads -* If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) +* 32bit Colors - All defined color are always RGBA (struct Color is 4 byte) +* One custom default font could be loaded automatically when InitWindow() [core] +* If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads +* If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) * * DEPENDENCIES: -* GLFW3 (www.glfw.org) for window/context management and input [core] -* GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] -* stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] -* stb_image_write (Sean Barret) for image writting (PNG) [utils] -* stb_truetype (Sean Barret) for ttf fonts loading [text] -* stb_vorbis (Sean Barret) for ogg audio loading [audio] -* jar_xm (Joshua Reisenauer) for XM audio module loading [audio] -* jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] -* dr_flac (David Reid) for FLAC audio file loading [audio] -* OpenAL Soft for audio device/context management [audio] -* tinfl for data decompression (DEFLATE algorithm) [utils] +* GLFW3 (www.glfw.org) for window/context management and input [core] +* GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] +* OpenAL Soft for audio device/context management [audio] +* +* OPTIONAL DEPENDENCIES: +* stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] +* stb_image_write (Sean Barret) for image writting (PNG) [utils] +* stb_truetype (Sean Barret) for ttf fonts loading [text] +* stb_vorbis (Sean Barret) for ogg audio loading [audio] +* jar_xm (Joshua Reisenauer) for XM audio module loading [audio] +* jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] +* dr_flac (David Reid) for FLAC audio file loading [audio] +* tinfl for data decompression (DEFLATE algorithm) [rres] * * * LICENSE: zlib/libpng diff --git a/src/utils.c b/src/utils.c index 9a2a723a..54923e34 100644 --- a/src/utils.c +++ b/src/utils.c @@ -4,14 +4,20 @@ * * CONFIGURATION: * -* #define SUPPORT_SAVE_PNG -* Enable saving PNG fileformat +* #define SUPPORT_SAVE_PNG (defined by default) +* Support saving image data as PNG fileformat * NOTE: Requires stb_image_write library * * #define SUPPORT_SAVE_BMP +* Support saving image data as BMP fileformat +* NOTE: Requires stb_image_write library +* +* #define SUPPORT_TRACELOG +* Show TraceLog() output messages +* NOTE: By default DEBUG traces not shown * -* #define DO_NOT_TRACE_DEBUG_MSGS -* Avoid showing DEBUG TraceLog() messages +* #define SUPPORT_TRACELOG_DEBUG +* Show TraceLog() DEBUG messages * * DEPENDENCIES: * stb_image_write - PNG writting functions @@ -129,18 +135,23 @@ void TraceLog(int msgType, const char *text, ...) } #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) + +#if defined(SUPPORT_SAVE_BMP) // Creates a BMP image file from an array of pixel data void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize) { stbi_write_bmp(fileName, width, height, compSize, imgData); } +#endif +#if defined(SUPPORT_SAVE_PNG) // Creates a PNG image file from an array of pixel data void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize) { stbi_write_png(fileName, width, height, compSize, imgData, width*compSize); } #endif +#endif #if defined(PLATFORM_ANDROID) // Initialize asset manager from android app diff --git a/src/utils.h b/src/utils.h index 3ffd025c..037d7e94 100644 --- a/src/utils.h +++ b/src/utils.h @@ -33,6 +33,8 @@ #include "rres.h" +#define SUPPORT_SAVE_PNG + //---------------------------------------------------------------------------------- // Some basic Defines //---------------------------------------------------------------------------------- @@ -61,9 +63,13 @@ void TraceLog(int msgType, const char *text, ...); // Outputs a trace log messa const char *GetExtension(const char *fileName); // Returns extension of a filename #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) +#if defined(SUPPORT_SAVE_BMP) void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize); +#endif +#if defined(SUPPORT_SAVE_PNG) void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize); #endif +#endif #if defined(PLATFORM_ANDROID) void InitAssetManager(AAssetManager *manager); // Initialize asset manager from android app -- cgit v1.2.3 From 46c2f2058f8b8d2c5f918be6e4f716eb4266b9a8 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 19 Mar 2017 18:18:55 +0100 Subject: Added new patrons --- docs/index.html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/index.html b/docs/index.html index d177dca2..847e4346 100644 --- a/docs/index.html +++ b/docs/index.html @@ -108,7 +108,7 @@ - Multiplatform support: Android, Raspberry Pi, HTML5, Oculus Rift CV1
- Custom color palette for fancy visuals on raywhite background
- Minimal external dependencies (GLFW3, OpenGL, OpenAL)
- - Complete binding to Lua: [rlua]
+ - Complete binding to Lua, Go and Pascal.

raylib architechture @@ -120,16 +120,21 @@ raylib supporters on patreon

The following people is supporting raylib project on patreon. Many thanks to all of them for believing in the project and contributing to it.


+

- Jarrod - 2drealms (@2drealms)

+

- Kovay Hatfield

- Pau Fernandez (@pauek)

-

- Marcelo Paez (@paezao)

+

- Chris Johnson

+

- Joel Davis (@joeld42)

+

- Charles Nicosia

- Rajasekaran Senthil (@rskgames)

- Adrian Guerrero

- Dani Gómez

-

- Marc Agüera

-

- Sergio Martínez

-

- Evan

+

- Justin Hamilton

+

- Antonio Radovcic

+

- James W. Bohnke

+

- Evan Sirchuk


-

And a very special thanks to Ilya Zarembsky for his generous contribution. Many thanks Ilya! Hope your students enjoy raylib! :D

+

And a very special thanks to Ilya Zarembsky (@wly_cdgr) for his generous contribution. Many thanks Ilya! Hope your students are enjoying raylib! :D