Skip to content

Commit 17f09cb

Browse files
authored
Merge pull request #198 from raysan5/develop
Develop branch integration
2 parents 05f68c2 + a81dfab commit 17f09cb

File tree

87 files changed

+6812
-4082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+6812
-4082
lines changed

CHANGELOG

+13-8
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,44 @@ NOTE:
1111
It includes some interesting new features and is a stepping stone towards raylib future.
1212

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

18-
other changes:
18+
Other changes:
1919

2020
[core] Corrected issue on OSX with HighDPI display
2121
[core] Added flag to allow resizable window
2222
[core] Allow no default font loading
2323
[core] Corrected old issue with mouse buttons on web
2424
[core] Improved gamepad support, unified across platforms
25+
[core] Gamepad id functionality: GetGamepadName(), IsGamepadName()
26+
[core] Gamepad buttons/axis checking functionality:
2527
[core] Reviewed Android key inputs system, unified with desktop
2628
[rlgl] Redesigned lighting shader system
27-
[rlgl] Reviewed UpdateVrTracking() and rlglLoadRenderTexture()
2829
[rlgl] Updated standard shader for better performance
30+
[rlgl] Support alpha on framebuffer: rlglLoadRenderTexture()
31+
[rlgl] Reviewed UpdateVrTracking() to update camera
32+
[rlgl] Added IsVrSimulator() to check for VR simulator
2933
[shapes] Corrected issue on DrawPolyEx()
3034
[textures] Simplified supported image formats support
3135
[textures] Improved text drawing within an image: ImageDrawText()
3236
[textures] Support image alpha mixing: ImageAlphaMask()
3337
[textures] Support textures filtering: SetTextureFilter()
3438
[textures] Support textures wrap modes: SetTextureWrap()
3539
[text] Improved TTF spritefont generation: LoadSpriteFontTTF()
36-
[text] Improved AngelCode fonts support
37-
[text] Reviewed spacing formatting
40+
[text] Improved AngelCode fonts support (unordered chars)
3841
[text] Added TraceLog info on image spritefont loading
3942
[text] Improved text measurement: MeasureTextEx()
4043
[models] Improved OBJ loading flexibility
44+
[models] Reviewed functions: DrawLine3D(), DrawCircle3D()
4145
[models] Removed function: ResolveCollisionCubicmap()
4246
[camera] Redesigned camera system and ported to header-only
47+
[camera] Removed function: UpdateCameraPlayer()
4348
[gestures] Redesigned gestures module to header-only
4449
[audio] Simplified Music loading and playing system
4550
[audio] Added trace on audio device closing
46-
[audio] Reviewed Wave struct for reter flexivility
51+
[audio] Reviewed Wave struct, improved flexibility
4752
[audio] Support sound data update: UpdateSound()
4853
[audio] Added support for FLAC audio loading/streaming
4954
[raygui] Removed raygui from raylib repo (moved to own repo)
@@ -52,8 +57,8 @@ other changes:
5257
[build] Support shared/dynamic raylib compilation
5358
[*] Updated LibOVR to SDK version 1.8
5459
[*] Updated games to latest raylib version
55-
[*] Improved Android support
5660
[*] Improved examples and added new ones
61+
[*] Improved Android support
5762

5863
-----------------------------------------------
5964
Release: raylib 1.5.0 (18 July 2016)

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,16 @@ On November 2016, only 4 months after raylib 1.5, arrives raylib 1.6. This new v
160160

161161
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.
162162

163-
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!
163+
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!
164+
165+
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!
164166

165167
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.
166168

167169
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.
168170

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

171-
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.
172-
173173
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.
174174

175175
New examples, new functions, complete code-base review, multiple bugs corrected... this is raylib 1.6. Enjoy making games.

examples/Makefile

+51-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#
33
# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten)
44
#
5+
# NOTE: By default examples are compiled using raylib static library and OpenAL Soft shared library
6+
#
57
# Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
68
#
79
# This software is provided "as-is", without any express or implied warranty. In no event
@@ -26,6 +28,9 @@
2628
# WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop()
2729
PLATFORM ?= PLATFORM_DESKTOP
2830

31+
# define NO to use OpenAL Soft as static library (shared by default)
32+
SHARED_OPENAL ?= YES
33+
2934
# determine PLATFORM_OS in case PLATFORM_DESKTOP selected
3035
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
3136
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
@@ -62,12 +67,13 @@ endif
6267

6368
# define compiler flags:
6469
# -O2 defines optimization level
70+
# -s strip unnecessary data from build
6571
# -Wall turns on most, but not all, compiler warnings
6672
# -std=c99 use standard C from 1999 revision
6773
ifeq ($(PLATFORM),PLATFORM_RPI)
68-
CFLAGS = -O2 -Wall -std=gnu99 -fgnu89-inline
74+
CFLAGS = -O2 -s -Wall -std=gnu99 -fgnu89-inline
6975
else
70-
CFLAGS = -O2 -Wall -std=c99
76+
CFLAGS = -O2 -s -Wall -std=c99
7177
endif
7278
ifeq ($(PLATFORM),PLATFORM_WEB)
7379
CFLAGS = -O1 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --preload-file resources
@@ -151,7 +157,14 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
151157
else
152158
# libraries for Windows desktop compiling
153159
# NOTE: GLFW3 and OpenAL Soft libraries should be installed
154-
LIBS = -lraylib -lglfw3 -lopengl32 -lopenal32 -lgdi32
160+
LIBS = -lraylib -lglfw3 -lopengl32 -lgdi32
161+
# if static OpenAL Soft required, define the corresponding libs
162+
ifeq ($(SHARED_OPENAL),NO)
163+
LIBS += -lopenal32 -lwinmm
164+
CFLAGS += -Wl,-allow-multiple-definition
165+
else
166+
LIBS += -lopenal32dll
167+
endif
155168
endif
156169
endif
157170
endif
@@ -215,6 +228,8 @@ EXAMPLES = \
215228
text_format_text \
216229
text_font_select \
217230
text_writing_anim \
231+
text_ttf_loading \
232+
text_bmfont_unordered \
218233
models_geometric_shapes \
219234
models_box_collisions \
220235
models_billboard \
@@ -230,6 +245,11 @@ EXAMPLES = \
230245
audio_music_stream \
231246
audio_module_playing \
232247
audio_raw_stream \
248+
physics_demo \
249+
physics_friction \
250+
physics_movement \
251+
physics_restitution \
252+
physics_shatter \
233253
fix_dylib \
234254

235255

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

423+
# compile [text] example - text ttf loading
424+
text_ttf_loading: text_ttf_loading.c
425+
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
426+
427+
# compile [text] example - text bmfont unordered
428+
text_bmfont_unordered: text_bmfont_unordered.c
429+
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
430+
403431
# compile [models] example - basic geometric 3d shapes
404432
models_geometric_shapes: models_geometric_shapes.c
405433
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
@@ -464,6 +492,26 @@ audio_module_playing: audio_module_playing.c
464492
audio_raw_stream: audio_raw_stream.c
465493
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
466494

495+
# compile [physac] example - physics demo
496+
physics_demo: physics_demo.c
497+
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
498+
499+
# compile [physac] example - physics friction
500+
physics_friction: physics_friction.c
501+
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
502+
503+
# compile [physac] example - physics movement
504+
physics_movement: physics_movement.c
505+
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
506+
507+
# compile [physac] example - physics restitution
508+
physics_restitution: physics_restitution.c
509+
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
510+
511+
# compile [physac] example - physics shatter
512+
physics_shatter: physics_shatter.c
513+
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
514+
467515
# fix dylib install path name for each executable (MAC)
468516
fix_dylib:
469517
ifeq ($(PLATFORM_OS),OSX)

examples/audio_module_playing.c

+8-27
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ int main()
3030
int screenWidth = 800;
3131
int screenHeight = 450;
3232

33+
SetConfigFlags(FLAG_MSAA_4X_HINT); // NOTE: Try to enable MSAA 4X
34+
3335
InitWindow(screenWidth, screenHeight, "raylib [audio] example - module playing (streaming)");
3436

3537
InitAudioDevice(); // Initialize audio device
@@ -49,13 +51,6 @@ int main()
4951
circles[i].speed = (float)GetRandomValue(1, 100)/20000.0f;
5052
circles[i].color = colors[GetRandomValue(0, 13)];
5153
}
52-
53-
// Load postprocessing bloom shader
54-
Shader shader = LoadShader("resources/shaders/glsl330/base.vs",
55-
"resources/shaders/glsl330/bloom.fs");
56-
57-
// Create a RenderTexture2D to be used for render to texture
58-
RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight);
5954

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

@@ -117,38 +112,24 @@ int main()
117112
//----------------------------------------------------------------------------------
118113
BeginDrawing();
119114

120-
ClearBackground(BLACK);
115+
ClearBackground(WHITE);
121116

122-
BeginTextureMode(target); // Enable drawing to texture
123-
124-
for (int i = MAX_CIRCLES - 1; i >= 0; i--)
125-
{
126-
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha));
127-
}
128-
129-
EndTextureMode(); // End drawing to texture (now we have a texture available for next passes)
117+
for (int i = MAX_CIRCLES - 1; i >= 0; i--)
118+
{
119+
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha));
120+
}
130121

131-
BeginShaderMode(shader);
132-
133-
// NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom)
134-
DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE);
135-
136-
EndShaderMode();
137-
138122
// Draw time bar
139123
DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, LIGHTGRAY);
140124
DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, MAROON);
141-
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, WHITE);
125+
DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, GRAY);
142126

143127
EndDrawing();
144128
//----------------------------------------------------------------------------------
145129
}
146130

147131
// De-Initialization
148132
//--------------------------------------------------------------------------------------
149-
UnloadShader(shader); // Unload shader
150-
UnloadRenderTexture(target); // Unload render texture
151-
152133
UnloadMusicStream(xm); // Unload music stream buffers from RAM
153134

154135
CloseAudioDevice(); // Close audio device (music streaming is automatically stopped)

examples/audio_module_playing.lua

+5-26
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ for i = MAX_CIRCLES, 1, -1 do
3737
circles[i].color = colors[GetRandomValue(1, 14)]
3838
end
3939

40-
-- Load postprocessing bloom shader
41-
local shader = LoadShader("resources/shaders/glsl330/base.vs",
42-
"resources/shaders/glsl330/bloom.fs")
43-
44-
-- Create a RenderTexture2D to be used for render to texture
45-
local target = LoadRenderTexture(screenWidth, screenHeight)
46-
4740
local xm = LoadMusicStream("resources/audio/mini1111.xm")
4841

4942
PlayMusicStream(xm)
@@ -83,22 +76,11 @@ while not WindowShouldClose() do -- Detect window close button or ESC key
8376
---------------------------------------------------------------------------------------
8477
BeginDrawing()
8578

86-
ClearBackground(BLACK)
87-
88-
BeginTextureMode(target) -- Enable drawing to texture
89-
90-
for i = MAX_CIRCLES, 1, -1 do
91-
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha))
92-
end
93-
94-
EndTextureMode() -- End drawing to texture (now we have a texture available for next passes)
79+
ClearBackground(RAYWHITE)
9580

96-
BeginShaderMode(shader)
97-
98-
-- NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom)
99-
DrawTextureRec(target.texture, Rectangle(0, 0, target.texture.width, -target.texture.height), Vector2(0, 0), WHITE)
100-
101-
EndShaderMode()
81+
for i = MAX_CIRCLES, 1, -1 do
82+
DrawCircleV(circles[i].position, circles[i].radius, Fade(circles[i].color, circles[i].alpha))
83+
end
10284

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

11294
-- De-Initialization
11395
-------------------------------------------------------------------------------------------
114-
UnloadShader(shader) -- Unload shader
115-
UnloadRenderTexture(target) -- Unload render texture
116-
117-
UnloadMusicStream(xm) -- Unload music stream buffers from RAM
96+
UnloadMusicStream(xm) -- Unload music stream buffers from RAM
11897

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

examples/audio_module_playing.png

-164 KB
Loading

examples/audio_raw_stream.png

16.3 KB
Loading

examples/audio_standalone.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
int main()
3434
{
35+
// Initialization
36+
//--------------------------------------------------------------------------------------
3537
unsigned char key;
3638

3739
InitAudioDevice();
@@ -43,7 +45,9 @@ int main()
4345
PlayMusicStream(music);
4446

4547
printf("\nPress s or d to play sounds...\n");
46-
48+
//--------------------------------------------------------------------------------------
49+
50+
// Main loop
4751
while (key != KEY_ESCAPE)
4852
{
4953
if (kbhit()) key = getch();
@@ -63,15 +67,15 @@ int main()
6367
UpdateMusicStream(music);
6468
}
6569

70+
// De-Initialization
71+
//--------------------------------------------------------------------------------------
6672
UnloadSound(fxWav); // Unload sound data
6773
UnloadSound(fxOgg); // Unload sound data
6874

6975
UnloadMusicStream(music); // Unload music stream data
7076

7177
CloseAudioDevice();
72-
73-
printf("\n\nPress ENTER to close...");
74-
getchar();
78+
//--------------------------------------------------------------------------------------
7579

7680
return 0;
7781
}

examples/core_3d_camera_first_person.lua

+5-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ local screenHeight = 450
1919
InitWindow(screenWidth, screenHeight, "raylib [core] example - 3d camera first person")
2020

2121
-- Define the camera to look into our 3d world (position, target, up vector)
22-
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)
22+
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)
2323

2424
-- Generates some random columns
2525
local heights = {}
@@ -34,17 +34,16 @@ end
3434

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

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

40-
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
39+
SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
4140
-------------------------------------------------------------------------------------------
4241

4342
-- Main game loop
44-
while not WindowShouldClose() do -- Detect window close button or ESC key
43+
while not WindowShouldClose() do -- Detect window close button or ESC key
4544
-- Update
4645
---------------------------------------------------------------------------------------
47-
camera, playerPosition = UpdateCameraPlayer(camera, playerPosition) -- Update camera and player position
46+
camera = UpdateCamera(camera) -- Update camera
4847
---------------------------------------------------------------------------------------
4948

5049
-- Draw

0 commit comments

Comments
 (0)