Working on RenderTarget example

This commit is contained in:
2022-10-19 00:43:16 -07:00
parent a86574128d
commit f0cbae4cf8
17 changed files with 235 additions and 26 deletions

View File

@ -8,6 +8,7 @@
#include "DawnGLFWHost.hpp"
#include "game/DawnGame.hpp"
#include "dawnopengl.hpp"
#include "display/BackBufferRenderTarget.hpp"
using namespace Dawn;
@ -53,6 +54,11 @@ int32_t DawnHost::init(std::weak_ptr<DawnGame> game) {
if(auto g = game.lock()) {
auto result = g->init();
if(result != DAWN_GAME_INIT_RESULT_SUCCESS) return result;
g->renderManager.renderTarget->setSize(
DAWN_GLFW_WINDOW_WIDTH_DEFAULT,
DAWN_GLFW_WINDOW_HEIGHT_DEFAULT
);
} else {
return DAWN_GLFW_INIT_RESULT_GAME_LOCK_FAILED;
}
@ -107,6 +113,8 @@ int32_t DawnHost::update(std::weak_ptr<DawnGame> game, float_t delta) {
return ret;
}
}
return DAWN_GLFW_UPDATE_RESULT_GAME_LOCK_FAILED;
}
void DawnHost::unload(std::weak_ptr<DawnGame> game) {

View File

@ -18,6 +18,8 @@
#define DAWN_GLFW_START_RESULT_UPDATE_FAILED -1
#define DAWN_GLFW_UPDATE_RESULT_GAME_LOCK_FAILED -1
namespace Dawn {
class DawnHostData {
public: