diff options
| author | arngo <[email protected]> | 2024-05-16 21:00:51 -0400 |
|---|---|---|
| committer | arngo <[email protected]> | 2024-05-16 21:00:51 -0400 |
| commit | 0e1c3d42a93f623f60284f7e9acfd014e41ddadc (patch) | |
| tree | 701cd9cef7e0e7210dba9ac77e2bad9a87b8c5e9 /src/main.c | |
| parent | 21ab7c1df0b8a0fcbb1d10ed2e61410d7f7021e0 (diff) | |
| download | tojam2024-0e1c3d42a93f623f60284f7e9acfd014e41ddadc.tar.gz tojam2024-0e1c3d42a93f623f60284f7e9acfd014e41ddadc.zip | |
loading and draw textures for skyboxtextures
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -65,6 +65,15 @@ World world = { } }; +char *sprite_paths[] = +{ + "rom:/1_32px.sprite", + "rom:/2_32px.sprite", + "rom:/3_32px.sprite", + "rom:/4_32px.sprite", + "rom:/5_32px.sprite", + "rom:/6_32px.sprite", +}; int main(void) { @@ -86,8 +95,28 @@ int main(void) camera2.fovy = 35.0f; camera2.projection = CAMERA_PERSPECTIVE; + Camera camerax = { 0 }; + camerax.position = (Vector3){ 0.0f, 0.0f, 15.0f }; + camerax.target = (Vector3){ 0.0f, 0.0f, 0.0f }; + camerax.up = (Vector3){ 0.0f, 1.0f, 0.0f }; + camerax.fovy = 45.0f; + camerax.projection = CAMERA_PERSPECTIVE; + + sprite_t *sprites[6]; + GLuint textures[6]; + glGenTextures(6, textures); + for (int i = 0; i < 6; i++) + { + textures[i] = customLoadTextureN64(sprite_paths[i]); + } + SetTargetFPS(60); + GLuint dl_skybox = glGenLists(1); + glNewList(dl_skybox, GL_COMPILE); + renderSkybox(textures, 2, 3, camera); + glEndList(); + while (!WindowShouldClose()) { updateController(); @@ -138,6 +167,9 @@ int main(void) BeginDrawing(); ClearBackground(BLACK); + BeginMode3D(camerax); + glCallList(dl_skybox); + EndMode3D(); BeginScissorMode(0, 0, 320/2, 240); rlViewport(0, 0, 320/2, 240); renderWorld(&world, camera); |
