minor tweaks
parent
73eabe3b11
commit
9e80e682eb
|
@ -12,6 +12,8 @@
|
||||||
struct Entity;
|
struct Entity;
|
||||||
|
|
||||||
struct InputState {
|
struct InputState {
|
||||||
|
int32_t mousedX;
|
||||||
|
int32_t mousedY;
|
||||||
int32_t mouseX;
|
int32_t mouseX;
|
||||||
int32_t mouseY;
|
int32_t mouseY;
|
||||||
uint8_t mouseButton;
|
uint8_t mouseButton;
|
||||||
|
|
|
@ -48,6 +48,14 @@ void handle_keyboard () {
|
||||||
direction -= right;
|
direction -= right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (glfwGetKey(gWindow, GLFW_KEY_SPACE) == GLFW_PRESS) {
|
||||||
|
direction += Vector3f (0.f, 1.f, 0.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (glfwGetKey(gWindow, GLFW_KEY_C) == GLFW_PRESS) {
|
||||||
|
direction += Vector3f (0.f, -1.f, 0.f);
|
||||||
|
}
|
||||||
|
|
||||||
float step = 0.1f;
|
float step = 0.1f;
|
||||||
eye += direction * step;
|
eye += direction * step;
|
||||||
poi += direction * step;
|
poi += direction * step;
|
||||||
|
@ -85,7 +93,7 @@ static void module_unload(struct module_state *state) {
|
||||||
|
|
||||||
static bool module_step(struct module_state *state) {
|
static bool module_step(struct module_state *state) {
|
||||||
bool enabled = true;
|
bool enabled = true;
|
||||||
ImGui::Begin("yoyoyoxi2");
|
ImGui::Begin("Ddebug");
|
||||||
if (ImGui::Button("Hallo Katrina")) {
|
if (ImGui::Button("Hallo Katrina")) {
|
||||||
if (gRenderer->drawDebug) {
|
if (gRenderer->drawDebug) {
|
||||||
gRenderer->drawDebug = false;
|
gRenderer->drawDebug = false;
|
||||||
|
@ -96,6 +104,10 @@ static bool module_step(struct module_state *state) {
|
||||||
}
|
}
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
|
|
||||||
|
static bool imgui_test_window = true;
|
||||||
|
ImGui::ShowTestWindow();
|
||||||
|
|
||||||
float deltaTime = 0.3;
|
float deltaTime = 0.3;
|
||||||
std::ostringstream s;
|
std::ostringstream s;
|
||||||
s << "TestModule: 2 Runtime Object 4 " << deltaTime << " update called!";
|
s << "TestModule: 2 Runtime Object 4 " << deltaTime << " update called!";
|
||||||
|
|
24
src/main.cc
24
src/main.cc
|
@ -79,17 +79,6 @@ int main(void)
|
||||||
|
|
||||||
gRenderer = &renderer;
|
gRenderer = &renderer;
|
||||||
|
|
||||||
// bgfx::init();
|
|
||||||
// bgfx::reset(width, height, BGFX_RESET_VSYNC);
|
|
||||||
|
|
||||||
// printf("bgfx renderer is %s\n", bgfx::getRendererName(bgfx::getRendererType()));
|
|
||||||
|
|
||||||
// Enable debug text.
|
|
||||||
// bgfx::setDebug(BGFX_DEBUG_TEXT);
|
|
||||||
|
|
||||||
// Set view 0 clear state.
|
|
||||||
// bgfx::setViewClear(0, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x3070F0FF);
|
|
||||||
|
|
||||||
printf("Initializing ModuleManager...\n");
|
printf("Initializing ModuleManager...\n");
|
||||||
RuntimeModuleManager module_manager;
|
RuntimeModuleManager module_manager;
|
||||||
module_manager.RegisterModule("libTestModule.so");
|
module_manager.RegisterModule("libTestModule.so");
|
||||||
|
@ -118,22 +107,13 @@ int main(void)
|
||||||
|
|
||||||
renderer.paintGL();
|
renderer.paintGL();
|
||||||
|
|
||||||
// bgfx::setViewRect(0, 0, 0, width, height);
|
|
||||||
|
|
||||||
// Dummy submit call to make sure view 0 is cleared
|
|
||||||
// bgfx::touch(0);
|
|
||||||
|
|
||||||
// bgfx::dbgTextClear();
|
|
||||||
// bgfx::dbgTextPrintf(0, 1, 0x4f, "Test text");
|
|
||||||
// bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
|
|
||||||
//
|
|
||||||
// bgfx::frame();
|
|
||||||
|
|
||||||
glfwPollEvents();
|
glfwPollEvents();
|
||||||
|
|
||||||
// send inputs to the input state of the renderer
|
// send inputs to the input state of the renderer
|
||||||
double mouse_x, mouse_y;
|
double mouse_x, mouse_y;
|
||||||
glfwGetCursorPos(gWindow, &mouse_x, &mouse_y);
|
glfwGetCursorPos(gWindow, &mouse_x, &mouse_y);
|
||||||
|
renderer.inputState.mousedX = mouse_x - renderer.inputState.mouseX;
|
||||||
|
renderer.inputState.mousedY = mouse_y - renderer.inputState.mouseY;
|
||||||
renderer.inputState.mouseX = mouse_x;
|
renderer.inputState.mouseX = mouse_x;
|
||||||
renderer.inputState.mouseY = mouse_y;
|
renderer.inputState.mouseY = mouse_y;
|
||||||
renderer.inputState.mouseButton =
|
renderer.inputState.mouseButton =
|
||||||
|
|
Loading…
Reference in New Issue