Skip to content

Commit

Permalink
Merge pull request #198 from raysan5/develop
Browse files Browse the repository at this point in the history
Develop branch integration
  • Loading branch information
raysan5 authored Nov 24, 2016
2 parents 05f68c2 + a81dfab commit 17f09cb
Show file tree
Hide file tree
Showing 87 changed files with 6,812 additions and 4,082 deletions.
21 changes: 13 additions & 8 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,44 @@ NOTE:
It includes some interesting new features and is a stepping stone towards raylib future.

HUGE changes:
[rlua] LUA BINDING: Complete raylib LUA binding, all raylib functions ported to LUA plus the +60 code examples.
[audio] COMPLETE REDESIGN: Improved music support and also raw audio data processing and playing. FLAC support added.
[rlua] LUA BINDING: Complete raylib LUA binding, ALL raylib functions ported to LUA plus the +60 code examples.
[audio] COMPLETE REDESIGN: Improved music support and also raw audio data processing and playing, +20 new functions added.
[physac] COMPLETE REWRITE: Improved performance, functionality and simplified usage, moved to own repository and added multiple examples!

other changes:
Other changes:

[core] Corrected issue on OSX with HighDPI display
[core] Added flag to allow resizable window
[core] Allow no default font loading
[core] Corrected old issue with mouse buttons on web
[core] Improved gamepad support, unified across platforms
[core] Gamepad id functionality: GetGamepadName(), IsGamepadName()
[core] Gamepad buttons/axis checking functionality:
[core] Reviewed Android key inputs system, unified with desktop
[rlgl] Redesigned lighting shader system
[rlgl] Reviewed UpdateVrTracking() and rlglLoadRenderTexture()
[rlgl] Updated standard shader for better performance
[rlgl] Support alpha on framebuffer: rlglLoadRenderTexture()
[rlgl] Reviewed UpdateVrTracking() to update camera
[rlgl] Added IsVrSimulator() to check for VR simulator
[shapes] Corrected issue on DrawPolyEx()
[textures] Simplified supported image formats support
[textures] Improved text drawing within an image: ImageDrawText()
[textures] Support image alpha mixing: ImageAlphaMask()
[textures] Support textures filtering: SetTextureFilter()
[textures] Support textures wrap modes: SetTextureWrap()
[text] Improved TTF spritefont generation: LoadSpriteFontTTF()
[text] Improved AngelCode fonts support
[text] Reviewed spacing formatting
[text] Improved AngelCode fonts support (unordered chars)
[text] Added TraceLog info on image spritefont loading
[text] Improved text measurement: MeasureTextEx()
[models] Improved OBJ loading flexibility
[models] Reviewed functions: DrawLine3D(), DrawCircle3D()
[models] Removed function: ResolveCollisionCubicmap()
[camera] Redesigned camera system and ported to header-only
[camera] Removed function: UpdateCameraPlayer()
[gestures] Redesigned gestures module to header-only
[audio] Simplified Music loading and playing system
[audio] Added trace on audio device closing
[audio] Reviewed Wave struct for reter flexivility
[audio] Reviewed Wave struct, improved flexibility
[audio] Support sound data update: UpdateSound()
[audio] Added support for FLAC audio loading/streaming
[raygui] Removed raygui from raylib repo (moved to own repo)
Expand All @@ -52,8 +57,8 @@ other changes:
[build] Support shared/dynamic raylib compilation
[*] Updated LibOVR to SDK version 1.8
[*] Updated games to latest raylib version
[*] Improved Android support
[*] Improved examples and added new ones
[*] Improved Android support

-----------------------------------------------
Release: raylib 1.5.0 (18 July 2016)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,16 @@ On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new v

Complete raylib LUA binding. All raylib functions plus the +60 code examples have been ported to LUA, now LUA users can enjoy coding videogames in LUA while using all the internal power of raylib. This addition also open the doors to LUA scripting support for a future raylib-based engine, being able to move game logic (Init, Update, Draw, De-Init) to LUA scripts while keep using raylib functionality.

Completely redesigned audio module. Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added to allow raw audio processing and playing. FLAC file format support has also been added. In the same line, OpenAL Soft backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more!
Completely redesigned audio module. Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming. FLAC file format support has also been added. In the same line, OpenAL Soft backend is now provided as a static library in Windows to allow static linking and get ride of OpenAL32.dll. Now raylib Windows games are completey self-contained, no external libraries required any more!

Physac module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by @victorfisac, multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing!

Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility. Consequently, camera system usage has been simplified in all examples.

Improved Gamepad support on Windows and Raspberry Pi with the addition of new functions for custom gamepad configurations but supporting by default PS3 and Xbox-based gamepads.

Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support.

Physac module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten by @victorfisac, multiple samples have been added and countless new features to match current standard 2D physic libraries.

Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking. Also thinking on advance users, it has been added pre-configured Visual Studio C++ 2015 solution with raylib project and C/C++ examples for users that prefer that professional IDE and compiler.

New examples, new functions, complete code-base review, multiple bugs corrected... this is raylib 1.6. Enjoy making games.
Expand Down
54 changes: 51 additions & 3 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten)
#
# NOTE: By default examples are compiled using raylib static library and OpenAL Soft shared library
#
# Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
Expand All @@ -26,6 +28,9 @@
# WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop()
PLATFORM ?= PLATFORM_DESKTOP

# define NO to use OpenAL Soft as static library (shared by default)
SHARED_OPENAL ?= YES

# determine PLATFORM_OS in case PLATFORM_DESKTOP selected
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
Expand Down Expand Up @@ -62,12 +67,13 @@ endif

# define compiler flags:
# -O2 defines optimization level
# -s strip unnecessary data from build
# -Wall turns on most, but not all, compiler warnings
# -std=c99 use standard C from 1999 revision
ifeq ($(PLATFORM),PLATFORM_RPI)
CFLAGS = -O2 -Wall -std=gnu99 -fgnu89-inline
CFLAGS = -O2 -s -Wall -std=gnu99 -fgnu89-inline
else
CFLAGS = -O2 -Wall -std=c99
CFLAGS = -O2 -s -Wall -std=c99
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
CFLAGS = -O1 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --preload-file resources
Expand Down Expand Up @@ -151,7 +157,14 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
else
# libraries for Windows desktop compiling
# NOTE: GLFW3 and OpenAL Soft libraries should be installed
LIBS = -lraylib -lglfw3 -lopengl32 -lopenal32 -lgdi32
LIBS = -lraylib -lglfw3 -lopengl32 -lgdi32
# if static OpenAL Soft required, define the corresponding libs
ifeq ($(SHARED_OPENAL),NO)
LIBS += -lopenal32 -lwinmm
CFLAGS += -Wl,-allow-multiple-definition
else
LIBS += -lopenal32dll
endif
endif
endif
endif
Expand Down Expand Up @@ -215,6 +228,8 @@ EXAMPLES = \
text_format_text \
text_font_select \
text_writing_anim \
text_ttf_loading \
text_bmfont_unordered \
models_geometric_shapes \
models_box_collisions \
models_billboard \
Expand All @@ -230,6 +245,11 @@ EXAMPLES = \
audio_music_stream \
audio_module_playing \
audio_raw_stream \
physics_demo \
physics_friction \
physics_movement \
physics_restitution \
physics_shatter \
fix_dylib \


Expand Down Expand Up @@ -400,6 +420,14 @@ text_font_select: text_font_select.c
text_writing_anim: text_writing_anim.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)

# compile [text] example - text ttf loading
text_ttf_loading: text_ttf_loading.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)

# compile [text] example - text bmfont unordered
text_bmfont_unordered: text_bmfont_unordered.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)

# compile [models] example - basic geometric 3d shapes
models_geometric_shapes: models_geometric_shapes.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
Expand Down Expand Up @@ -464,6 +492,26 @@ audio_module_playing: audio_module_playing.c
audio_raw_stream: audio_raw_stream.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)

# compile [physac] example - physics demo
physics_demo: physics_demo.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)

# compile [physac] example - physics friction
physics_friction: physics_friction.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)

# compile [physac] example - physics movement
physics_movement: physics_movement.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)

# compile [physac] example - physics restitution
physics_restitution: physics_restitution.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)

# compile [physac] example - physics shatter
physics_shatter: physics_shatter.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)

# fix dylib install path name for each executable (MAC)
fix_dylib:
ifeq ($(PLATFORM_OS),OSX)
Expand Down
35 changes: 8 additions & 27 deletions examples/audio_module_playing.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ int main()
int screenWidth = 800;
int screenHeight = 450;

SetConfigFlags(FLAG_MSAA_4X_HINT); // NOTE: Try to enable MSAA 4X

InitWindow(screenWidth, screenHeight, "raylib [audio] example - module playing (streaming)");

InitAudioDevice(); // Initialize audio device
Expand All @@ -49,13 +51,6 @@ int main()
circles[i].speed = (float)GetRandomValue(1, 100)/20000.0f;
circles[i].color = colors[GetRandomValue(0, 13)];
}

// Load postprocessing bloom shader
Shader shader = LoadShader("resources/shaders/glsl330/base.vs",
"resources/shaders/glsl330/bloom.fs");

// Create a RenderTexture2D to be used for render to texture
RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight);

Music xm = LoadMusicStream("resources/audio/mini1111.xm");

Expand Down Expand Up @@ -117,38 +112,24 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();

ClearBackground(BLACK);
ClearBackground(WHITE);

BeginTextureMode(target); // Enable drawing to texture

for (int i = MAX_CIRCLES - 1; i >= 0; i--)
{
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha));
}

EndTextureMode(); // End drawing to texture (now we have a texture available for next passes)
for (int i = MAX_CIRCLES - 1; i >= 0; i--)
{
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha));
}

BeginShaderMode(shader);

// NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom)
DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE);

EndShaderMode();

// Draw time bar
DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, LIGHTGRAY);
DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, MAROON);
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, WHITE);
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, GRAY);

EndDrawing();
//----------------------------------------------------------------------------------
}

// De-Initialization
//--------------------------------------------------------------------------------------
UnloadShader(shader); // Unload shader
UnloadRenderTexture(target); // Unload render texture

UnloadMusicStream(xm); // Unload music stream buffers from RAM

CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)
Expand Down
31 changes: 5 additions & 26 deletions examples/audio_module_playing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ for i = MAX_CIRCLES, 1, -1 do
circles[i].color = colors[GetRandomValue(1, 14)]
end

-- Load postprocessing bloom shader
local shader = LoadShader("resources/shaders/glsl330/base.vs",
"resources/shaders/glsl330/bloom.fs")

-- Create a RenderTexture2D to be used for render to texture
local target = LoadRenderTexture(screenWidth, screenHeight)

local xm = LoadMusicStream("resources/audio/mini1111.xm")

PlayMusicStream(xm)
Expand Down Expand Up @@ -83,22 +76,11 @@ while not WindowShouldClose() do -- Detect window close button or ESC key
---------------------------------------------------------------------------------------
BeginDrawing()

ClearBackground(BLACK)

BeginTextureMode(target) -- Enable drawing to texture

for i = MAX_CIRCLES, 1, -1 do
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha))
end

EndTextureMode() -- End drawing to texture (now we have a texture available for next passes)
ClearBackground(RAYWHITE)

BeginShaderMode(shader)

-- NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom)
DrawTextureRec(target.texture, Rectangle(0, 0, target.texture.width, -target.texture.height), Vector2(0, 0), WHITE)

EndShaderMode()
for i = MAX_CIRCLES, 1, -1 do
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha))
end

-- Draw time bar
DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, LIGHTGRAY)
Expand All @@ -111,10 +93,7 @@ end

-- De-Initialization
-------------------------------------------------------------------------------------------
UnloadShader(shader) -- Unload shader
UnloadRenderTexture(target) -- Unload render texture

UnloadMusicStream(xm) -- Unload music stream buffers from RAM
UnloadMusicStream(xm) -- Unload music stream buffers from RAM

CloseAudioDevice() -- Close audio device (music streaming is automatically stopped)

Expand Down
Binary file modified examples/audio_module_playing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/audio_raw_stream.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions examples/audio_standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

int main()
{
// Initialization
//--------------------------------------------------------------------------------------
unsigned char key;

InitAudioDevice();
Expand All @@ -43,7 +45,9 @@ int main()
PlayMusicStream(music);

printf("\nPress s or d to play sounds...\n");

//--------------------------------------------------------------------------------------

// Main loop
while (key != KEY_ESCAPE)
{
if (kbhit()) key = getch();
Expand All @@ -63,15 +67,15 @@ int main()
UpdateMusicStream(music);
}

// De-Initialization
//--------------------------------------------------------------------------------------
UnloadSound(fxWav); // Unload sound data
UnloadSound(fxOgg); // Unload sound data

UnloadMusicStream(music); // Unload music stream data

CloseAudioDevice();

printf("\n\nPress ENTER to close...");
getchar();
//--------------------------------------------------------------------------------------

return 0;
}
11 changes: 5 additions & 6 deletions examples/core_3d_camera_first_person.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera first person")

-- Define the camera to look into our 3d world (position, target, up vector)
local camera = Camera(Vector3(0.0, 10.0, 10.0), Vector3(0.0, 0.0, 0.0), Vector3(0.0, 1.0, 0.0), 60.0)
local camera = Camera(Vector3(4.0, 2.0, 4.0), Vector3(0.0, 1.8, 0.0), Vector3(0.0, 1.0, 0.0), 60.0)

-- Generates some random columns
local heights = {}
Expand All @@ -34,17 +34,16 @@ end

local playerPosition = Vector3(4.0, 2.0, 4.0) -- Define player position

SetCameraMode(CameraMode.FIRST_PERSON) -- Set a first person camera mode
SetCameraFovy(camera.fovy) -- Set internal camera field-of-view Y
SetCameraMode(camera, CameraMode.FIRST_PERSON) -- Set a first person camera mode

SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
-------------------------------------------------------------------------------------------

-- Main game loop
while not WindowShouldClose() do -- Detect window close button or ESC key
while not WindowShouldClose() do -- Detect window close button or ESC key
-- Update
---------------------------------------------------------------------------------------
camera, playerPosition = UpdateCameraPlayer(camera, playerPosition) -- Update camera and player position
camera = UpdateCamera(camera) -- Update camera
---------------------------------------------------------------------------------------

-- Draw
Expand Down
Loading

0 comments on commit 17f09cb

Please sign in to comment.