Dawn/src/test/testscene.c

56 lines
1.6 KiB
C

/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "testscene.h"
void testSceneInit(testscene_t *scene, game_t *game) {
vnconversationtext_t *text;
assetFontLoad(&scene->font, "fonts/opensans/OpenSans-Bold.ttf");
assetShaderLoad(&scene->shader,
"shaders/textured.vert", "shaders/textured.frag"
);
assetTextureLoad(&scene->pennyEyes, "characters/penny/textures/eyes.png");
assetTextureLoad(&scene->pennyBody, "characters/penny/textures/body.png");
assetTextureLoad(&scene->pennyFace, "characters/penny/textures/face.png");
assetTextureLoad(&scene->pennyMouth, "characters/penny/textures/mouth.png");
characterInit(&scene->character,
&scene->pennyEyes,
&scene->pennyBody,
&scene->pennyMouth,
&scene->pennyFace
);
}
void testSceneRender(testscene_t *scene, game_t *game) {
if(false) {
cameraLookAt(&scene->camera,
300, 300, 300,
0, 0, 0
);
cameraPerspective(&scene->camera, 75,
game->engine.render.width/game->engine.render.height, 0.01, 1000.0
);
} else {
cameraLookAt(&scene->camera,
0, 0, 10,
0, 0, 0
);
cameraOrtho(&scene->camera,
0, game->engine.render.width,
game->engine.render.height, 0,
0.01, 1000.0
);
}
shaderUse(&scene->shader);
shaderUseCamera(&scene->shader, &scene->camera);
vnCharacterRender(&scene->character, &scene->shader);
// conversationUpdate(&scene->conv, &game->engine);
// conversationRender(&scene->conv, &scene->shader);
}