Review and recompile web examples
This commit is contained in:
parent
3e082f1d62
commit
881f134f4d
194 changed files with 272938 additions and 52659 deletions
|
@ -25,7 +25,7 @@
|
|||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
Texture2D sonic;
|
||||
Texture2D fudesumi;
|
||||
Texture2D checked;
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -43,9 +43,9 @@ int main()
|
|||
InitWindow(screenWidth, screenHeight, "raylib [textures] example - texture from raw data");
|
||||
|
||||
// Load RAW image data (512x512, 32bit RGBA, no file header)
|
||||
Image sonicRaw = LoadImageRaw("resources/texture_formats/sonic_R8G8B8A8.raw", 512, 512, UNCOMPRESSED_R8G8B8A8, 0);
|
||||
sonic = LoadTextureFromImage(sonicRaw); // Upload CPU (RAM) image to GPU (VRAM)
|
||||
UnloadImage(sonicRaw); // Unload CPU (RAM) image data
|
||||
Image fudesumiRaw = LoadImageRaw("resources/fudesumi.raw", 384, 512, UNCOMPRESSED_R8G8B8A8, 0);
|
||||
fudesumi = LoadTextureFromImage(fudesumiRaw); // Upload CPU (RAM) image to GPU (VRAM)
|
||||
UnloadImage(fudesumiRaw); // Unload CPU (RAM) image data
|
||||
|
||||
// Generate a checked texture by code (1024x1024 pixels)
|
||||
int width = 1024;
|
||||
|
@ -58,8 +58,8 @@ int main()
|
|||
{
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
if (((x/32+y/32)/1)%2 == 0) pixels[y*height + x] = DARKBLUE;
|
||||
else pixels[y*height + x] = SKYBLUE;
|
||||
if (((x/32+y/32)/1)%2 == 0) pixels[y*height + x] = ORANGE;
|
||||
else pixels[y*height + x] = GOLD;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ int main()
|
|||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadTexture(sonic); // Texture unloading
|
||||
UnloadTexture(fudesumi); // Texture unloading
|
||||
UnloadTexture(checked); // Texture unloading
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
|
@ -111,12 +111,14 @@ void UpdateDrawFrame(void)
|
|||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
DrawTexture(checked, screenWidth/2 - checked.width/2, screenHeight/2 - checked.height/2, Fade(WHITE, 0.3f));
|
||||
DrawTexture(sonic, 330, -20, WHITE);
|
||||
DrawTexture(checked, screenWidth/2 - checked.width/2, screenHeight/2 - checked.height/2, WHITE);
|
||||
DrawTexture(fudesumi, 430, -30, WHITE);
|
||||
|
||||
DrawText("CHECKED TEXTURE ", 84, 100, 30, DARKBLUE);
|
||||
DrawText("GENERATED by CODE", 72, 164, 30, DARKBLUE);
|
||||
DrawText("and RAW IMAGE LOADING", 46, 226, 30, DARKBLUE);
|
||||
DrawText("CHECKED TEXTURE ", 84, 100, 30, BROWN);
|
||||
DrawText("GENERATED by CODE", 72, 164, 30, BROWN);
|
||||
DrawText("and RAW IMAGE LOADING", 46, 226, 30, BROWN);
|
||||
|
||||
DrawText("(c) Fudesumi sprite by Eiden Marsal", 310, screenHeight - 20, 10, BROWN);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue