Daniele Bartolini 11 лет назад
Родитель
Сommit
2fa075fb12
2 измененных файлов с 2 добавлено и 6 удалено
  1. 2 0
      engine/main/main.cpp
  2. 0 6
      engine/renderers/render_world.cpp

+ 2 - 0
engine/main/main.cpp

@@ -31,6 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "device.h"
 #include "os_event_queue.h"
 #include "input.h"
+#include <bgfx.h>
 
 namespace crown
 {
@@ -81,6 +82,7 @@ bool process_events()
 				const OsMetricsEvent& ev = event.metrics;
 				mouse().set_metrics(ev.width, ev.height);
 				device()->update_resolution(ev.width, ev.height);
+				bgfx::reset(ev.width, ev.height, BGFX_RESET_VSYNC);
 				break;
 			}
 			case OsEvent::EXIT:

+ 0 - 6
engine/renderers/render_world.cpp

@@ -108,8 +108,6 @@ Gui* RenderWorld::get_gui(GuiId id)
 
 void RenderWorld::update(const Matrix4x4& view, const Matrix4x4& projection, uint16_t x, uint16_t y, uint16_t width, uint16_t height, float dt)
 {
-	bgfx::reset(width, height, BGFX_RESET_VSYNC);
-
 	// Set view 0 clear state.
 	bgfx::setViewClear(0
 		, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
@@ -126,10 +124,6 @@ void RenderWorld::update(const Matrix4x4& view, const Matrix4x4& projection, uin
 	// if no other draw calls are submitted to view 0.
 	bgfx::submit(0);
 
-	// Use debug font to print information about this example.
-	bgfx::dbgTextClear();
-	bgfx::dbgTextPrintf(0, 2, 0x6f, "dt = %4.7f", dt);
-
 	// Draw all sprites
 	for (uint32_t s = 0; s < id_array::size(m_sprite); s++)
 	{