mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 05:31:07 +03:00
feat(ui): add CGWorldFrame::OnFrameRender
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
This commit is contained in:
parent
04c3dac382
commit
05d949523c
@ -1,5 +1,9 @@
|
||||
#include "ui/game/CGWorldFrame.hpp"
|
||||
#include "gx/Shader.hpp"
|
||||
#include "gx/Transform.hpp"
|
||||
#include "ui/game/PlayerName.hpp"
|
||||
#include <storm/Memory.hpp>
|
||||
#include <tempest/Matrix.hpp>
|
||||
|
||||
CSimpleFrame* CGWorldFrame::Create(CSimpleFrame* parent) {
|
||||
// TODO use CDataAllocator
|
||||
@ -7,6 +11,27 @@ CSimpleFrame* CGWorldFrame::Create(CSimpleFrame* parent) {
|
||||
return STORM_NEW(CGWorldFrame)(parent);
|
||||
}
|
||||
|
||||
void CGWorldFrame::RenderWorld(void* param) {
|
||||
auto frame = reinterpret_cast<CGWorldFrame*>(param);
|
||||
|
||||
C44Matrix savedProj;
|
||||
GxXformProjection(savedProj);
|
||||
|
||||
C44Matrix savedView;
|
||||
GxXformView(savedView);
|
||||
|
||||
frame->OnWorldUpdate();
|
||||
PlayerNameUpdateWorldText();
|
||||
|
||||
frame->OnWorldRender();
|
||||
PlayerNameRenderWorldText();
|
||||
|
||||
GxXformSetProjection(savedProj);
|
||||
GxXformSetView(savedView);
|
||||
|
||||
CShaderEffect::UpdateProjMatrix();
|
||||
}
|
||||
|
||||
CGWorldFrame::CGWorldFrame(CSimpleFrame* parent) : CSimpleFrame(parent) {
|
||||
// TODO
|
||||
|
||||
@ -20,3 +45,19 @@ CGWorldFrame::CGWorldFrame(CSimpleFrame* parent) : CSimpleFrame(parent) {
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CGWorldFrame::OnFrameRender(CRenderBatch* batch, uint32_t layer) {
|
||||
this->CSimpleFrame::OnFrameRender(batch, layer);
|
||||
|
||||
if (layer == DRAWLAYER_BACKGROUND) {
|
||||
batch->QueueCallback(&CGWorldFrame::RenderWorld, this);
|
||||
}
|
||||
}
|
||||
|
||||
void CGWorldFrame::OnWorldRender() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CGWorldFrame::OnWorldUpdate() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@ -11,9 +11,15 @@ class CGWorldFrame : public CSimpleFrame {
|
||||
|
||||
// Static functions
|
||||
static CSimpleFrame* Create(CSimpleFrame* parent);
|
||||
static void RenderWorld(void* param);
|
||||
|
||||
// Virtual member functions
|
||||
virtual void OnFrameRender(CRenderBatch* batch, uint32_t layer);
|
||||
|
||||
// Member functions
|
||||
CGWorldFrame(CSimpleFrame* parent);
|
||||
void OnWorldRender();
|
||||
void OnWorldUpdate();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
9
src/ui/game/PlayerName.cpp
Normal file
9
src/ui/game/PlayerName.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "ui/game/PlayerName.hpp"
|
||||
|
||||
void PlayerNameRenderWorldText() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void PlayerNameUpdateWorldText() {
|
||||
// TODO
|
||||
}
|
||||
8
src/ui/game/PlayerName.hpp
Normal file
8
src/ui/game/PlayerName.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef UI_GAME_PLAYER_NAME_HPP
|
||||
#define UI_GAME_PLAYER_NAME_HPP
|
||||
|
||||
void PlayerNameRenderWorldText();
|
||||
|
||||
void PlayerNameUpdateWorldText();
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user