changed Color struct to 4 floats
GetRandomValue returns floats added GetRandomInt added Color4ub rgba 0-255 edited examples to work colour palette values could bare a double check!
This commit is contained in:
parent
ea70c47a1a
commit
b4d8f0b5d1
3 changed files with 475 additions and 359 deletions
|
|
@ -179,9 +179,8 @@ void UpdateLightValues(Shader shader, Light light)
|
|||
SetShaderValue(shader, light.targetLoc, target, UNIFORM_VEC3);
|
||||
|
||||
// Send to shader light color values
|
||||
float color[4] = { (float)light.color.r/(float)255, (float)light.color.g/(float)255,
|
||||
(float)light.color.b/(float)255, (float)light.color.a/(float)255 };
|
||||
float color[4] = { light.color.r, light.color.g, light.color.b, light.color.a };
|
||||
SetShaderValue(shader, light.colorLoc, color, UNIFORM_VEC4);
|
||||
}
|
||||
|
||||
#endif // RLIGHTS_IMPLEMENTATION
|
||||
#endif // RLIGHTS_IMPLEMENTATION
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ int main(void)
|
|||
|
||||
EndMode3D();
|
||||
|
||||
DrawText(TextFormat("Use KEY_UP/KEY_DOWN to change fog density [%.2f]", fogDensity), 10, 10, 20, RAYWHITE);
|
||||
DrawText(TextFormat("Use KEY_UP/KEY_DOWN to change fog density [%.2f]", fogDensity), 10, 10, 20, BLACK);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ int main(void)
|
|||
{
|
||||
// Draw horizontal screen-wide rectangles with increasing "palette index"
|
||||
// The used palette index is encoded in the RGB components of the pixel
|
||||
DrawRectangle(0, lineHeight*i, GetScreenWidth(), lineHeight, (Color){ i, i, i, 255 });
|
||||
DrawRectangle(0, lineHeight*i, GetScreenWidth(), lineHeight, (Color){ (float)i/255, 0, 0, 1 });
|
||||
}
|
||||
|
||||
EndShaderMode();
|
||||
|
|
|
|||
Loading…
Reference in a new issue