Fixed loading example.
This commit is contained in:
@ -9,14 +9,15 @@
|
||||
|
||||
|
||||
bool sandboxGameInit(sandboxgame_t *game) {
|
||||
// assetTextureLoad(&game->texture, "textures/test_texture.png");
|
||||
quadInit(&game->quad, 0, 0,0,0,0, 500,500,1,1);
|
||||
|
||||
game->texture.width = -1;
|
||||
assetManagerInit(&game->manager);
|
||||
|
||||
assetManagerLoadTexture(&game->manager, &game->texture, "textures/test_texture.png");
|
||||
assetManagerLoadFont(&game->manager, &game->font, "fonts/opensans/OpenSans-Regular.ttf");
|
||||
assetManagerLoadTexture(&game->manager, &game->texture,
|
||||
"textures/test_texture.png"
|
||||
);
|
||||
assetManagerLoadFont(&game->manager, &game->font,
|
||||
"fonts/opensans/OpenSans-Regular.ttf"
|
||||
);
|
||||
assetManagerShaderLoad(&game->manager, &game->shader,
|
||||
"shaders/textured.vert",
|
||||
"shaders/textured.frag"
|
||||
@ -45,13 +46,9 @@ void sandboxGameUpdate(sandboxgame_t *game) {
|
||||
|
||||
shaderUse(&game->shader);
|
||||
shaderUseCamera(&game->shader, &camera);
|
||||
|
||||
|
||||
if(game->texture.width != -1) {
|
||||
shaderUseTexture(&game->shader, &game->texture);
|
||||
shaderUsePosition(&game->shader, 0,0,0, 0,0,0);
|
||||
primitiveDraw(&game->quad, 0, -1);
|
||||
}
|
||||
shaderUseTexture(&game->shader, &game->texture);
|
||||
shaderUsePosition(&game->shader, 0,0,0, 0,0,0);
|
||||
primitiveDraw(&game->quad, 0, -1);
|
||||
}
|
||||
|
||||
void sandboxGameDispose(sandboxgame_t *game) {
|
||||
|
@ -21,10 +21,9 @@ typedef struct {
|
||||
engine_t engine;
|
||||
shader_t shader;
|
||||
font_t font;
|
||||
texture_t texture;
|
||||
primitive_t quad;
|
||||
assetmanager_t manager;
|
||||
|
||||
texture_t texture;
|
||||
} sandboxgame_t;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user