graphics.h
Código
#ifndef GRAPHICS_H #define GRAPHICS_H struct SDL_Window; struct SDL_Renderer; class Graphics { public: Graphics(); ~Graphics(); private: SDL_Window* _window; SDL_Renderer* _renderer; }; #endif
Graphics.cpp
Código
#include "../SDL/SDL.h" #include "graphics.h" Graphics::Graphics() { SDL_CreateWindowAndRenderer(640, 480, 0, &this->_window, &this->_renderer); SDL_SetWindowTitle(this->_window, "algo"); } Graphics::~Graphics(){ SDL_DestroyWindow(this->_window); }
main.cpp
Código
#include "headers/graphics.h" int main(int argc, const char* argv[]) { Graphics graphics; while (true) { } return 0; }