Skip to content

Commit 5751fc3

Browse files
committed
update to new per-project premake
1 parent fb3b3e7 commit 5751fc3

File tree

28 files changed

+311
-224
lines changed

28 files changed

+311
-224
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,5 @@ MigrationBackup/
351351
*.vcxproj
352352
*.make
353353
*.filters
354+
/camera_clamp/*.sln
355+
/raylib-master

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,19 @@
33
Examples and samples made for raylib using C
44

55
## Building
6-
The examples use premake, assumes a raylib folder is created manualy or using the submodule. Get premake5 for your system and run it for your build target. Batch file for visual studio is included.
6+
The examples use premake. Each example is a project on it's own. Premake will setup the build systems for each project for you, and download any needed libraries (raylib and box2d)
7+
8+
### For Visual Studio
9+
Run premake-VisualStudio.bat. When it is done each example folder will have a .sln file in it that you can open and run.
10+
11+
### For MinGW
12+
Run premake-mingw.bat. When it is done each example folder will have a makefile that you can build, just cd into the example folder and type make.
13+
14+
### For GCC On Linux
15+
Run "premake5 gmake2". When it is done each example folder will have a makefile that you can build, just cd into the example folder and type make.
16+
17+
### For GCC On MacOs
18+
Run "premake5.osx gmake2". When it is done each example folder will have a makefile that you can build, just cd into the example folder and type make.
719

820
# Circle In View 2D
921
Code showing how to check if a circle is inside a view cone. Shows examples of using dot products to find what side of a vector a point is on, and how to compute the nearest point on a vector to another point.

_app/main.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include "raylib.h"
2+
3+
int main ()
4+
{
5+
InitWindow(1280,800,"Example");
6+
7+
while (!WindowShouldClose())
8+
{
9+
BeginDrawing();
10+
ClearBackground(BLACK);
11+
12+
EndDrawing();
13+
}
14+
CloseWindow();
15+
return 0;
16+
}

camera_clamp/premake5.lua

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11

2-
baseName = path.getbasename(os.getcwd());
2+
baseName = path.getbasename(os.getcwd())
33

4-
project (baseName)
5-
kind "ConsoleApp"
6-
location "../build"
7-
targetdir "../bin/%{cfg.buildcfg}"
8-
9-
vpaths
10-
{
11-
["Header Files/*"] = { "**.h"},
12-
["Source Files/*"] = {"**.c", "**.cpp"},
13-
}
14-
files {"**.c", "**.cpp", "**.h"}
15-
16-
includedirs { "./"}
17-
setup_raylib();
4+
defineWorkspace(baseName)

camera_world_rect/premake5.lua

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11

2-
baseName = path.getbasename(os.getcwd());
2+
baseName = path.getbasename(os.getcwd())
33

4-
project (baseName)
5-
kind "ConsoleApp"
6-
location "../build"
7-
targetdir "../bin/%{cfg.buildcfg}"
8-
9-
vpaths
10-
{
11-
["Header Files/*"] = { "**.h"},
12-
["Source Files/*"] = {"**.c", "**.cpp"},
13-
}
14-
files {"**.c", "**.cpp", "**.h"}
15-
16-
includedirs { "./"}
17-
setup_raylib();
4+
defineWorkspace(baseName)

circle_in_view_2d/premake5.lua

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11

2-
baseName = path.getbasename(os.getcwd());
2+
baseName = path.getbasename(os.getcwd())
33

4-
project (baseName)
5-
kind "ConsoleApp"
6-
location "../build"
7-
targetdir "../bin/%{cfg.buildcfg}"
8-
9-
vpaths
10-
{
11-
["Header Files/*"] = { "**.h"},
12-
["Source Files/*"] = {"**.c", "**.cpp"},
13-
}
14-
files {"**.c", "**.cpp", "**.h"}
15-
16-
includedirs { "./"}
17-
setup_raylib();
4+
defineWorkspace(baseName)

full_3d_billboard/premake5.lua

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11

2-
baseName = path.getbasename(os.getcwd());
2+
baseName = path.getbasename(os.getcwd())
33

4-
project (baseName)
5-
kind "ConsoleApp"
6-
location "../build"
7-
targetdir "../bin/%{cfg.buildcfg}"
8-
9-
vpaths
10-
{
11-
["Header Files/*"] = { "**.h"},
12-
["Source Files/*"] = {"**.c", "**.cpp"},
13-
}
14-
files {"**.c", "**.cpp", "**.h"}
15-
16-
includedirs { "./"}
17-
setup_raylib();
4+
defineWorkspace(baseName)

mouse_zoom/premake5.lua

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11

2-
baseName = path.getbasename(os.getcwd());
2+
baseName = path.getbasename(os.getcwd())
33

4-
project (baseName)
5-
kind "ConsoleApp"
6-
location "../build"
7-
targetdir "../bin/%{cfg.buildcfg}"
8-
9-
vpaths
10-
{
11-
["Header Files/*"] = { "**.h"},
12-
["Source Files/*"] = {"**.c", "**.cpp"},
13-
}
14-
files {"**.c", "**.cpp", "**.h"}
15-
16-
includedirs { "./"}
17-
setup_raylib();
4+
defineWorkspace(baseName)

0 commit comments

Comments
 (0)