Skip to content

Commit 07e5a17

Browse files
committed
example resize fixes
1 parent f9db7fa commit 07e5a17

26 files changed

+292
-210
lines changed

cmake/raylib-config.cmake

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# - Try to find raylib
22
# Options:
3-
# raylib_USE_STATIC_LIBS - OFF by default
3+
# raylib_USE_STATIC_LIBS - ON by default
44
# raylib_VERBOSE - OFF by default
55
# Once done, this defines a raylib target that can be passed to
66
# target_link_libraries as well as following variables:
@@ -11,6 +11,9 @@
1111
# raylib_LDFLAGS - The linker flags needed with raylib
1212
# raylib_DEFINITIONS - Compiler switches required for using raylib
1313

14+
option(raylib_USE_STATIC_LIBS "Use static libs" ON)
15+
option(raylib_VERBOSE "Use static libs" OFF)
16+
1417
if (NOT TARGET raylib)
1518
set(XPREFIX PC_RAYLIB)
1619

@@ -25,23 +28,22 @@ if (NOT TARGET raylib)
2528

2629
find_path(raylib_INCLUDE_DIR
2730
NAMES raylib.h
28-
HINTS ${${XPREFIX}_INCLUDE_DIRS}
31+
HINTS ${${XPREFIX}_INCLUDE_DIRS} ${raylib_DIR}/../../../include/
2932
)
3033

31-
set(RAYLIB_NAMES raylib)
3234

3335
if (raylib_USE_STATIC_LIBS)
34-
set(RAYLIB_NAMES libraylib.a raylib.lib ${RAYLIB_NAMES})
35-
endif()
36+
set(RAYLIB_NAMES libraylib.a raylib.lib)
37+
else ()
38+
set(RAYLIB_NAMES raylib)
39+
endif ()
3640

3741
find_library(raylib_LIBRARY
3842
NAMES ${RAYLIB_NAMES}
39-
HINTS ${${XPREFIX}_LIBRARY_DIRS}
43+
HINTS ${${XPREFIX}_LIBRARY_DIRS} ${raylib_DIR}/../../
4044
)
4145

4246
set(raylib_LIBRARIES ${raylib_LIBRARY})
43-
set(raylib_LIBRARY_DIRS ${${XPREFIX}_LIBRARY_DIRS})
44-
set(raylib_LIBRARY_DIR ${raylib_LIBRARY_DIRS})
4547
set(raylib_INCLUDE_DIRS ${raylib_INCLUDE_DIR})
4648
set(raylib_LDFLAGS ${${XPREFIX}_LDFLAGS})
4749

examples/models/models_animation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ int main(void)
9494
EndMode3D();
9595

9696
DrawText("PRESS SPACE to PLAY MODEL ANIMATION", 10, 10, 20, MAROON);
97-
DrawText("(c) Guy IQM 3D model by @culacant", screenWidth - 200, screenHeight - 20, 10, GRAY);
97+
DrawText("(c) Guy IQM 3D model by @culacant", GetScreenWidth() - 200, GetScreenHeight() - 20, 10, GRAY);
9898

9999
EndDrawing();
100100
//----------------------------------------------------------------------------------

examples/models/models_box_collisions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int main(void)
111111

112112
EndMode3D();
113113

114-
DrawText("Move player with arrow keys to collide", 220, 40, 20, GRAY);
114+
DrawText("Move player with arrow keys to collide", GetScreenWidth()/2 - 220, 40, 20, GRAY);
115115

116116
DrawFPS(10, 10);
117117

@@ -125,4 +125,4 @@ int main(void)
125125
//--------------------------------------------------------------------------------------
126126

127127
return 0;
128-
}
128+
}

examples/models/models_heightmap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ int main(void)
7171

7272
EndMode3D();
7373

74-
DrawTexture(texture, screenWidth - texture.width - 20, 20, WHITE);
75-
DrawRectangleLines(screenWidth - texture.width - 20, 20, texture.width, texture.height, GREEN);
74+
DrawTexture(texture, GetScreenWidth() - texture.width - 20, 20, WHITE);
75+
DrawRectangleLines(GetScreenWidth() - texture.width - 20, 20, texture.width, texture.height, GREEN);
7676

7777
DrawFPS(10, 10);
7878

@@ -89,4 +89,4 @@ int main(void)
8989
//--------------------------------------------------------------------------------------
9090

9191
return 0;
92-
}
92+
}

examples/models/models_loading.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ int main(void)
135135
DrawText("Drag & drop model to load mesh/texture.", 10, GetScreenHeight() - 20, 10, DARKGRAY);
136136
if (selected) DrawText("MODEL SELECTED", GetScreenWidth() - 110, 10, 10, GREEN);
137137

138-
DrawText("(c) Castle 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY);
138+
DrawText("(c) Castle 3D model by Alberto Cano", GetScreenWidth() - 200, GetScreenHeight() - 20, 10, GRAY);
139139

140140
DrawFPS(10, 10);
141141

@@ -152,4 +152,4 @@ int main(void)
152152
//--------------------------------------------------------------------------------------
153153

154154
return 0;
155-
}
155+
}

examples/models/models_loading_vox.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ int main(void)
182182
EndMode3D();
183183

184184
// Display info
185-
DrawRectangle(10, 400, 340, 60, Fade(SKYBLUE, 0.5f));
186-
DrawRectangleLines(10, 400, 340, 60, Fade(DARKBLUE, 0.5f));
187-
DrawText("MOUSE LEFT BUTTON to CYCLE VOX MODELS", 40, 410, 10, BLUE);
188-
DrawText("MOUSE MIDDLE BUTTON to ZOOM OR ROTATE CAMERA", 40, 420, 10, BLUE);
189-
DrawText("UP-DOWN-LEFT-RIGHT KEYS to MOVE CAMERA", 40, 430, 10, BLUE);
185+
DrawRectangle(10, GetScreenHeight() - 50, 340, 60, Fade(SKYBLUE, 0.5f));
186+
DrawRectangleLines(10, GetScreenHeight() - 50, 340, 60, Fade(DARKBLUE, 0.5f));
187+
DrawText("MOUSE LEFT BUTTON to CYCLE VOX MODELS", 40, GetScreenHeight() - 50 + 10, 10, BLUE);
188+
DrawText("MOUSE MIDDLE BUTTON to ZOOM OR ROTATE CAMERA", 40, GetScreenHeight() - 50 + 20, 10, BLUE);
189+
DrawText("UP-DOWN-LEFT-RIGHT KEYS to MOVE CAMERA", 40, GetScreenHeight() - 50 + 30, 10, BLUE);
190190
DrawText(TextFormat("File: %s", GetFileName(voxFileNames[currentModel])), 10, 10, 20, GRAY);
191191

192192
EndDrawing();

examples/models/models_mesh_generation.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,21 +110,21 @@ int main(void)
110110

111111
EndMode3D();
112112

113-
DrawRectangle(30, 400, 310, 30, Fade(SKYBLUE, 0.5f));
114-
DrawRectangleLines(30, 400, 310, 30, Fade(DARKBLUE, 0.5f));
115-
DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, 410, 10, BLUE);
113+
DrawRectangle(30, GetScreenHeight() - 50, 310, 30, Fade(SKYBLUE, 0.5f));
114+
DrawRectangleLines(30, GetScreenHeight() - 50, 310, 30, Fade(DARKBLUE, 0.5f));
115+
DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, GetScreenHeight() - 50 + 10, 10, BLUE);
116116

117117
switch (currentModel)
118118
{
119-
case 0: DrawText("PLANE", 680, 10, 20, DARKBLUE); break;
120-
case 1: DrawText("CUBE", 680, 10, 20, DARKBLUE); break;
121-
case 2: DrawText("SPHERE", 680, 10, 20, DARKBLUE); break;
122-
case 3: DrawText("HEMISPHERE", 640, 10, 20, DARKBLUE); break;
123-
case 4: DrawText("CYLINDER", 680, 10, 20, DARKBLUE); break;
124-
case 5: DrawText("TORUS", 680, 10, 20, DARKBLUE); break;
125-
case 6: DrawText("KNOT", 680, 10, 20, DARKBLUE); break;
126-
case 7: DrawText("POLY", 680, 10, 20, DARKBLUE); break;
127-
case 8: DrawText("Custom (triangle)", 580, 10, 20, DARKBLUE); break;
119+
case 0: DrawText("PLANE", GetScreenWidth() - 120, 10, 20, DARKBLUE); break;
120+
case 1: DrawText("CUBE", GetScreenWidth() - 120, 10, 20, DARKBLUE); break;
121+
case 2: DrawText("SPHERE", GetScreenWidth() - 120, 10, 20, DARKBLUE); break;
122+
case 3: DrawText("HEMISPHERE", GetScreenWidth() - 160, 10, 20, DARKBLUE); break;
123+
case 4: DrawText("CYLINDER", GetScreenWidth() - 120, 10, 20, DARKBLUE); break;
124+
case 5: DrawText("TORUS", GetScreenWidth() - 120, 10, 20, DARKBLUE); break;
125+
case 6: DrawText("KNOT", GetScreenWidth() - 120, 10, 20, DARKBLUE); break;
126+
case 7: DrawText("POLY", GetScreenWidth() - 120, 10, 20, DARKBLUE); break;
127+
case 8: DrawText("Custom (triangle)", GetScreenWidth() - 220, 10, 20, DARKBLUE); break;
128128
default: break;
129129
}
130130

examples/models/models_mesh_picking.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ int main(void)
226226
DrawText(TextFormat("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK);
227227
}
228228

229-
DrawText("Right click mouse to toggle camera controls", 10, 430, 10, GRAY);
229+
DrawText("Right click mouse to toggle camera controls", 10, GetScreenHeight() - 20, 10, GRAY);
230230

231-
DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY);
231+
DrawText("(c) Turret 3D model by Alberto Cano", GetScreenWidth() - 200, GetScreenHeight() - 20, 10, GRAY);
232232

233233
DrawFPS(10, 10);
234234

@@ -245,4 +245,4 @@ int main(void)
245245
//--------------------------------------------------------------------------------------
246246

247247
return 0;
248-
}
248+
}

examples/models/models_point_rendering.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ int main()
125125
EndMode3D();
126126

127127
// Draw UI text
128-
DrawText(TextFormat("Point Count: %d", numPoints), 20, screenHeight - 50, 40, WHITE);
128+
DrawText(TextFormat("Point Count: %d", numPoints), 20, GetScreenHeight() - 50, 40, WHITE);
129129
DrawText("Up - increase points", 20, 70, 20, WHITE);
130130
DrawText("Down - decrease points", 20, 100, 20, WHITE);
131131
DrawText("Space - drawing function", 20, 130, 20, WHITE);

examples/models/models_rlgl_solar_system.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ int main(void)
112112

113113
EndMode3D();
114114

115-
DrawText("EARTH ORBITING AROUND THE SUN!", 400, 10, 20, MAROON);
115+
DrawText("EARTH ORBITING AROUND THE SUN!", GetScreenWidth() - 400, 10, 20, MAROON);
116116
DrawFPS(10, 10);
117117

118118
EndDrawing();

0 commit comments

Comments
 (0)