diff --git a/doc/samples/meshviewer/meshviewer.cpp b/doc/samples/meshviewer/meshviewer.cpp index 8f147f6b..4c79c8fc 100644 --- a/doc/samples/meshviewer/meshviewer.cpp +++ b/doc/samples/meshviewer/meshviewer.cpp @@ -172,11 +172,16 @@ void MeshViewer::Start() //Camera setup m_camera = new Camera(); m_camera->SetView(vec3(10.f, 10.f, 10.f), vec3::zero, vec3::axis_y); - m_camera->SetProjection(40.f, .0001f, 2000.f); + m_camera->SetProjection(40.f, .0001f, 200.f); //m_camera->SetProjection(90.f, .0001f, 2000.f, WIDTH * SCREEN_W, RATIO_HW); //m_camera->UseShift(true); Scene& scene = Scene::GetScene(); scene.PushCamera(m_camera); + scene.SetTileCam(0); + + //Text setup + m_entities << (m_text = new Text("", "data/font/ascii.png")); + m_text->SetPos(vec3(0, 0 /*(float)-m_text->GetFontSize().y*/, 0)); #if HAS_INPUT InputProfile& ip = m_profile; @@ -374,6 +379,8 @@ void MeshViewer::TickDraw(float seconds, Scene &scene) if (m_menu_mesh_idx >= 0 && m_menu_mesh_idx < m_objs.count()) m_objs[m_menu_mesh_idx]->TickDraw(seconds, scene); + m_text->SetText(String("CECI EST UN TEST\n")); + //Draw gizmos & grid Debug::DrawGizmo(vec3::zero, vec3::axis_x, vec3::axis_y, vec3::axis_z, 10.f); Debug::DrawSetupColor(Color::white); @@ -394,11 +401,11 @@ int main(int argc, char **argv) new MeshViewer(argv[1]); else new MeshViewer(); - /* + + ////DEBUG TEST //SceneDisplay* display = new ApplicationDisplay("newDisplay", ivec2(800, 600)); //SceneDisplay::Add(display); //Scene::GetScene(Scene::GetCount() - 1).SetDisplay(display); - */ app.Run(); diff --git a/doc/samples/meshviewer/meshviewer.h b/doc/samples/meshviewer/meshviewer.h index 5911a983..0312d7bb 100644 --- a/doc/samples/meshviewer/meshviewer.h +++ b/doc/samples/meshviewer/meshviewer.h @@ -251,6 +251,7 @@ private: bool m_first_tick = false; InputProfile m_profile; Camera* m_camera = nullptr; + Text* m_text = nullptr; //ImGui stuff bool m_menu_cam_useage = true; diff --git a/src/lolimgui.cpp b/src/lolimgui.cpp index b56ba7f3..d5d3c7bb 100644 --- a/src/lolimgui.cpp +++ b/src/lolimgui.cpp @@ -263,8 +263,6 @@ void LolImGui::TickDraw(float seconds, Scene &scene) } void PrimitiveLolImGui::Render(Scene& scene, PrimitiveSource* primitive) { - Renderer::Get()->Clear(ClearMask::Depth); - ImGuiIO& io = ImGui::GetIO(); if (io.Fonts->TexID) ImGui::Render(); diff --git a/src/platform/sdl/sdlapp.cpp b/src/platform/sdl/sdlapp.cpp index 1ddf23a6..2548da29 100644 --- a/src/platform/sdl/sdlapp.cpp +++ b/src/platform/sdl/sdlapp.cpp @@ -75,6 +75,10 @@ SdlAppDisplay::SdlAppDisplay(char const *title, ivec2 res) } #if USE_SDL + /* This seems to fix the swap context bug. + * However, perfs warning have been may occur. */ + SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1); + data->m_window = SDL_CreateWindow(title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, window_size.x, window_size.y, diff --git a/src/scene.h b/src/scene.h index 7363b62e..30529c1d 100644 --- a/src/scene.h +++ b/src/scene.h @@ -78,7 +78,7 @@ public: static ptrdiff_t GetPhysicalCount(); static const char* GetPhysicalName(ptrdiff_t index = 0); -protected: +//protected: virtual void Enable(); virtual void Disable(); diff --git a/src/ticker.cpp b/src/ticker.cpp index 20395511..e51a187c 100644 --- a/src/ticker.cpp +++ b/src/ticker.cpp @@ -479,6 +479,8 @@ void TickerData::DrawThreadTick() /* Disable display */ scene.DisableDisplay(); + + //break; } Profiler::Stop(Profiler::STAT_TICK_DRAW);