Here's the error message I get (line 50): passing 'const std::vector<SDL_Surface*>' as 'this' argument of 'void std::vector<_Tp, _Alloc>:: push_back(const value_type&) [with _Tp = SDL_Surface*, _Alloc = std::allocator<SDL_Surface*>, value_type = SDL_Surface*]' discards qualifiers
Code:
#ifndef CHARACTER_DEFINE_H
#include <vector>
#include <iostream>
#include <fstream>
#include <cstdarg>
#include "SDL/SDL.h"
//#include "SDL_gfxPrimitives.h"
#include "gl/gl.h"
#include "gl/glu.h"
SDL_Surface* Load_fBMP(const char* filepath, const bool alphaon);
class Entity{
void setVisible(){
}
};
class Dynamic_Entity : public Entity{
std::vector< SDL_Surface* > frame_data;
public:
void newFrame(const char* filepath, const bool format=true, const bool alphaon=true)const{
SDL_Surface* frame;
if(format){
frame=Load_fBMP(filepath, alphaon);
}else{
frame=SDL_LoadBMP(filepath);
}
frame_data.push_back(frame);
}
};
class Dynamic_Char : public Dynamic_Entity{
public:
Dynamic_Char(){
}
};
#endif