Testing textures and shaders in scripting.

This commit is contained in:
2021-09-25 18:35:47 -07:00
parent 0792304c66
commit 4bf7d14416
7 changed files with 52 additions and 42 deletions

View File

@ -8,12 +8,6 @@
#include "sandboxscene.h"
bool sandboxSceneInit(sandboxscene_t *game) {
assetFontLoad(&game->font, "fonts/opensans/OpenSans-Regular.ttf");
assetTextureLoad(&game->texture, "test_texture.png");
assetShaderLoad(&game->shader,
"shaders/textured.vert", "shaders/textured.frag"
);
// Init Scripter
scripterInit(&game->scripter, &game->engine);
game->scripter.user = game;
@ -21,30 +15,16 @@ bool sandboxSceneInit(sandboxscene_t *game) {
scriptsApiIo(&game->scripter);
scriptsApiDisplay(&game->scripter);
scriptsApiAsset(&game->scripter);
assetScripterAppend(&game->scripter, "scripts/main.js");
scripterInvokeMethodSimple(&game->scripter, "init");
return true;
}
void sandboxSceneUpdate(sandboxscene_t *game) {
// cameraLookAt(&game->camera, 3,3,3, 0,0,0);
// cameraPerspective(&game->camera, 45,
// game->engine.render.width/game->engine.render.height,
// 0.01f, 1000.0f
// );
// cameraLookAt(&game->camera,
// 3, 3, 3,
// 0, 0, 0
// );
// shaderUse(&game->shader);
// shaderUseCamera(&game->shader, &game->camera);
// shaderUsePosition(&game->shader, 0,0,0, 0,0,0);
// shaderUseTexture(&game->shader, &game->texture);
scripterInvokeMethodSimple(&game->scripter, "update");
}

View File

@ -32,13 +32,6 @@
typedef struct {
engine_t engine;
camera_t camera;
primitive_t primitive;
texture_t texture;
shader_t shader;
font_t font;
scripter_t scripter;
} sandboxscene_t;