Just committing while I rethink things
This commit is contained in:
@ -102,11 +102,8 @@ elseif(TARGET_TYPE STREQUAL game)
|
||||
)
|
||||
|
||||
# World
|
||||
tool_copy(texture_pub
|
||||
poker/world/pub/pub_skywall.png poker/pub_skywall.png
|
||||
)
|
||||
tool_copy(texture_cards
|
||||
poker/cards_normal.png poker/cards.png
|
||||
tool_texture(texture_pub
|
||||
${ASSETS_SOURCE_DIR}/poker/world/pub/pub_skywall.png poker/world/pub
|
||||
)
|
||||
|
||||
tool_assets(
|
||||
@ -116,7 +113,8 @@ elseif(TARGET_TYPE STREQUAL game)
|
||||
font_opensans
|
||||
|
||||
texture_test
|
||||
|
||||
texture_pub
|
||||
|
||||
vn_penny
|
||||
vn_lucy
|
||||
vn_julie
|
||||
|
@ -35,16 +35,25 @@ void _pokerGameSceneRender(scene_t *scene) {
|
||||
|
||||
gameScene = (pokergamescene_t *)scene->user;
|
||||
pass = sceneUsePass(scene, gameScene->passOnly);
|
||||
|
||||
|
||||
// Camera
|
||||
cameraPerspective(&camera, 75,
|
||||
(float)pass->frame.texture.width / (float)pass->frame.texture.height,
|
||||
0.01f, 1000.0f
|
||||
);
|
||||
cameraLookAt(&camera, 3,3,3, 0,0,0);
|
||||
|
||||
shaderUseCamera(pass->shader,
|
||||
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],
|
||||
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
|
||||
);
|
||||
|
||||
gameScene->texturePub = assetManagerLoadScaledTexture(
|
||||
&engine->assetManager, gameScene->scene.assetOwner,
|
||||
"poker/world", "pub", 0
|
||||
);
|
||||
|
||||
// Cube
|
||||
cubeInit(&gameScene->cube, 1, 1, 1);
|
||||
skywallInit(&gameScene->skywall);
|
||||
}
|
||||
|
||||
void pokerGameSceneUpdate(pokergamescene_t *gameScene) {
|
||||
int i = 3;
|
||||
sceneUpdateToBackbuffer(&gameScene->scene,
|
||||
&gameScene->shaderList->data.shader.shader, gameScene->uniformsList,
|
||||
&gameScene->shaderWorld->data.shader.shader, gameScene->uniformsWorld
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "../../../scene/scene.h"
|
||||
#include "../../../display/primitive/primitive.h"
|
||||
#include "../../../display/primitive/cube.h"
|
||||
#include "../../../display/primitive/skywall.h"
|
||||
#include "../../../file/assetmanager.h"
|
||||
|
||||
typedef struct {
|
||||
@ -26,8 +27,10 @@ typedef struct {
|
||||
shaderuniform_t uniformsList[4];
|
||||
|
||||
assetmanageritem_t *textureTest;
|
||||
assetmanageritem_t *texturePub;
|
||||
|
||||
primitive_t cube;
|
||||
primitive_t skywall;
|
||||
} pokergamescene_t;
|
||||
|
||||
void pokerGameSceneInit(pokergamescene_t *gameScene, engine_t *engine);
|
||||
|
Reference in New Issue
Block a user