diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 42b406795..fe34c310b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -132,5 +132,7 @@ contributing (in some way or another) to make the raylib project better. Huge th - [Anata](https://github.com/anatagawa) for creating amazing examples and contributing with them - [Narice](https://github.com/narice) made easings.h includable as standalone header - [Eric J.](https://github.com/ProfJski) for shaders_eratosthenes example contribution + - [PompPenguin](https://github.com/PompPenguin) for reviewing 3rd person camera + - [Mohamed Shazan](https://github.com/msmshazan) for adding support for ANGLE graphics backend Please, if I forget someone in this list, excuse me and send a PR! diff --git a/LICENSE.md b/LICENSE.md index 3111afe16..70f6a4853 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -27,25 +27,26 @@ applications, and to alter it and redistribute it freely, subject to the followi fonts ------ -The following fonts [provided with raylib](https://github.com/raysan5/raylib/tree/master/examples/text/resources/fonts) are free to use (freeware) and have been designed by the following people: - - * Alpha Beta - Brian Kent (AEnigma) - * Setback - Brian Kent (AEnigma) - * Jupiter Crash - Brian Kent (AEnigma) - * Alagard - Hewett Tsoi - * Romulus - Hewett Tsoi - * Mecha - Captain Falcon - * PixelPlay - Aleksander Shevchuk - * PixAntiqua - Gerhard Großmann + * [Alpha Beta](https://www.dafont.com/es/alpha-beta.font) - Brian Kent (AEnigma) + * [Setback](https://www.dafont.com/es/setback.font) - Brian Kent (AEnigma) + * [Jupiter Crash](https://www.dafont.com/es/jupiter-crash.font) - Brian Kent (AEnigma) + * [Alagard](https://www.dafont.com/es/alagard.font) - Hewett Tsoi + * [Romulus](https://www.dafont.com/es/romulus.font) - Hewett Tsoi + * [Mecha](https://www.dafont.com/es/mecha-cf.font) - Captain Falcon + * [PixelPlay](https://www.dafont.com/es/pixelplay.font) - Aleksander Shevchuk + * [PixAntiqua](https://www.dafont.com/es/pixantiqua.font) - Gerhard Großmann + * [Kaiserzeit Gotisch](https://www.dafont.com/es/kaiserzeit-gotisch.font) - Dieter Steffmann + * [Noto CJK](https://www.google.com/get/noto/help/cjk/) - Google Fonts + * [Anonymous Pro](https://fonts.google.com/specimen/Anonymous+Pro) - Mark Simonson 2d art ------ -[scarfy spritesheet](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/scarfy.png) and [fudesumi image](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/fudesumi.png) have been created by [Eiden Marsal](https://www.artstation.com/artist/marshall_z) and are licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode) - -[cyberpunk street environments](https://github.com/raysan5/raylib/blob/master/examples/textures/resources) have been created by Luis Zuno ([@ansimuz](https://twitter.com/ansimuz)) and are licensed as [CC-BY-3.0](http://creativecommons.org/licenses/by/3.0/) + * [Scarfy](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/scarfy.png) - [Eiden Marsal](https://www.artstation.com/artist/marshall_z), licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode) + * [Fudesumi](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/fudesumi.png) - [Eiden Marsal](https://www.artstation.com/artist/marshall_z), licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode) + * [Cyberpunk Street Environment](https://ansimuz.itch.io/cyberpunk-street-environment) - Luis Zuno ([@ansimuz](https://twitter.com/ansimuz)), licensed as [CC-BY-3.0](http://creativecommons.org/licenses/by/3.0/) 3d models --------- -[medieval city 3d models and textures](https://github.com/raysan5/raylib/tree/master/examples/models/resources/medieval) have been created by Alberto Cano and are licensed as [Creative Commons Attribution-NonCommercial 4.0](https://creativecommons.org/licenses/by-nc/4.0/legalcode) + * [Medieval City](https://github.com/raysan5/raylib/tree/master/examples/models/resources/models) - Alberto Cano, licensed as [Creative Commons Attribution-NonCommercial 4.0](https://creativecommons.org/licenses/by-nc/4.0/legalcode) diff --git a/examples/models/models_animation.c b/examples/models/models_animation.c index 294b07a5e..7f38b7f55 100644 --- a/examples/models/models_animation.c +++ b/examples/models/models_animation.c @@ -5,7 +5,9 @@ * This example has been created using raylib 2.5 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2019 Ramon Santamaria (@raysan5) and @culacant +* Example contributed by Culacant (@culacant) and reviewed by Ramon Santamaria (@raysan5) +* +* Copyright (c) 2019 Culacant (@culacant) and Ramon Santamaria (@raysan5) * ********************************************************************************************/ diff --git a/examples/models/models_waving_cubes.c b/examples/models/models_waving_cubes.c new file mode 100644 index 000000000..f6309bd6d --- /dev/null +++ b/examples/models/models_waving_cubes.c @@ -0,0 +1,112 @@ +/******************************************************************************************* +* +* raylib [models] example - Waving cubes +* +* This example has been created using raylib 2.5 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Example contributed by Codecat (@codecat) and reviewed by Ramon Santamaria (@raysan5) +* +* Copyright (c) 2019 Codecat (@codecat) and Ramon Santamaria (@raysan5) +* +********************************************************************************************/ + +#include "raylib.h" + +#include + +int main() +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [models] example - waving cubes"); + + // Initialize the camera + Camera3D camera = { 0 }; + camera.position = (Vector3){ 30.0f, 20.0f, 30.0f }; + camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; + camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; + camera.fovy = 70.0f; + camera.type = CAMERA_PERSPECTIVE; + + // Specify the amount of blocks in each direction + const int numBlocks = 15; + + SetTargetFPS(60); + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update + //---------------------------------------------------------------------------------- + double time = GetTime(); + + // Calculate time scale for cube position and size + float scale = (2.0f + (float)sin(time))*0.7f; + + // Move camera around the scene + double cameraTime = time*0.3; + camera.position.x = (float)cos(cameraTime)*40.0f; + camera.position.z = (float)sin(cameraTime)*40.0f; + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + BeginMode3D(camera); + + DrawGrid(10, 5.0f); + + for (int x = 0; x < numBlocks; x++) + { + for (int y = 0; y < numBlocks; y++) + { + for (int z = 0; z < numBlocks; z++) + { + // Scale of the blocks depends on x/y/z positions + float blockScale = (x + y + z)/30.0f; + + // Scatter makes the waving effect by adding blockScale over time + float scatter = sinf(blockScale*20.0f + (float)(time*4.0f)); + + // Calculate the cube position + Vector3 cubePos = { + (float)(x - numBlocks/2)*(scale*3.0f) + scatter, + (float)(y - numBlocks/2)*(scale*2.0f) + scatter, + (float)(z - numBlocks/2)*(scale*3.0f) + scatter + }; + + // Pick a color with a hue depending on cube position for the rainbow color effect + Color cubeColor = ColorFromHSV((Vector3){ (float)(((x + y + z)*18)%360), 0.75f, 0.9f }); + + // Calculate cube size + float cubeSize = (2.4f - scale)*blockScale; + + // And finally, draw the cube! + DrawCube(cubePos, cubeSize, cubeSize, cubeSize, cubeColor); + } + } + } + + EndMode3D(); + + DrawFPS(10, 10); + + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} diff --git a/examples/models/models_waving_cubes.png b/examples/models/models_waving_cubes.png new file mode 100644 index 000000000..37a1761ec Binary files /dev/null and b/examples/models/models_waving_cubes.png differ diff --git a/examples/text/resources/pixantiqua.fnt b/examples/text/resources/pixantiqua.fnt index 971b9b0bc..fd9f9dbb7 100644 --- a/examples/text/resources/pixantiqua.fnt +++ b/examples/text/resources/pixantiqua.fnt @@ -1,6 +1,6 @@ info face="PixAntiqua" size=32 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=2,2,2,2 spacing=2,2 outline=0 common lineHeight=32 base=27 scaleW=512 scaleH=512 pages=1 packed=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4 -page id=0 file="pixantiqua_0.png" +page id=0 file="pixantiqua.png" chars count=184 char id=32 x=9 y=304 width=7 height=36 xoffset=-3 yoffset=-2 xadvance=8 page=0 chnl=15 char id=33 x=391 y=266 width=11 height=36 xoffset=-3 yoffset=-2 xadvance=8 page=0 chnl=15 diff --git a/examples/text/resources/pixantiqua_0.png b/examples/text/resources/pixantiqua.png similarity index 100% rename from examples/text/resources/pixantiqua_0.png rename to examples/text/resources/pixantiqua.png diff --git a/projects/VS2017.ANGLE/examples/core_basic_window.vcxproj b/projects/VS2017.ANGLE/examples/core_basic_window.vcxproj new file mode 100644 index 000000000..cf7b42aa2 --- /dev/null +++ b/projects/VS2017.ANGLE/examples/core_basic_window.vcxproj @@ -0,0 +1,194 @@ + + + + + Debug.DLL + Win32 + + + Debug + Win32 + + + Release.DLL + Win32 + + + Release + Win32 + + + + {0981CA98-E4A5-4DF1-987F-A41D09131EFC} + Win32Proj + core_basic_window + 10.0.17763.0 + core_basic_window + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(ProjectDir)$(ProjectName)\$(Configuration)\ + $(ProjectDir)$(ProjectName)\$(Configuration)\temp + + + true + $(ProjectDir)$(ProjectName)\$(Configuration)\ + $(ProjectDir)$(ProjectName)\$(Configuration)\temp + + + false + $(ProjectDir)$(ProjectName)\$(Configuration)\ + $(ProjectDir)$(ProjectName)\$(Configuration)\temp + + + false + $(ProjectDir)$(ProjectName)\$(Configuration)\ + $(ProjectDir)$(ProjectName)\$(Configuration)\temp + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + %(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + CompileAsC + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + %(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)deps;%(AdditionalLibraryDirectories) + + + xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsC + true + + + Console + true + true + true + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories) + + + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + + + + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + \ No newline at end of file diff --git a/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj b/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj new file mode 100644 index 000000000..72ead7ad0 --- /dev/null +++ b/projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj @@ -0,0 +1,192 @@ + + + + + Debug.DLL + Win32 + + + Debug + Win32 + + + Release.DLL + Win32 + + + Release + Win32 + + + + {B655E850-3322-42F7-941D-6AC18FD66CA1} + Win32Proj + raylib_example_cpp + 10.0.17763.0 + core_basic_window_cpp + + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + true + $(DefaultPlatformToolset) + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + Application + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(ProjectDir)$(ProjectName)\$(Configuration) + $(ProjectDir)$(ProjectName)\$(Configuration)\temp + + + true + $(ProjectDir)$(ProjectName)\$(Configuration) + $(ProjectDir)$(ProjectName)\$(Configuration)\temp + + + false + $(ProjectDir)$(ProjectName)\$(Configuration) + $(ProjectDir)$(ProjectName)\$(Configuration)\temp + + + false + $(ProjectDir)$(ProjectName)\$(Configuration) + $(ProjectDir)$(ProjectName)\$(Configuration)\temp + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsCpp + + + Console + true + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) + + + xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + CompileAsCpp + + + Console + true + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) + + + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + CompileAsCpp + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + true + true + $(SolutionDir)..\..\release\libs\win32\msvc;%(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy $(SolutionDir)lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + CompileAsCpp + $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) + + + Console + true + true + true + %(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy $(SolutionDir)..\..\src\external\ANGLE\lib\$(PlatformTarget)\*.dll $(OutDir) /Y /E /Q + + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + + + + + + + + \ No newline at end of file diff --git a/projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll b/projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll new file mode 100644 index 000000000..47040da0f Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll differ diff --git a/projects/VS2017.ANGLE/lib/x64/libEGL.dll b/projects/VS2017.ANGLE/lib/x64/libEGL.dll new file mode 100644 index 000000000..71c20a7a8 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x64/libEGL.dll differ diff --git a/projects/VS2017.ANGLE/lib/x64/libEGL.lib b/projects/VS2017.ANGLE/lib/x64/libEGL.lib new file mode 100644 index 000000000..b440f78c8 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x64/libEGL.lib differ diff --git a/projects/VS2017.ANGLE/lib/x64/libGLESv2.dll b/projects/VS2017.ANGLE/lib/x64/libGLESv2.dll new file mode 100644 index 000000000..66fcba066 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x64/libGLESv2.dll differ diff --git a/projects/VS2017.ANGLE/lib/x64/libGLESv2.lib b/projects/VS2017.ANGLE/lib/x64/libGLESv2.lib new file mode 100644 index 000000000..af5ba5ad9 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x64/libGLESv2.lib differ diff --git a/projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll b/projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll new file mode 100644 index 000000000..4ffad2d7d Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll differ diff --git a/projects/VS2017.ANGLE/lib/x86/libEGL.dll b/projects/VS2017.ANGLE/lib/x86/libEGL.dll new file mode 100644 index 000000000..a9cb4a9a4 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x86/libEGL.dll differ diff --git a/projects/VS2017.ANGLE/lib/x86/libEGL.lib b/projects/VS2017.ANGLE/lib/x86/libEGL.lib new file mode 100644 index 000000000..1954ceb37 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x86/libEGL.lib differ diff --git a/projects/VS2017.ANGLE/lib/x86/libGLESv2.dll b/projects/VS2017.ANGLE/lib/x86/libGLESv2.dll new file mode 100644 index 000000000..47a71ff76 Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x86/libGLESv2.dll differ diff --git a/projects/VS2017.ANGLE/lib/x86/libGLESv2.lib b/projects/VS2017.ANGLE/lib/x86/libGLESv2.lib new file mode 100644 index 000000000..562310cca Binary files /dev/null and b/projects/VS2017.ANGLE/lib/x86/libGLESv2.lib differ diff --git a/projects/VS2017.ANGLE/raylib.sln b/projects/VS2017.ANGLE/raylib.sln new file mode 100644 index 000000000..f163b7b70 --- /dev/null +++ b/projects/VS2017.ANGLE/raylib.sln @@ -0,0 +1,57 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2024 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_basic_window", "examples\core_basic_window.vcxproj", "{0981CA98-E4A5-4DF1-987F-A41D09131EFC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib", "raylib\raylib.vcxproj", "{E89D61AC-55DE-4482-AFD4-DF7242EBC859}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_basic_window_cpp", "examples\core_basic_window_cpp.vcxproj", "{B655E850-3322-42F7-941D-6AC18FD66CA1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug.DLL|x86 = Debug.DLL|x86 + Debug|x86 = Debug|x86 + Release.DLL|x86 = Release.DLL|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.ActiveCfg = Debug|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Debug|x86.Build.0 = Debug|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32 + {0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.ActiveCfg = Debug|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.Build.0 = Debug|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.ActiveCfg = Release|Win32 + {E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.Build.0 = Release|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug.DLL|x86.ActiveCfg = Debug.DLL|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug.DLL|x86.Build.0 = Debug.DLL|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug|x86.ActiveCfg = Debug|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Debug|x86.Build.0 = Debug|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release.DLL|x86.ActiveCfg = Release.DLL|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release.DLL|x86.Build.0 = Release.DLL|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release|x86.ActiveCfg = Release|Win32 + {B655E850-3322-42F7-941D-6AC18FD66CA1}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {0981CA98-E4A5-4DF1-987F-A41D09131EFC} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + {B655E850-3322-42F7-941D-6AC18FD66CA1} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E926C768-6307-4423-A1EC-57E95B1FAB29} + EndGlobalSection +EndGlobal diff --git a/projects/VS2017.ANGLE/raylib/raylib.vcxproj b/projects/VS2017.ANGLE/raylib/raylib.vcxproj new file mode 100644 index 000000000..5c97eb60b --- /dev/null +++ b/projects/VS2017.ANGLE/raylib/raylib.vcxproj @@ -0,0 +1,198 @@ + + + + + Debug.DLL + Win32 + + + Debug + Win32 + + + Release.DLL + Win32 + + + Release + Win32 + + + + {E89D61AC-55DE-4482-AFD4-DF7242EBC859} + Win32Proj + raylib + 10.0.17763.0 + + + + StaticLibrary + true + $(DefaultPlatformToolset) + Unicode + + + DynamicLibrary + true + $(DefaultPlatformToolset) + Unicode + + + StaticLibrary + false + $(DefaultPlatformToolset) + true + Unicode + + + DynamicLibrary + false + $(DefaultPlatformToolset) + true + Unicode + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)$(ProjectName)\$(Configuration)\ + + + $(SolutionDir)$(ProjectName)\$(Configuration)\ + + + $(SolutionDir)$(ProjectName)\$(Configuration)\ + $(SolutionDir)$(ProjectName)\$(Configuration)\temp + + + $(SolutionDir)$(ProjectName)\$(Configuration)\ + $(SolutionDir)$(ProjectName)\$(Configuration)\temp + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_DESKTOP + CompileAsC + $(SolutionDir)..\..\src\external\ANGLE;$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\glfw\include + + + Windows + + + $(SolutionDir)lib\$(PlatformTarget);%(AdditionalLibraryDirectories) + libEGL.lib;libGLESv2.lib + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP;BUILD_LIBTYPE_SHARED + CompileAsC + $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\glfw\include + MultiThreadedDebug + + + Windows + + + %(AdditionalLibraryDirectories) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_DESKTOP + $(SolutionDir)..\..\src\external\ANGLE;$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\glfw\include + CompileAsC + + + Windows + true + true + + + $(SolutionDir)lib\$(PlatformTarget);%(AdditionalLibraryDirectories) + libEGL.lib;libGLESv2.lib + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_33;PLATFORM_DESKTOP;BUILD_LIBTYPE_SHARED + $(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\glfw\include + CompileAsC + MultiThreaded + + + Windows + true + true + winmm.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj index fe97faaca..8296b654c 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj +++ b/projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj @@ -42,13 +42,13 @@ Application true - v141 + $(DefaultPlatformToolset) Application false true - v140 + $(DefaultPlatformToolset) diff --git a/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj index f05f829c9..6dd200962 100644 --- a/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj +++ b/projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj @@ -68,35 +68,35 @@ StaticLibrary true - v141 + $(DefaultPlatformToolset) StaticLibrary true - v141 + $(DefaultPlatformToolset) StaticLibrary true - v141 + $(DefaultPlatformToolset) StaticLibrary false true - v141 + $(DefaultPlatformToolset) StaticLibrary false true - v141 + $(DefaultPlatformToolset) StaticLibrary false true - v141 + $(DefaultPlatformToolset) diff --git a/projects/VS2017/examples/core_basic_window.vcxproj b/projects/VS2017/examples/core_basic_window.vcxproj index 0348589f2..38247bee0 100644 --- a/projects/VS2017/examples/core_basic_window.vcxproj +++ b/projects/VS2017/examples/core_basic_window.vcxproj @@ -29,26 +29,26 @@ Application true - v141 + $(DefaultPlatformToolset) Unicode Application true - v141 + $(DefaultPlatformToolset) Unicode Application false - v141 + $(DefaultPlatformToolset) true Unicode Application false - v141 + $(DefaultPlatformToolset) true Unicode diff --git a/projects/VS2017/examples/core_basic_window_cpp.vcxproj b/projects/VS2017/examples/core_basic_window_cpp.vcxproj index 6ade272df..3e3f790f8 100644 --- a/projects/VS2017/examples/core_basic_window_cpp.vcxproj +++ b/projects/VS2017/examples/core_basic_window_cpp.vcxproj @@ -29,26 +29,26 @@ Application true - v141 + $(DefaultPlatformToolset) Unicode Application true - v141 + $(DefaultPlatformToolset) Unicode Application false - v141 + $(DefaultPlatformToolset) true Unicode Application false - v141 + $(DefaultPlatformToolset) true Unicode diff --git a/projects/VS2017/raylib/raylib.vcxproj b/projects/VS2017/raylib/raylib.vcxproj index 3ff77104e..827033975 100644 --- a/projects/VS2017/raylib/raylib.vcxproj +++ b/projects/VS2017/raylib/raylib.vcxproj @@ -28,26 +28,26 @@ StaticLibrary true - v141 + $(DefaultPlatformToolset) Unicode DynamicLibrary true - v141 + $(DefaultPlatformToolset) Unicode StaticLibrary false - v141 + $(DefaultPlatformToolset) true Unicode DynamicLibrary false - v141 + $(DefaultPlatformToolset) true Unicode diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 879ac220e..9e381493d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,7 +4,7 @@ include(GNUInstallDirs) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") set(PROJECT_VERSION 2.5.0) -set(API_VERSION 2) +set(API_VERSION 251) include("CMakeOptions.txt") include(BuildType) diff --git a/src/Makefile b/src/Makefile index a2db4e73a..f3f473f09 100644 --- a/src/Makefile +++ b/src/Makefile @@ -43,7 +43,7 @@ # Define required raylib variables RAYLIB_VERSION = 2.5.0 -RAYLIB_API_VERSION = 2 +RAYLIB_API_VERSION = 251 # See below for alternatives. RAYLIB_PATH = .. diff --git a/src/camera.h b/src/camera.h index 18e1e4b7a..a933447d5 100644 --- a/src/camera.h +++ b/src/camera.h @@ -317,7 +317,7 @@ void UpdateCamera(Camera *camera) if (cameraTargetDistance > CAMERA_FREE_DISTANCE_MAX_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MAX_CLAMP; } // Camera looking down - // TODO: Review, weird comparisson of cameraTargetDistance == 120.0f? + // TODO: Review, weird comparisson of cameraTargetDistance == 120.0f? else if ((camera->position.y > camera->target.y) && (cameraTargetDistance == CAMERA_FREE_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) { camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; @@ -338,7 +338,7 @@ void UpdateCamera(Camera *camera) if (cameraTargetDistance < CAMERA_FREE_DISTANCE_MIN_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MIN_CLAMP; } // Camera looking up - // TODO: Review, weird comparisson of cameraTargetDistance == 120.0f? + // TODO: Review, weird comparisson of cameraTargetDistance == 120.0f? else if ((camera->position.y < camera->target.y) && (cameraTargetDistance == CAMERA_FREE_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) { camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; @@ -410,7 +410,7 @@ void UpdateCamera(Camera *camera) } break; case CAMERA_FIRST_PERSON: - { + { camera->position.x += (sinf(cameraAngle.x)*direction[MOVE_BACK] - sinf(cameraAngle.x)*direction[MOVE_FRONT] - cosf(cameraAngle.x)*direction[MOVE_LEFT] + @@ -432,7 +432,7 @@ void UpdateCamera(Camera *camera) // Camera orientation calculation cameraAngle.x += (mousePositionDelta.x*-CAMERA_MOUSE_MOVE_SENSITIVITY); cameraAngle.y += (mousePositionDelta.y*-CAMERA_MOUSE_MOVE_SENSITIVITY); - + // Angle clamp if (cameraAngle.y > CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD; else if (cameraAngle.y < CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD; @@ -441,7 +441,7 @@ void UpdateCamera(Camera *camera) camera->target.x = camera->position.x - sinf(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; camera->target.y = camera->position.y + sinf(cameraAngle.y)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; camera->target.z = camera->position.z - cosf(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; - + if (isMoving) swingCounter++; // Camera position update @@ -469,15 +469,11 @@ void UpdateCamera(Camera *camera) sinf(cameraAngle.x)*direction[MOVE_LEFT] - sinf(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_SENSITIVITY; - bool isMoving = false; // Required for swinging - - for (int i = 0; i < 6; i++) if (direction[i]) { isMoving = true; break; } - // Camera orientation calculation cameraAngle.x += (mousePositionDelta.x*-CAMERA_MOUSE_MOVE_SENSITIVITY); cameraAngle.y += (mousePositionDelta.y*-CAMERA_MOUSE_MOVE_SENSITIVITY); - // Angle clamp + // Angle clamp if (cameraAngle.y > CAMERA_THIRD_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_THIRD_PERSON_MIN_CLAMP*DEG2RAD; else if (cameraAngle.y < CAMERA_THIRD_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_THIRD_PERSON_MAX_CLAMP*DEG2RAD; @@ -487,14 +483,15 @@ void UpdateCamera(Camera *camera) // Camera distance clamp if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP; - // TODO: It seems camera->position is not correctly updated or some rounding issue makes the camera move straight to camera->target... - camera->position.x = sinf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.x; - if (cameraAngle.y <= 0.0f) camera->position.y = sinf(cameraAngle.y)*cameraTargetDistance*sinf(cameraAngle.y) + camera->target.y; - else camera->position.y = -sinf(cameraAngle.y)*cameraTargetDistance*sinf(cameraAngle.y) + camera->target.y; - camera->position.z = cosf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.z; + // TODO: It seems camera->position is not correctly updated or some rounding issue makes the camera move straight to camera->target... + camera->position.x = sinf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.x; + if (cameraAngle.y <= 0.0f) camera->position.y = sinf(cameraAngle.y)*cameraTargetDistance*sinf(cameraAngle.y) + camera->target.y; + else camera->position.y = -sinf(cameraAngle.y)*cameraTargetDistance*sinf(cameraAngle.y) + camera->target.y; + camera->position.z = cosf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.z; + } break; default: break; - } + } } // Set camera pan key to combine with mouse movement (free camera) diff --git a/src/core.c b/src/core.c index 26a8b2a48..45539d24b 100644 --- a/src/core.c +++ b/src/core.c @@ -2470,7 +2470,11 @@ static bool InitGraphicsDevice(int width, int height) glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); - glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_NATIVE_CONTEXT_API); // Alternative: GLFW_EGL_CONTEXT_API (ANGLE) +#if defined(PLATFORM_DESKTOP) + glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API); +#else + glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_NATIVE_CONTEXT_API); +#endif } if (fullscreen) diff --git a/src/raylib.h b/src/raylib.h index 21202f18d..9ce2e079e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1304,7 +1304,7 @@ RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); RLAPI void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture); // Set shader uniform value for texture RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) -RLAPI Matrix GetMatrixModelview(); // Get internal modelview matrix +RLAPI Matrix GetMatrixModelview(void); // Get internal modelview matrix // Texture maps generation (PBR) // NOTE: Required shaders should be provided diff --git a/src/rlgl.h b/src/rlgl.h index 639a107e3..10d21fcc1 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -525,7 +525,7 @@ RLAPI void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) -RLAPI Matrix GetMatrixModelview(); // Get internal modelview matrix +RLAPI Matrix GetMatrixModelview(void); // Get internal modelview matrix // Texture maps generation (PBR) // NOTE: Required shaders should be provided @@ -3137,7 +3137,7 @@ void SetMatrixModelview(Matrix view) } // Return internal modelview matrix -Matrix GetMatrixModelview() +Matrix GetMatrixModelview(void) { Matrix matrix = MatrixIdentity(); #if defined(GRAPHICS_API_OPENGL_11)