Just committing while I rethink things

This commit is contained in:
2021-11-15 22:13:32 -08:00
parent 20428597b6
commit 41cbe94cbc
3 changed files with 24 additions and 9 deletions

View File

@ -102,11 +102,8 @@ elseif(TARGET_TYPE STREQUAL game)
) )
# World # World
tool_copy(texture_pub tool_texture(texture_pub
poker/world/pub/pub_skywall.png poker/pub_skywall.png ${ASSETS_SOURCE_DIR}/poker/world/pub/pub_skywall.png poker/world/pub
)
tool_copy(texture_cards
poker/cards_normal.png poker/cards.png
) )
tool_assets( tool_assets(
@ -116,7 +113,8 @@ elseif(TARGET_TYPE STREQUAL game)
font_opensans font_opensans
texture_test texture_test
texture_pub
vn_penny vn_penny
vn_lucy vn_lucy
vn_julie vn_julie

View File

@ -35,16 +35,25 @@ void _pokerGameSceneRender(scene_t *scene) {
gameScene = (pokergamescene_t *)scene->user; gameScene = (pokergamescene_t *)scene->user;
pass = sceneUsePass(scene, gameScene->passOnly); pass = sceneUsePass(scene, gameScene->passOnly);
// Camera
cameraPerspective(&camera, 75, cameraPerspective(&camera, 75,
(float)pass->frame.texture.width / (float)pass->frame.texture.height, (float)pass->frame.texture.width / (float)pass->frame.texture.height,
0.01f, 1000.0f 0.01f, 1000.0f
); );
cameraLookAt(&camera, 3,3,3, 0,0,0); cameraLookAt(&camera, 3,3,3, 0,0,0);
shaderUseCamera(pass->shader, shaderUseCamera(pass->shader,
gameScene->uniformsWorld[0], gameScene->uniformsWorld[1], &camera gameScene->uniformsWorld[0], gameScene->uniformsWorld[1], &camera
); );
// Render Skywall
shaderUsePosition(pass->shader, gameScene->uniformsWorld[2], 0,0,0, 0,0,0);
shaderUseTexture(pass->shader, gameScene->uniformsWorld[3],
&gameScene->texturePub->data.scaledTexture.texture
);
primitiveDraw(&gameScene->skywall, 0, -1);
// Render Cube
shaderUsePosition(pass->shader, gameScene->uniformsWorld[2], shaderUsePosition(pass->shader, gameScene->uniformsWorld[2],
0,0,0, scene->engine->time.current,scene->engine->time.current,0 0,0,0, scene->engine->time.current,scene->engine->time.current,0
); );
@ -82,12 +91,17 @@ void pokerGameSceneInit(pokergamescene_t *gameScene, engine_t *engine) {
"textures", "test_texture", 0 "textures", "test_texture", 0
); );
gameScene->texturePub = assetManagerLoadScaledTexture(
&engine->assetManager, gameScene->scene.assetOwner,
"poker/world", "pub", 0
);
// Cube // Cube
cubeInit(&gameScene->cube, 1, 1, 1); cubeInit(&gameScene->cube, 1, 1, 1);
skywallInit(&gameScene->skywall);
} }
void pokerGameSceneUpdate(pokergamescene_t *gameScene) { void pokerGameSceneUpdate(pokergamescene_t *gameScene) {
int i = 3;
sceneUpdateToBackbuffer(&gameScene->scene, sceneUpdateToBackbuffer(&gameScene->scene,
&gameScene->shaderList->data.shader.shader, gameScene->uniformsList, &gameScene->shaderList->data.shader.shader, gameScene->uniformsList,
&gameScene->shaderWorld->data.shader.shader, gameScene->uniformsWorld &gameScene->shaderWorld->data.shader.shader, gameScene->uniformsWorld

View File

@ -10,6 +10,7 @@
#include "../../../scene/scene.h" #include "../../../scene/scene.h"
#include "../../../display/primitive/primitive.h" #include "../../../display/primitive/primitive.h"
#include "../../../display/primitive/cube.h" #include "../../../display/primitive/cube.h"
#include "../../../display/primitive/skywall.h"
#include "../../../file/assetmanager.h" #include "../../../file/assetmanager.h"
typedef struct { typedef struct {
@ -26,8 +27,10 @@ typedef struct {
shaderuniform_t uniformsList[4]; shaderuniform_t uniformsList[4];
assetmanageritem_t *textureTest; assetmanageritem_t *textureTest;
assetmanageritem_t *texturePub;
primitive_t cube; primitive_t cube;
primitive_t skywall;
} pokergamescene_t; } pokergamescene_t;
void pokerGameSceneInit(pokergamescene_t *gameScene, engine_t *engine); void pokerGameSceneInit(pokergamescene_t *gameScene, engine_t *engine);