RENAMED: FormatText() -> TextFormat()
This function was renamed for consistency in raylib 3.0, just unified all examples to use TextFormat() instead of FormatText()
This commit is contained in:
parent
26f6a64a39
commit
c32ae480af
@ -51,7 +51,7 @@ int main(void)
|
||||
DrawText("Press SPACE to play new ogg instance!", 200, 120, 20, LIGHTGRAY);
|
||||
DrawText("Press ENTER to play new wav instance!", 200, 180, 20, LIGHTGRAY);
|
||||
|
||||
DrawText(FormatText("CONCURRENT SOUNDS PLAYING: %02i", GetSoundsPlaying()), 220, 280, 20, RED);
|
||||
DrawText(TextFormat("CONCURRENT SOUNDS PLAYING: %02i", GetSoundsPlaying()), 220, 280, 20, RED);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -134,7 +134,7 @@ int main(void)
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawText(FormatText("sine frequency: %i",(int)frequency), GetScreenWidth() - 220, 10, 20, RED);
|
||||
DrawText(TextFormat("sine frequency: %i",(int)frequency), GetScreenWidth() - 220, 10, 20, RED);
|
||||
DrawText("click mouse button to change frequency", 10, 10, 20, DARKGRAY);
|
||||
|
||||
// Draw the current buffer state proportionate to the screen
|
||||
|
@ -59,7 +59,7 @@ int main(void)
|
||||
|
||||
if (IsGamepadAvailable(GAMEPAD_PLAYER1))
|
||||
{
|
||||
DrawText(FormatText("GP1: %s", GetGamepadName(GAMEPAD_PLAYER1)), 10, 10, 10, BLACK);
|
||||
DrawText(TextFormat("GP1: %s", GetGamepadName(GAMEPAD_PLAYER1)), 10, 10, 10, BLACK);
|
||||
|
||||
if (IsGamepadName(GAMEPAD_PLAYER1, XBOX360_NAME_ID))
|
||||
{
|
||||
@ -106,8 +106,8 @@ int main(void)
|
||||
DrawRectangle(170, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER))/2.0f)*70), RED);
|
||||
DrawRectangle(604, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER))/2.0f)*70), RED);
|
||||
|
||||
//DrawText(FormatText("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK);
|
||||
//DrawText(FormatText("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK);
|
||||
//DrawText(TextFormat("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_LEFT_TRIGGER)), 10, 40, 10, BLACK);
|
||||
//DrawText(TextFormat("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK);
|
||||
}
|
||||
else if (IsGamepadName(GAMEPAD_PLAYER1, PS3_NAME_ID))
|
||||
{
|
||||
@ -161,14 +161,14 @@ int main(void)
|
||||
// TODO: Draw generic gamepad
|
||||
}
|
||||
|
||||
DrawText(FormatText("DETECTED AXIS [%i]:", GetGamepadAxisCount(GAMEPAD_PLAYER1)), 10, 50, 10, MAROON);
|
||||
DrawText(TextFormat("DETECTED AXIS [%i]:", GetGamepadAxisCount(GAMEPAD_PLAYER1)), 10, 50, 10, MAROON);
|
||||
|
||||
for (int i = 0; i < GetGamepadAxisCount(GAMEPAD_PLAYER1); i++)
|
||||
{
|
||||
DrawText(FormatText("AXIS %i: %.02f", i, GetGamepadAxisMovement(GAMEPAD_PLAYER1, i)), 20, 70 + 20*i, 10, DARKGRAY);
|
||||
DrawText(TextFormat("AXIS %i: %.02f", i, GetGamepadAxisMovement(GAMEPAD_PLAYER1, i)), 20, 70 + 20*i, 10, DARKGRAY);
|
||||
}
|
||||
|
||||
if (GetGamepadButtonPressed() != -1) DrawText(FormatText("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
|
||||
if (GetGamepadButtonPressed() != -1) DrawText(TextFormat("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED);
|
||||
else DrawText("DETECTED BUTTON: NONE", 10, 430, 10, GRAY);
|
||||
}
|
||||
else
|
||||
|
@ -43,7 +43,7 @@ int main(void)
|
||||
DrawRectangle(screenWidth/2 - 40, boxPositionY, 80, 80, MAROON);
|
||||
|
||||
DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, GRAY);
|
||||
DrawText(FormatText("Box position Y: %03i", boxPositionY), 10, 40, 20, LIGHTGRAY);
|
||||
DrawText(TextFormat("Box position Y: %03i", boxPositionY), 10, 40, 20, LIGHTGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -68,7 +68,7 @@ int main(void)
|
||||
{
|
||||
// Draw circle and touch index number
|
||||
DrawCircleV(touchPosition, 34, ORANGE);
|
||||
DrawText(FormatText("%d", i), touchPosition.x - 10, touchPosition.y - 70, 40, BLACK);
|
||||
DrawText(TextFormat("%d", i), touchPosition.x - 10, touchPosition.y - 70, 40, BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ int main(void)
|
||||
|
||||
DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, MAROON);
|
||||
|
||||
DrawText(FormatText("%i", randValue), 360, 180, 80, LIGHTGRAY);
|
||||
DrawText(TextFormat("%i", randValue), 360, 180, 80, LIGHTGRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -65,10 +65,10 @@ int main(void)
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawText(FormatText("SCORE: %i", score), 280, 130, 40, MAROON);
|
||||
DrawText(FormatText("HI-SCORE: %i", hiscore), 210, 200, 50, BLACK);
|
||||
DrawText(TextFormat("SCORE: %i", score), 280, 130, 40, MAROON);
|
||||
DrawText(TextFormat("HI-SCORE: %i", hiscore), 210, 200, 50, BLACK);
|
||||
|
||||
DrawText(FormatText("frames: %i", framesCounter), 10, 10, 20, LIME);
|
||||
DrawText(TextFormat("frames: %i", framesCounter), 10, 10, 20, LIME);
|
||||
|
||||
DrawText("Press R to generate random numbers", 220, 40, 20, LIGHTGRAY);
|
||||
DrawText("Press ENTER to SAVE values", 250, 310, 20, LIGHTGRAY);
|
||||
|
@ -56,7 +56,7 @@ int main(void)
|
||||
hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3
|
||||
|
||||
// Distortion shader (uses device lens distortion and chroma)
|
||||
Shader distortion = LoadShader(0, FormatText("resources/distortion%i.fs", GLSL_VERSION));
|
||||
Shader distortion = LoadShader(0, TextFormat("resources/distortion%i.fs", GLSL_VERSION));
|
||||
|
||||
SetVrConfiguration(hmd, distortion); // Set Vr device parameters for stereo rendering
|
||||
|
||||
|
@ -160,25 +160,25 @@ int main(void)
|
||||
EndMode3D();
|
||||
|
||||
// Draw some debug GUI text
|
||||
DrawText(FormatText("Hit Object: %s", hitObjectName), 10, 50, 10, BLACK);
|
||||
DrawText(TextFormat("Hit Object: %s", hitObjectName), 10, 50, 10, BLACK);
|
||||
|
||||
if (nearestHit.hit)
|
||||
{
|
||||
int ypos = 70;
|
||||
|
||||
DrawText(FormatText("Distance: %3.2f", nearestHit.distance), 10, ypos, 10, BLACK);
|
||||
DrawText(TextFormat("Distance: %3.2f", nearestHit.distance), 10, ypos, 10, BLACK);
|
||||
|
||||
DrawText(FormatText("Hit Pos: %3.2f %3.2f %3.2f",
|
||||
DrawText(TextFormat("Hit Pos: %3.2f %3.2f %3.2f",
|
||||
nearestHit.position.x,
|
||||
nearestHit.position.y,
|
||||
nearestHit.position.z), 10, ypos + 15, 10, BLACK);
|
||||
|
||||
DrawText(FormatText("Hit Norm: %3.2f %3.2f %3.2f",
|
||||
DrawText(TextFormat("Hit Norm: %3.2f %3.2f %3.2f",
|
||||
nearestHit.normal.x,
|
||||
nearestHit.normal.y,
|
||||
nearestHit.normal.z), 10, ypos + 30, 10, BLACK);
|
||||
|
||||
if (hitTriangle) DrawText(FormatText("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK);
|
||||
if (hitTriangle) DrawText(TextFormat("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK);
|
||||
}
|
||||
|
||||
DrawText("Use Mouse to Move Camera", 10, 430, 10, GRAY);
|
||||
|
@ -195,6 +195,6 @@ void DrawAngleGauge(Texture2D angleGauge, int x, int y, float angle, char title[
|
||||
|
||||
DrawTexturePro(angleGauge, srcRec, dstRec, origin, angle, color);
|
||||
|
||||
DrawText(FormatText("%5.1f", angle), x - MeasureText(FormatText("%5.1f", angle), textSize) / 2, y + 10, textSize, DARKGRAY);
|
||||
DrawText(TextFormat("%5.1f", angle), x - MeasureText(TextFormat("%5.1f", angle), textSize) / 2, y + 10, textSize, DARKGRAY);
|
||||
DrawText(title, x - MeasureText(title, textSize) / 2, y + 60, textSize, DARKGRAY);
|
||||
}
|
||||
|
@ -69,8 +69,8 @@ int main(void)
|
||||
modelB.materials[0].maps[MAP_DIFFUSE].texture = texture;
|
||||
modelC.materials[0].maps[MAP_DIFFUSE].texture = texture;
|
||||
|
||||
Shader shader = LoadShader(FormatText("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION),
|
||||
FormatText("resources/shaders/glsl%i/lighting.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION),
|
||||
TextFormat("resources/shaders/glsl%i/lighting.fs", GLSL_VERSION));
|
||||
|
||||
// Get some shader loactions
|
||||
shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel");
|
||||
|
@ -51,7 +51,7 @@ int main(void)
|
||||
|
||||
// Load postprocessing shader
|
||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/swirl.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/swirl.fs", GLSL_VERSION));
|
||||
|
||||
// Get variable (uniform) location on the shader to connect with the program
|
||||
// NOTE: If uniform variable could not be found in the shader, function returns -1
|
||||
|
@ -44,7 +44,7 @@ int main(void)
|
||||
|
||||
// Load Eratosthenes shader
|
||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/eratosthenes.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/eratosthenes.fs", GLSL_VERSION));
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
@ -67,8 +67,8 @@ int main(void)
|
||||
modelC.materials[0].maps[MAP_DIFFUSE].texture = texture;
|
||||
|
||||
// Load shader and set up some uniforms
|
||||
Shader shader = LoadShader(FormatText("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION),
|
||||
FormatText("resources/shaders/glsl%i/fog.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION),
|
||||
TextFormat("resources/shaders/glsl%i/fog.fs", GLSL_VERSION));
|
||||
shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel");
|
||||
shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos");
|
||||
|
||||
|
@ -32,11 +32,11 @@ int main(void)
|
||||
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - hot reloading");
|
||||
|
||||
const char *fragShaderFileName = "resources/shaders/glsl%i/reload.fs";
|
||||
long fragShaderFileModTime = GetFileModTime(FormatText(fragShaderFileName, GLSL_VERSION));
|
||||
long fragShaderFileModTime = GetFileModTime(TextFormat(fragShaderFileName, GLSL_VERSION));
|
||||
|
||||
// Load raymarching shader
|
||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
||||
Shader shader = LoadShader(0, FormatText(fragShaderFileName, GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat(fragShaderFileName, GLSL_VERSION));
|
||||
|
||||
// Get shader locations for required uniforms
|
||||
int resolutionLoc = GetShaderLocation(shader, "resolution");
|
||||
@ -68,13 +68,13 @@ int main(void)
|
||||
// Hot shader reloading
|
||||
if (shaderAutoReloading || (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)))
|
||||
{
|
||||
long currentFragShaderModTime = GetFileModTime(FormatText(fragShaderFileName, GLSL_VERSION));
|
||||
long currentFragShaderModTime = GetFileModTime(TextFormat(fragShaderFileName, GLSL_VERSION));
|
||||
|
||||
// Check if shader file has been modified
|
||||
if (currentFragShaderModTime != fragShaderFileModTime)
|
||||
{
|
||||
// Try reloading updated shader
|
||||
Shader updatedShader = LoadShader(0, FormatText(fragShaderFileName, GLSL_VERSION));
|
||||
Shader updatedShader = LoadShader(0, TextFormat(fragShaderFileName, GLSL_VERSION));
|
||||
|
||||
if (updatedShader.id != GetShaderDefault().id) // It was correctly loaded
|
||||
{
|
||||
@ -108,7 +108,7 @@ int main(void)
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, WHITE);
|
||||
EndShaderMode();
|
||||
|
||||
DrawText(FormatText("PRESS [A] to TOGGLE SHADER AUTOLOADING: %s",
|
||||
DrawText(TextFormat("PRESS [A] to TOGGLE SHADER AUTOLOADING: %s",
|
||||
shaderAutoReloading? "AUTO" : "MANUAL"), 10, 10, 10, shaderAutoReloading? RED : BLACK);
|
||||
if (!shaderAutoReloading) DrawText("MOUSE CLICK to SHADER RE-LOADING", 10, 30, 10, BLACK);
|
||||
|
||||
|
@ -46,7 +46,7 @@ int main(void)
|
||||
|
||||
// Load julia set shader
|
||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/julia_set.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/julia_set.fs", GLSL_VERSION));
|
||||
|
||||
// c constant to use in z^2 + c
|
||||
float c[2] = { POINTS_OF_INTEREST[0][0], POINTS_OF_INTEREST[0][1] };
|
||||
|
@ -48,7 +48,7 @@ int main(void)
|
||||
|
||||
// Load shader for model
|
||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION));
|
||||
|
||||
model.materials[0].shader = shader; // Set shader effect to 3d model
|
||||
model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Bind texture to model
|
||||
|
@ -81,7 +81,7 @@ int main(void)
|
||||
// Load shader to be used on some parts drawing
|
||||
// NOTE 1: Using GLSL 330 shader version, on OpenGL ES 2.0 use GLSL 100 shader version
|
||||
// NOTE 2: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/palette_switch.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/palette_switch.fs", GLSL_VERSION));
|
||||
|
||||
// Get variable (uniform) location on the shader to connect with the program
|
||||
// NOTE: If uniform variable could not be found in the shader, function returns -1
|
||||
|
@ -84,18 +84,18 @@ int main(void)
|
||||
Shader shaders[MAX_POSTPRO_SHADERS] = { 0 };
|
||||
|
||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
||||
shaders[FX_GRAYSCALE] = LoadShader(0, FormatText("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION));
|
||||
shaders[FX_POSTERIZATION] = LoadShader(0, FormatText("resources/shaders/glsl%i/posterization.fs", GLSL_VERSION));
|
||||
shaders[FX_DREAM_VISION] = LoadShader(0, FormatText("resources/shaders/glsl%i/dream_vision.fs", GLSL_VERSION));
|
||||
shaders[FX_PIXELIZER] = LoadShader(0, FormatText("resources/shaders/glsl%i/pixelizer.fs", GLSL_VERSION));
|
||||
shaders[FX_CROSS_HATCHING] = LoadShader(0, FormatText("resources/shaders/glsl%i/cross_hatching.fs", GLSL_VERSION));
|
||||
shaders[FX_CROSS_STITCHING] = LoadShader(0, FormatText("resources/shaders/glsl%i/cross_stitching.fs", GLSL_VERSION));
|
||||
shaders[FX_PREDATOR_VIEW] = LoadShader(0, FormatText("resources/shaders/glsl%i/predator.fs", GLSL_VERSION));
|
||||
shaders[FX_SCANLINES] = LoadShader(0, FormatText("resources/shaders/glsl%i/scanlines.fs", GLSL_VERSION));
|
||||
shaders[FX_FISHEYE] = LoadShader(0, FormatText("resources/shaders/glsl%i/fisheye.fs", GLSL_VERSION));
|
||||
shaders[FX_SOBEL] = LoadShader(0, FormatText("resources/shaders/glsl%i/sobel.fs", GLSL_VERSION));
|
||||
shaders[FX_BLOOM] = LoadShader(0, FormatText("resources/shaders/glsl%i/bloom.fs", GLSL_VERSION));
|
||||
shaders[FX_BLUR] = LoadShader(0, FormatText("resources/shaders/glsl%i/blur.fs", GLSL_VERSION));
|
||||
shaders[FX_GRAYSCALE] = LoadShader(0, TextFormat("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION));
|
||||
shaders[FX_POSTERIZATION] = LoadShader(0, TextFormat("resources/shaders/glsl%i/posterization.fs", GLSL_VERSION));
|
||||
shaders[FX_DREAM_VISION] = LoadShader(0, TextFormat("resources/shaders/glsl%i/dream_vision.fs", GLSL_VERSION));
|
||||
shaders[FX_PIXELIZER] = LoadShader(0, TextFormat("resources/shaders/glsl%i/pixelizer.fs", GLSL_VERSION));
|
||||
shaders[FX_CROSS_HATCHING] = LoadShader(0, TextFormat("resources/shaders/glsl%i/cross_hatching.fs", GLSL_VERSION));
|
||||
shaders[FX_CROSS_STITCHING] = LoadShader(0, TextFormat("resources/shaders/glsl%i/cross_stitching.fs", GLSL_VERSION));
|
||||
shaders[FX_PREDATOR_VIEW] = LoadShader(0, TextFormat("resources/shaders/glsl%i/predator.fs", GLSL_VERSION));
|
||||
shaders[FX_SCANLINES] = LoadShader(0, TextFormat("resources/shaders/glsl%i/scanlines.fs", GLSL_VERSION));
|
||||
shaders[FX_FISHEYE] = LoadShader(0, TextFormat("resources/shaders/glsl%i/fisheye.fs", GLSL_VERSION));
|
||||
shaders[FX_SOBEL] = LoadShader(0, TextFormat("resources/shaders/glsl%i/sobel.fs", GLSL_VERSION));
|
||||
shaders[FX_BLOOM] = LoadShader(0, TextFormat("resources/shaders/glsl%i/bloom.fs", GLSL_VERSION));
|
||||
shaders[FX_BLUR] = LoadShader(0, TextFormat("resources/shaders/glsl%i/blur.fs", GLSL_VERSION));
|
||||
|
||||
int currentShader = FX_GRAYSCALE;
|
||||
|
||||
|
@ -40,7 +40,7 @@ int main(void)
|
||||
|
||||
// Load raymarching shader
|
||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/raymarching.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/raymarching.fs", GLSL_VERSION));
|
||||
|
||||
// Get shader locations for required uniforms
|
||||
int viewEyeLoc = GetShaderLocation(shader, "viewEye");
|
||||
|
@ -38,7 +38,7 @@ int main(void)
|
||||
// Load shader to be used on some parts drawing
|
||||
// NOTE 1: Using GLSL 330 shader version, on OpenGL ES 2.0 use GLSL 100 shader version
|
||||
// NOTE 2: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION));
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
@ -56,7 +56,7 @@ int main(void)
|
||||
Model model3 = LoadModelFromMesh(sphere);
|
||||
|
||||
// Load the shader
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/mask.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/mask.fs", GLSL_VERSION));
|
||||
|
||||
// Load and apply the diffuse texture (colour map)
|
||||
Texture texDiffuse = LoadTexture("resources/plasma.png");
|
||||
@ -118,8 +118,8 @@ int main(void)
|
||||
|
||||
EndMode3D();
|
||||
|
||||
DrawRectangle(16, 698, MeasureText(FormatText("Frame: %i", framesCounter), 20) + 8, 42, BLUE);
|
||||
DrawText(FormatText("Frame: %i", framesCounter), 20, 700, 20, WHITE);
|
||||
DrawRectangle(16, 698, MeasureText(TextFormat("Frame: %i", framesCounter), 20) + 8, 42, BLUE);
|
||||
DrawText(TextFormat("Frame: %i", framesCounter), 20, 700, 20, WHITE);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -93,7 +93,7 @@ int main(void)
|
||||
|
||||
|
||||
// Use default vert shader
|
||||
Shader spotShader = LoadShader(0, FormatText("resources/shaders/glsl%i/spotlight.fs", GLSL_VERSION));
|
||||
Shader spotShader = LoadShader(0, TextFormat("resources/shaders/glsl%i/spotlight.fs", GLSL_VERSION));
|
||||
|
||||
// Get the locations of spots in the shader
|
||||
Spot spots[MAXSPOT];
|
||||
|
@ -35,7 +35,7 @@ int main(void)
|
||||
UnloadImage(imBlank);
|
||||
|
||||
// NOTE: Using GLSL 330 shader version, on OpenGL ES 2.0 use GLSL 100 shader version
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/cubes_panning.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/cubes_panning.fs", GLSL_VERSION));
|
||||
|
||||
float time = 0.0f;
|
||||
int timeLoc = GetShaderLocation(shader, "uTime");
|
||||
|
@ -39,7 +39,7 @@ int main(void)
|
||||
Texture2D texture = LoadTexture("resources/space.png");
|
||||
|
||||
// Load shader and setup location points and values
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/wave.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/wave.fs", GLSL_VERSION));
|
||||
|
||||
int secondsLoc = GetShaderLocation(shader, "secondes");
|
||||
int freqXLoc = GetShaderLocation(shader, "freqX");
|
||||
|
@ -90,7 +90,7 @@ int main(void)
|
||||
DrawText("COLLISION!", GetScreenWidth()/2 - MeasureText("COLLISION!", 20)/2, screenUpperLimit/2 - 10, 20, BLACK);
|
||||
|
||||
// Draw collision area
|
||||
DrawText(FormatText("Collision Area: %i", (int)boxCollision.width*(int)boxCollision.height), GetScreenWidth()/2 - 100, screenUpperLimit + 10, 20, BLACK);
|
||||
DrawText(TextFormat("Collision Area: %i", (int)boxCollision.width*(int)boxCollision.height), GetScreenWidth()/2 - 100, screenUpperLimit + 10, 20, BLACK);
|
||||
}
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
@ -64,7 +64,7 @@ int main(void)
|
||||
segments = GuiSliderBar((Rectangle){ 600, 170, 120, 20}, "Segments", segments, 0, 100, true);
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
DrawText(FormatText("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 200, 10, (segments >= 4)? MAROON : DARKGRAY);
|
||||
DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 200, 10, (segments >= 4)? MAROON : DARKGRAY);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -72,7 +72,7 @@ int main(void)
|
||||
drawRect = GuiCheckBox((Rectangle){ 640, 380, 20, 20}, "DrawRect", drawRect);
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
DrawText(FormatText("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 640, 280, 10, (segments >= 4)? MAROON : DARKGRAY);
|
||||
DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 640, 280, 10, (segments >= 4)? MAROON : DARKGRAY);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -77,7 +77,7 @@ int main(void)
|
||||
drawCircleLines = GuiCheckBox((Rectangle){ 600, 380, 20, 20 }, "Draw CircleLines", drawCircleLines);
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
DrawText(FormatText("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 270, 10, (segments >= 4)? MAROON : DARKGRAY);
|
||||
DrawText(TextFormat("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 270, 10, (segments >= 4)? MAROON : DARKGRAY);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -109,8 +109,8 @@ int main(void)
|
||||
//DrawRectangleLines(fontPosition.x, fontPosition.y, textSize.x, textSize.y, RED);
|
||||
|
||||
DrawRectangle(0, screenHeight - 80, screenWidth, 80, LIGHTGRAY);
|
||||
DrawText(FormatText("Font size: %02.02f", fontSize), 20, screenHeight - 50, 10, DARKGRAY);
|
||||
DrawText(FormatText("Text size: [%02.02f, %02.02f]", textSize.x, textSize.y), 20, screenHeight - 30, 10, DARKGRAY);
|
||||
DrawText(TextFormat("Font size: %02.02f", fontSize), 20, screenHeight - 50, 10, DARKGRAY);
|
||||
DrawText(TextFormat("Text size: [%02.02f, %02.02f]", textSize.x, textSize.y), 20, screenHeight - 30, 10, DARKGRAY);
|
||||
DrawText("CURRENT TEXTURE FILTER:", 250, 400, 20, GRAY);
|
||||
|
||||
if (currentFontFilter == 0) DrawText("POINT", 570, 400, 20, BLACK);
|
||||
|
@ -55,7 +55,7 @@ int main(void)
|
||||
UnloadImage(atlas);
|
||||
|
||||
// Load SDF required shader (we use default vertex shader)
|
||||
Shader shader = LoadShader(0, FormatText("resources/shaders/glsl%i/sdf.fs", GLSL_VERSION));
|
||||
Shader shader = LoadShader(0, TextFormat("resources/shaders/glsl%i/sdf.fs", GLSL_VERSION));
|
||||
SetTextureFilter(fontSDF.texture, FILTER_BILINEAR); // Required for SDF font
|
||||
|
||||
Vector2 fontPosition = { 40, screenHeight/2 - 50 };
|
||||
@ -110,7 +110,7 @@ int main(void)
|
||||
else DrawText("default font", 315, 40, 30, GRAY);
|
||||
|
||||
DrawText("FONT SIZE: 16.0", GetScreenWidth() - 240, 20, 20, DARKGRAY);
|
||||
DrawText(FormatText("RENDER SIZE: %02.02f", fontSize), GetScreenWidth() - 240, 50, 20, DARKGRAY);
|
||||
DrawText(TextFormat("RENDER SIZE: %02.02f", fontSize), GetScreenWidth() - 240, 50, 20, DARKGRAY);
|
||||
DrawText("Use MOUSE WHEEL to SCALE TEXT!", GetScreenWidth() - 240, 90, 10, DARKGRAY);
|
||||
|
||||
DrawText("HOLD SPACE to USE SDF FONT VERSION!", 340, GetScreenHeight() - 30, 20, MAROON);
|
||||
|
@ -41,13 +41,13 @@ int main(void)
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawText(FormatText("Score: %08i", score), 200, 80, 20, RED);
|
||||
DrawText(TextFormat("Score: %08i", score), 200, 80, 20, RED);
|
||||
|
||||
DrawText(FormatText("HiScore: %08i", hiscore), 200, 120, 20, GREEN);
|
||||
DrawText(TextFormat("HiScore: %08i", hiscore), 200, 120, 20, GREEN);
|
||||
|
||||
DrawText(FormatText("Lives: %02i", lives), 200, 160, 40, BLUE);
|
||||
DrawText(TextFormat("Lives: %02i", lives), 200, 160, 40, BLUE);
|
||||
|
||||
DrawText(FormatText("Elapsed Time: %02.02f ms", GetFrameTime()*1000), 200, 220, 20, BLACK);
|
||||
DrawText(TextFormat("Elapsed Time: %02.02f ms", GetFrameTime()*1000), 200, 220, 20, BLACK);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -86,7 +86,7 @@ int main(void)
|
||||
|
||||
DrawText(name, textBox.x + 5, textBox.y + 8, 40, MAROON);
|
||||
|
||||
DrawText(FormatText("INPUT CHARS: %i/%i", letterCount, MAX_INPUT_CHARS), 315, 250, 20, DARKGRAY);
|
||||
DrawText(TextFormat("INPUT CHARS: %i/%i", letterCount, MAX_INPUT_CHARS), 315, 250, 20, DARKGRAY);
|
||||
|
||||
if (mouseOnText)
|
||||
{
|
||||
|
@ -98,8 +98,8 @@ int main(void)
|
||||
}
|
||||
|
||||
DrawRectangle(0, 0, screenWidth, 40, BLACK);
|
||||
DrawText(FormatText("bunnies: %i", bunniesCount), 120, 10, 20, GREEN);
|
||||
DrawText(FormatText("batched draw calls: %i", 1 + bunniesCount/MAX_BATCH_ELEMENTS), 320, 10, 20, MAROON);
|
||||
DrawText(TextFormat("bunnies: %i", bunniesCount), 120, 10, 20, GREEN);
|
||||
DrawText(TextFormat("batched draw calls: %i", 1 + bunniesCount/MAX_BATCH_ELEMENTS), 320, 10, 20, MAROON);
|
||||
|
||||
DrawFPS(10, 10);
|
||||
|
||||
|
@ -71,7 +71,7 @@ int main(void)
|
||||
DrawRectangleLines(15 + frameRec.x, 40 + frameRec.y, frameRec.width, frameRec.height, RED);
|
||||
|
||||
DrawText("FRAME SPEED: ", 165, 210, 10, DARKGRAY);
|
||||
DrawText(FormatText("%02i FPS", framesSpeed), 575, 210, 10, DARKGRAY);
|
||||
DrawText(TextFormat("%02i FPS", framesSpeed), 575, 210, 10, DARKGRAY);
|
||||
DrawText("PRESS RIGHT/LEFT KEYS to CHANGE SPEED!", 290, 240, 10, DARKGRAY);
|
||||
|
||||
for (int i = 0; i < MAX_FRAME_SPEED; i++)
|
||||
|
@ -4494,7 +4494,7 @@ static void ProcessKeyboard(void)
|
||||
// Check screen capture key (raylib key: KEY_F12)
|
||||
if (CORE.Input.Keyboard.currentKeyState[301] == 1)
|
||||
{
|
||||
TakeScreenshot(FormatText("screenshot%03i.png", screenshotCounter));
|
||||
TakeScreenshot(TextFormat("screenshot%03i.png", screenshotCounter));
|
||||
screenshotCounter++;
|
||||
}
|
||||
#endif
|
||||
@ -4898,7 +4898,7 @@ static void *EventThread(void *arg)
|
||||
// Check screen capture key (raylib key: KEY_F12)
|
||||
if (CORE.Input.Keyboard.currentKeyState[301] == 1)
|
||||
{
|
||||
TakeScreenshot(FormatText("screenshot%03i.png", screenshotCounter));
|
||||
TakeScreenshot(TextFormat("screenshot%03i.png", screenshotCounter));
|
||||
screenshotCounter++;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user