Compare commits
2 Commits
47858ef619
...
de45e7a075
Author | SHA1 | Date | |
---|---|---|---|
de45e7a075 | |||
0f797a17d5 |
@ -184,4 +184,9 @@ void sendEbo(const BufferSet &bs) noexcept {
|
|||||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufferSize, bs.elements.data(), GL_STATIC_DRAW);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace glutils {
|
namespace glutils {
|
||||||
|
|
||||||
constexpr auto GlslVersion = "#version 330";
|
constexpr ox::StringView GlslVersion = "#version 330";
|
||||||
|
|
||||||
struct Empty {};
|
struct Empty {};
|
||||||
|
|
||||||
@ -176,4 +176,6 @@ void sendVbo(const BufferSet &bs) noexcept;
|
|||||||
|
|
||||||
void sendEbo(const BufferSet &bs) noexcept;
|
void sendEbo(const BufferSet &bs) noexcept;
|
||||||
|
|
||||||
|
void clearScreen() noexcept;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -346,7 +346,8 @@ ox::Error initGfx(
|
|||||||
const auto spriteFshad = ox::sfmt(renderer::spritefshadTmpl, glutils::GlslVersion);
|
const auto spriteFshad = ox::sfmt(renderer::spritefshadTmpl, glutils::GlslVersion);
|
||||||
auto &gctx = static_cast<GlContext&>(*ctx);
|
auto &gctx = static_cast<GlContext&>(*ctx);
|
||||||
oxReturnError(glutils::buildShaderProgram(bgVshad.c_str(), bgFshad.c_str()).moveTo(&gctx.bgShader));
|
oxReturnError(glutils::buildShaderProgram(bgVshad.c_str(), bgFshad.c_str()).moveTo(&gctx.bgShader));
|
||||||
oxReturnError(glutils::buildShaderProgram(spriteVshad.c_str(), spriteFshad.c_str()).moveTo(&gctx.spriteShader));
|
oxReturnError(
|
||||||
|
glutils::buildShaderProgram(spriteVshad.c_str(), spriteFshad.c_str()).moveTo(&gctx.spriteShader));
|
||||||
for (auto &bg : gctx.cbbs) {
|
for (auto &bg : gctx.cbbs) {
|
||||||
initBackgroundBufferset(ctx, gctx.bgShader, &bg);
|
initBackgroundBufferset(ctx, gctx.bgShader, &bg);
|
||||||
}
|
}
|
||||||
@ -435,6 +436,7 @@ void puts(Context *ctx, int column, int row, ox::CRStringView str) noexcept {
|
|||||||
setTile(ctx, 0, static_cast<int>(col + i), row, static_cast<uint8_t>(charMap[static_cast<uint8_t>(str[i])]));
|
setTile(ctx, 0, static_cast<int>(col + i), row, static_cast<uint8_t>(charMap[static_cast<uint8_t>(str[i])]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setBgCbb(Context *ctx, unsigned bgIdx, unsigned cbbIdx) noexcept {
|
void setBgCbb(Context *ctx, unsigned bgIdx, unsigned cbbIdx) noexcept {
|
||||||
auto &gctx = static_cast<GlContext&>(*ctx);
|
auto &gctx = static_cast<GlContext&>(*ctx);
|
||||||
auto &bg = gctx.backgrounds[bgIdx];
|
auto &bg = gctx.backgrounds[bgIdx];
|
||||||
@ -577,9 +579,7 @@ namespace gl {
|
|||||||
|
|
||||||
void drawMainView(core::Context *ctx, ox::Size const&renderSz) noexcept {
|
void drawMainView(core::Context *ctx, ox::Size const&renderSz) noexcept {
|
||||||
glViewport(0, 0, renderSz.width, renderSz.height);
|
glViewport(0, 0, renderSz.width, renderSz.height);
|
||||||
// clear screen
|
glutils::clearScreen();
|
||||||
glClearColor(0, 0, 0, 1);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
auto &gctx = static_cast<GlContext&>(*ctx);
|
auto &gctx = static_cast<GlContext&>(*ctx);
|
||||||
renderer::drawBackgrounds(&gctx, renderSz);
|
renderer::drawBackgrounds(&gctx, renderSz);
|
||||||
if (gctx.spriteBlocks.tex) {
|
if (gctx.spriteBlocks.tex) {
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <studio/module.hpp>
|
|
||||||
|
|
||||||
#include <ox/std/memory.hpp>
|
|
||||||
|
|
||||||
extern ox::Vector<std::function<ox::UPtr<studio::Module>()>> BuiltinModules;
|
|
@ -5,10 +5,10 @@
|
|||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
|
||||||
#include <keel/media.hpp>
|
#include <keel/media.hpp>
|
||||||
|
#include <glutils/glutils.hpp>
|
||||||
#include <turbine/turbine.hpp>
|
#include <turbine/turbine.hpp>
|
||||||
|
|
||||||
#include <studio/configio.hpp>
|
#include <studio/configio.hpp>
|
||||||
#include "builtinmodules.hpp"
|
|
||||||
#include "clawviewer.hpp"
|
#include "clawviewer.hpp"
|
||||||
#include "filedialogmanager.hpp"
|
#include "filedialogmanager.hpp"
|
||||||
#include "studioapp.hpp"
|
#include "studioapp.hpp"
|
||||||
@ -119,6 +119,7 @@ void StudioUI::handleKeyEvent(turbine::Key key, bool down) noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void StudioUI::draw() noexcept {
|
void StudioUI::draw() noexcept {
|
||||||
|
glutils::clearScreen();
|
||||||
drawMenu();
|
drawMenu();
|
||||||
drawTabBar();
|
drawTabBar();
|
||||||
if (m_showProjectExplorer) {
|
if (m_showProjectExplorer) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user