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
36 changed files with 73 additions and 73 deletions
|
|
@ -51,7 +51,7 @@ int main(void)
|
||||||
DrawText("Press SPACE to play new ogg instance!", 200, 120, 20, LIGHTGRAY);
|
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("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();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ int main(void)
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
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);
|
DrawText("click mouse button to change frequency", 10, 10, 20, DARKGRAY);
|
||||||
|
|
||||||
// Draw the current buffer state proportionate to the screen
|
// Draw the current buffer state proportionate to the screen
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ int main(void)
|
||||||
|
|
||||||
if (IsGamepadAvailable(GAMEPAD_PLAYER1))
|
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))
|
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(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);
|
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(TextFormat("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 RT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_AXIS_RIGHT_TRIGGER)), 10, 60, 10, BLACK);
|
||||||
}
|
}
|
||||||
else if (IsGamepadName(GAMEPAD_PLAYER1, PS3_NAME_ID))
|
else if (IsGamepadName(GAMEPAD_PLAYER1, PS3_NAME_ID))
|
||||||
{
|
{
|
||||||
|
|
@ -161,14 +161,14 @@ int main(void)
|
||||||
// TODO: Draw generic gamepad
|
// 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++)
|
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 DrawText("DETECTED BUTTON: NONE", 10, 430, 10, GRAY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ int main(void)
|
||||||
DrawRectangle(screenWidth/2 - 40, boxPositionY, 80, 80, MAROON);
|
DrawRectangle(screenWidth/2 - 40, boxPositionY, 80, 80, MAROON);
|
||||||
|
|
||||||
DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, GRAY);
|
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();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ int main(void)
|
||||||
{
|
{
|
||||||
// Draw circle and touch index number
|
// Draw circle and touch index number
|
||||||
DrawCircleV(touchPosition, 34, ORANGE);
|
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("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();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,10 @@ int main(void)
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
DrawText(FormatText("SCORE: %i", score), 280, 130, 40, MAROON);
|
DrawText(TextFormat("SCORE: %i", score), 280, 130, 40, MAROON);
|
||||||
DrawText(FormatText("HI-SCORE: %i", hiscore), 210, 200, 50, BLACK);
|
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 R to generate random numbers", 220, 40, 20, LIGHTGRAY);
|
||||||
DrawText("Press ENTER to SAVE values", 250, 310, 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
|
hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3
|
||||||
|
|
||||||
// Distortion shader (uses device lens distortion and chroma)
|
// 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
|
SetVrConfiguration(hmd, distortion); // Set Vr device parameters for stereo rendering
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,25 +160,25 @@ int main(void)
|
||||||
EndMode3D();
|
EndMode3D();
|
||||||
|
|
||||||
// Draw some debug GUI text
|
// 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)
|
if (nearestHit.hit)
|
||||||
{
|
{
|
||||||
int ypos = 70;
|
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.x,
|
||||||
nearestHit.position.y,
|
nearestHit.position.y,
|
||||||
nearestHit.position.z), 10, ypos + 15, 10, BLACK);
|
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.x,
|
||||||
nearestHit.normal.y,
|
nearestHit.normal.y,
|
||||||
nearestHit.normal.z), 10, ypos + 30, 10, BLACK);
|
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);
|
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);
|
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);
|
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;
|
modelB.materials[0].maps[MAP_DIFFUSE].texture = texture;
|
||||||
modelC.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),
|
Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION),
|
||||||
FormatText("resources/shaders/glsl%i/lighting.fs", GLSL_VERSION));
|
TextFormat("resources/shaders/glsl%i/lighting.fs", GLSL_VERSION));
|
||||||
|
|
||||||
// Get some shader loactions
|
// Get some shader loactions
|
||||||
shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel");
|
shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel");
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ int main(void)
|
||||||
|
|
||||||
// Load postprocessing shader
|
// Load postprocessing shader
|
||||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex 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
|
// 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
|
// NOTE: If uniform variable could not be found in the shader, function returns -1
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ int main(void)
|
||||||
|
|
||||||
// Load Eratosthenes shader
|
// Load Eratosthenes shader
|
||||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex 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
|
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;
|
modelC.materials[0].maps[MAP_DIFFUSE].texture = texture;
|
||||||
|
|
||||||
// Load shader and set up some uniforms
|
// Load shader and set up some uniforms
|
||||||
Shader shader = LoadShader(FormatText("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION),
|
Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/base_lighting.vs", GLSL_VERSION),
|
||||||
FormatText("resources/shaders/glsl%i/fog.fs", GLSL_VERSION));
|
TextFormat("resources/shaders/glsl%i/fog.fs", GLSL_VERSION));
|
||||||
shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel");
|
shader.locs[LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel");
|
||||||
shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos");
|
shader.locs[LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,11 @@ int main(void)
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - hot reloading");
|
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - hot reloading");
|
||||||
|
|
||||||
const char *fragShaderFileName = "resources/shaders/glsl%i/reload.fs";
|
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
|
// Load raymarching shader
|
||||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex 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
|
// Get shader locations for required uniforms
|
||||||
int resolutionLoc = GetShaderLocation(shader, "resolution");
|
int resolutionLoc = GetShaderLocation(shader, "resolution");
|
||||||
|
|
@ -68,13 +68,13 @@ int main(void)
|
||||||
// Hot shader reloading
|
// Hot shader reloading
|
||||||
if (shaderAutoReloading || (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)))
|
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
|
// Check if shader file has been modified
|
||||||
if (currentFragShaderModTime != fragShaderFileModTime)
|
if (currentFragShaderModTime != fragShaderFileModTime)
|
||||||
{
|
{
|
||||||
// Try reloading updated shader
|
// 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
|
if (updatedShader.id != GetShaderDefault().id) // It was correctly loaded
|
||||||
{
|
{
|
||||||
|
|
@ -108,7 +108,7 @@ int main(void)
|
||||||
DrawRectangle(0, 0, screenWidth, screenHeight, WHITE);
|
DrawRectangle(0, 0, screenWidth, screenHeight, WHITE);
|
||||||
EndShaderMode();
|
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);
|
shaderAutoReloading? "AUTO" : "MANUAL"), 10, 10, 10, shaderAutoReloading? RED : BLACK);
|
||||||
if (!shaderAutoReloading) DrawText("MOUSE CLICK to SHADER RE-LOADING", 10, 30, 10, 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
|
// Load julia set shader
|
||||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex 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
|
// c constant to use in z^2 + c
|
||||||
float c[2] = { POINTS_OF_INTEREST[0][0], POINTS_OF_INTEREST[0][1] };
|
float c[2] = { POINTS_OF_INTEREST[0][0], POINTS_OF_INTEREST[0][1] };
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ int main(void)
|
||||||
|
|
||||||
// Load shader for model
|
// Load shader for model
|
||||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
// 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].shader = shader; // Set shader effect to 3d model
|
||||||
model.materials[0].maps[MAP_DIFFUSE].texture = texture; // Bind texture to 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
|
// 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 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
|
// 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
|
// 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
|
// 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 };
|
Shader shaders[MAX_POSTPRO_SHADERS] = { 0 };
|
||||||
|
|
||||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader
|
// 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_GRAYSCALE] = LoadShader(0, TextFormat("resources/shaders/glsl%i/grayscale.fs", GLSL_VERSION));
|
||||||
shaders[FX_POSTERIZATION] = LoadShader(0, FormatText("resources/shaders/glsl%i/posterization.fs", GLSL_VERSION));
|
shaders[FX_POSTERIZATION] = LoadShader(0, TextFormat("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_DREAM_VISION] = LoadShader(0, TextFormat("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_PIXELIZER] = LoadShader(0, TextFormat("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_HATCHING] = LoadShader(0, TextFormat("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_CROSS_STITCHING] = LoadShader(0, TextFormat("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_PREDATOR_VIEW] = LoadShader(0, TextFormat("resources/shaders/glsl%i/predator.fs", GLSL_VERSION));
|
||||||
shaders[FX_SCANLINES] = LoadShader(0, FormatText("resources/shaders/glsl%i/scanlines.fs", GLSL_VERSION));
|
shaders[FX_SCANLINES] = LoadShader(0, TextFormat("resources/shaders/glsl%i/scanlines.fs", GLSL_VERSION));
|
||||||
shaders[FX_FISHEYE] = LoadShader(0, FormatText("resources/shaders/glsl%i/fisheye.fs", GLSL_VERSION));
|
shaders[FX_FISHEYE] = LoadShader(0, TextFormat("resources/shaders/glsl%i/fisheye.fs", GLSL_VERSION));
|
||||||
shaders[FX_SOBEL] = LoadShader(0, FormatText("resources/shaders/glsl%i/sobel.fs", GLSL_VERSION));
|
shaders[FX_SOBEL] = LoadShader(0, TextFormat("resources/shaders/glsl%i/sobel.fs", GLSL_VERSION));
|
||||||
shaders[FX_BLOOM] = LoadShader(0, FormatText("resources/shaders/glsl%i/bloom.fs", GLSL_VERSION));
|
shaders[FX_BLOOM] = LoadShader(0, TextFormat("resources/shaders/glsl%i/bloom.fs", GLSL_VERSION));
|
||||||
shaders[FX_BLUR] = LoadShader(0, FormatText("resources/shaders/glsl%i/blur.fs", GLSL_VERSION));
|
shaders[FX_BLUR] = LoadShader(0, TextFormat("resources/shaders/glsl%i/blur.fs", GLSL_VERSION));
|
||||||
|
|
||||||
int currentShader = FX_GRAYSCALE;
|
int currentShader = FX_GRAYSCALE;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ int main(void)
|
||||||
|
|
||||||
// Load raymarching shader
|
// Load raymarching shader
|
||||||
// NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex 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
|
// Get shader locations for required uniforms
|
||||||
int viewEyeLoc = GetShaderLocation(shader, "viewEye");
|
int viewEyeLoc = GetShaderLocation(shader, "viewEye");
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue