Oh yeah, it's all coming together
This commit is contained in:
@@ -7,45 +7,34 @@
|
||||
|
||||
#include "game.h"
|
||||
|
||||
|
||||
|
||||
bool sandboxGameInit(sandboxgame_t *game) {
|
||||
xmlnode_t node;
|
||||
char *string = "<xml attribute=\"value\" something=\"else\"><child>Hello World</child></xml>";
|
||||
|
||||
char bufferTest[64];
|
||||
|
||||
xmlParseElement(&node, string;
|
||||
xmlGetAttributeValue(&node, xmlGetAttributeByName(&node, "something"), bufferTest);
|
||||
|
||||
char *start = xmlFindChildNode(&node);
|
||||
|
||||
quadInit(&game->quad, 0, 0,0,0,0, 500,500,1,1);
|
||||
|
||||
assetManagerInit(&game->manager);
|
||||
assetManagerLoadFont(&game->manager, &game->font,
|
||||
"fonts/opensans/OpenSans-Regular.ttf"
|
||||
);
|
||||
assetManagerShaderLoad(&game->manager, &game->shader,
|
||||
assetManagerLoadShader(&game->manager, &game->shader,
|
||||
"shaders/textured.vert",
|
||||
"shaders/textured.frag"
|
||||
);
|
||||
assetManagerLoadScaledTexture(&game->manager, &game->st,
|
||||
"poker/characters/penny", "sprite"
|
||||
);
|
||||
assetManagerLoadTextureScale(&game->manager, &game->st, &game->texture, 0);
|
||||
|
||||
assetManagerStart(&game->manager);
|
||||
|
||||
pixel_t *data = (pixel_t *)assetRawLoad("out/test.texture");
|
||||
textureInit(&game->texture, 4360/2, 1920/2, (pixel_t *)data);
|
||||
free(data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void sandboxGameUpdate(sandboxgame_t *game) {
|
||||
camera_t camera;
|
||||
float n = assetManagerProgressGet(&game->manager);
|
||||
printf("Loading %.2f\n", n);
|
||||
|
||||
if(n < 1.0f) {
|
||||
assetManagerUpdate(&game->manager);
|
||||
printf("Loading %.2f\n", n);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -12,12 +12,13 @@
|
||||
#include "../../display/shader.h"
|
||||
#include "../../display/primitive.h"
|
||||
#include "../../display/primitives/quad.h"
|
||||
#include "../../display/scaledtexture.h"
|
||||
#include "../../file/asset.h"
|
||||
#include "../../ui/label.h"
|
||||
#include "../../ui/breakpoint.h"
|
||||
#include "../../file/assetmanager.h"
|
||||
|
||||
#include "../../file/xml2.h"
|
||||
#include "../../file/xml.h"
|
||||
|
||||
typedef struct {
|
||||
engine_t engine;
|
||||
@@ -26,6 +27,8 @@ typedef struct {
|
||||
texture_t texture;
|
||||
primitive_t quad;
|
||||
assetmanager_t manager;
|
||||
|
||||
scaledtexture_t st;
|
||||
} sandboxgame_t;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user