From d5b08778a50b668e8f21f6fbd23aa5523730b423 Mon Sep 17 00:00:00 2001 From: Justin Scofield <47263509+scawful@users.noreply.github.com> Date: Sun, 12 Jun 2022 20:29:07 -0400 Subject: [PATCH] Delete Renderer.cc --- src/Application/Core/Renderer.cc | 77 -------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 src/Application/Core/Renderer.cc diff --git a/src/Application/Core/Renderer.cc b/src/Application/Core/Renderer.cc deleted file mode 100644 index 68e36fd9..00000000 --- a/src/Application/Core/Renderer.cc +++ /dev/null @@ -1,77 +0,0 @@ -#include "Renderer.h" - -#include -#include -#include -#include - -#include "graphics/icons.h" -#include "graphics/style.h" - -namespace yaze { -namespace Application { -namespace Core { - -void Renderer::Create(SDL_Window* window) { - if (window == nullptr) { - SDL_Log("SDL_CreateWindow: %s\n", SDL_GetError()); - SDL_Quit(); - } else { - renderer = SDL_CreateRenderer( - window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); - if (renderer == nullptr) { - SDL_Log("SDL_CreateRenderer: %s\n", SDL_GetError()); - SDL_Quit(); - } else { - SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND); - SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00); - } - } - - // Create the ImGui and ImPlot contexts - ImGui::CreateContext(); - - // Initialize ImGui for SDL - ImGui_ImplSDL2_InitForSDLRenderer(window, renderer); - ImGui_ImplSDLRenderer_Init(renderer); - - // Load available fonts - const ImGuiIO& io = ImGui::GetIO(); - io.Fonts->AddFontFromFileTTF("assets/Fonts/Karla-Regular.ttf", 14.0f); - - // merge in icons from Google Material Design - static const ImWchar icons_ranges[] = {ICON_MIN_MD, 0xf900, 0}; - ImFontConfig icons_config; - icons_config.MergeMode = true; - icons_config.GlyphOffset.y = 5.0f; - icons_config.GlyphMinAdvanceX = 13.0f; - icons_config.PixelSnapH = true; - io.Fonts->AddFontFromFileTTF(FONT_ICON_FILE_NAME_MD, 18.0f, &icons_config, - icons_ranges); - io.Fonts->AddFontFromFileTTF("assets/Fonts/Roboto-Medium.ttf", 14.0f); - io.Fonts->AddFontFromFileTTF("assets/Fonts/Cousine-Regular.ttf", 14.0f); - io.Fonts->AddFontFromFileTTF("assets/Fonts/DroidSans.ttf", 16.0f); - - // Set the default style - Style::ColorsYaze(); - - // Build a new ImGui frame - ImGui_ImplSDLRenderer_NewFrame(); - ImGui_ImplSDL2_NewFrame(window); -} - -void Renderer::Render() { - SDL_RenderClear(renderer); - ImGui::Render(); - ImGui_ImplSDLRenderer_RenderDrawData(ImGui::GetDrawData()); - SDL_RenderPresent(renderer); -} - -void Renderer::Destroy() { - SDL_DestroyRenderer(renderer); - renderer = nullptr; -} - -} // namespace Core -} // namespace Application -} // namespace yaze \ No newline at end of file