Camera (broken) and plane primative type

This commit is contained in:
Ben Kyd
2019-08-05 01:52:25 +01:00
parent db66ceacd1
commit 8c495cc66b
11 changed files with 117 additions and 69 deletions

View File

@@ -52,7 +52,7 @@ bool Display::InitVideoDisplay(std::string title, int x, int y) {
}
Framebuffer = (uint32_t*)malloc(this->XRes * this->YRes * sizeof(uint32_t));
memset((void*)Framebuffer, 0, this->XRes * this->YRes * sizeof(uint32_t));
if (!Framebuffer) {
// Add error
std::cout << "ERROR: COULD NOT ALLOCATE FRAMEBUFFER" << std::endl;
@@ -92,6 +92,7 @@ void Display::Update() {
SDL_UpdateTexture(m_texture, NULL, Framebuffer, this->XRes * sizeof(uint32_t));
SDL_RenderCopy(m_renderer, m_texture, NULL, NULL);
SDL_RenderPresent(m_renderer);
memset((void*)Framebuffer, 0, this->XRes * this->YRes * sizeof(uint32_t));
}
void Display::Close() {