From 0f797a17d55785d8cc6d54fb861e7344446b8ed5 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 18 Jun 2023 17:56:01 -0500 Subject: [PATCH] [studio] Make clear screen before redraw --- src/glutils/glutils.cpp | 5 +++++ src/glutils/glutils.hpp | 4 +++- src/studio/applib/src/builtinmodules.hpp | 11 ----------- src/studio/applib/src/studioapp.cpp | 3 ++- 4 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 src/studio/applib/src/builtinmodules.hpp diff --git a/src/glutils/glutils.cpp b/src/glutils/glutils.cpp index a3e322fc..30fbd66f 100644 --- a/src/glutils/glutils.cpp +++ b/src/glutils/glutils.cpp @@ -184,4 +184,9 @@ void sendEbo(const BufferSet &bs) noexcept { glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufferSize, bs.elements.data(), GL_STATIC_DRAW); } +void clearScreen() noexcept { + glClearColor(0, 0, 0, 1); + glClear(GL_COLOR_BUFFER_BIT); +} + } diff --git a/src/glutils/glutils.hpp b/src/glutils/glutils.hpp index 19ea49bc..9ceeb602 100644 --- a/src/glutils/glutils.hpp +++ b/src/glutils/glutils.hpp @@ -15,7 +15,7 @@ namespace glutils { -constexpr auto GlslVersion = "#version 330"; +constexpr ox::StringView GlslVersion = "#version 330"; struct Empty {}; @@ -176,4 +176,6 @@ void sendVbo(const BufferSet &bs) noexcept; void sendEbo(const BufferSet &bs) noexcept; +void clearScreen() noexcept; + } diff --git a/src/studio/applib/src/builtinmodules.hpp b/src/studio/applib/src/builtinmodules.hpp deleted file mode 100644 index b4228c9e..00000000 --- a/src/studio/applib/src/builtinmodules.hpp +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved. - */ - -#pragma once - -#include - -#include - -extern ox::Vector()>> BuiltinModules; \ No newline at end of file diff --git a/src/studio/applib/src/studioapp.cpp b/src/studio/applib/src/studioapp.cpp index 0c327c1b..35e85bfe 100644 --- a/src/studio/applib/src/studioapp.cpp +++ b/src/studio/applib/src/studioapp.cpp @@ -5,10 +5,10 @@ #include #include +#include #include #include -#include "builtinmodules.hpp" #include "clawviewer.hpp" #include "filedialogmanager.hpp" #include "studioapp.hpp" @@ -119,6 +119,7 @@ void StudioUI::handleKeyEvent(turbine::Key key, bool down) noexcept { } void StudioUI::draw() noexcept { + glutils::clearScreen(); drawMenu(); drawTabBar(); if (m_showProjectExplorer) {