elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


  Mostrar Mensajes
Páginas: [1]
1  Programación / Programación C/C++ / Error referencias con las clases en: 28 Septiembre 2016, 16:45 pm
Tengo problemas con la referencia de las clases, si alguien me puede sacar de mi ignorancia seria de agradecer, estoy trabajando en DEV C++

graphics.h
 
Código
  1. #ifndef GRAPHICS_H
  2. #define GRAPHICS_H
  3.  
  4. struct SDL_Window;
  5. struct SDL_Renderer;
  6.  
  7. class Graphics {
  8. public:
  9. Graphics();
  10. ~Graphics();
  11. private:
  12. SDL_Window* _window;
  13. SDL_Renderer* _renderer;
  14. };
  15.  
  16. #endif

Graphics.cpp

Código
  1. #include "../SDL/SDL.h"
  2. #include "graphics.h"
  3.  
  4. Graphics::Graphics() {
  5. SDL_CreateWindowAndRenderer(640, 480, 0, &this->_window, &this->_renderer);
  6. SDL_SetWindowTitle(this->_window, "algo");
  7. }
  8.  
  9. Graphics::~Graphics(){
  10. SDL_DestroyWindow(this->_window);
  11. }
  12.  

main.cpp

Código
  1. #include "headers/graphics.h"
  2.  
  3. int main(int argc, const char* argv[])
  4. {
  5. Graphics graphics;
  6. while (true)
  7. {
  8.  
  9. }
  10.  
  11. return 0;
  12. }




Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines