use C++0x, change prerequisites headers
This commit is contained in:
parent
7ef92bb0ac
commit
d29b139321
|
@ -14,8 +14,8 @@ Fonts::~Fonts()
|
||||||
bool Fonts::load()
|
bool Fonts::load()
|
||||||
{
|
{
|
||||||
std::list<std::string> files = g_resources.getDirectoryFiles("fonts");
|
std::list<std::string> files = g_resources.getDirectoryFiles("fonts");
|
||||||
foreach(const std::string& file, files) {
|
for(auto it = files.begin(); it != files.end(); ++it) {
|
||||||
notice("File: %s", file.c_str());
|
notice("File: %s", (*it).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -25,6 +25,10 @@
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
|
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#include <GL/glext.h>
|
||||||
|
|
||||||
PFNGLGENFRAMEBUFFERSPROC oglGenFramebuffers = 0;
|
PFNGLGENFRAMEBUFFERSPROC oglGenFramebuffers = 0;
|
||||||
PFNGLBINDFRAMEBUFFERPROC oglBindFramebuffer = 0;
|
PFNGLBINDFRAMEBUFFERPROC oglBindFramebuffer = 0;
|
||||||
PFNGLFRAMEBUFFERTEXTURE2DPROC oglFramebufferTexture2D = 0;
|
PFNGLFRAMEBUFFERTEXTURE2DPROC oglFramebufferTexture2D = 0;
|
||||||
|
|
|
@ -43,8 +43,8 @@ public:
|
||||||
void draw(int x, int y, int width, int height);
|
void draw(int x, int y, int width, int height);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GLuint m_fboTexture;
|
unsigned int m_fboTexture;
|
||||||
GLuint m_fbo;
|
unsigned int m_fbo;
|
||||||
bool m_fallbackOldImp;
|
bool m_fallbackOldImp;
|
||||||
int m_width;
|
int m_width;
|
||||||
int m_height;
|
int m_height;
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
|
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#include <GL/glext.h>
|
||||||
|
|
||||||
Graphics g_graphics;
|
Graphics g_graphics;
|
||||||
|
|
||||||
Graphics::Graphics()
|
Graphics::Graphics()
|
||||||
|
|
|
@ -27,12 +27,10 @@
|
||||||
|
|
||||||
// easy typing
|
// easy typing
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef unsigned char uchar;
|
typedef unsigned char uchar;
|
||||||
typedef unsigned short ushort;
|
typedef unsigned short ushort;
|
||||||
typedef unsigned int uint;
|
typedef unsigned int uint;
|
||||||
typedef unsigned long ulong;
|
typedef unsigned long ulong;
|
||||||
|
|
||||||
typedef uint32_t uint32;
|
typedef uint32_t uint32;
|
||||||
typedef uint16_t uint16;
|
typedef uint16_t uint16;
|
||||||
typedef uint8_t uint8;
|
typedef uint8_t uint8;
|
||||||
|
@ -60,26 +58,12 @@ typedef int8_t int8;
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <tr1/cinttypes>
|
#include <memory>
|
||||||
|
|
||||||
// additional string algorithms
|
// boost utilities
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
// easy casting
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
// smart pointers
|
|
||||||
#include <boost/smart_ptr.hpp>
|
|
||||||
|
|
||||||
// foreach
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#define foreach BOOST_FOREACH
|
|
||||||
|
|
||||||
// GL stuff
|
|
||||||
#include <GL/gl.h>
|
|
||||||
#include <GL/glu.h>
|
|
||||||
#include <GL/glext.h>
|
|
||||||
|
|
||||||
// internal logger
|
// internal logger
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
|
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
|
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glext.h>
|
||||||
|
|
||||||
Texture::Texture(int width, int height, int components, unsigned char *pixels)
|
Texture::Texture(int width, int height, int components, unsigned char *pixels)
|
||||||
{
|
{
|
||||||
m_size.setWidth(width);
|
m_size.setWidth(width);
|
||||||
|
|
|
@ -41,13 +41,13 @@ public:
|
||||||
void enableBilinearFilter();
|
void enableBilinearFilter();
|
||||||
|
|
||||||
const Size& getSize() const { return m_size; }
|
const Size& getSize() const { return m_size; }
|
||||||
GLuint getTextureId() const { return m_textureId; }
|
unsigned int getTextureId() const { return m_textureId; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GLuint m_textureId;
|
unsigned int m_textureId;
|
||||||
Size m_size;
|
Size m_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef boost::shared_ptr<Texture> TexturePtr;
|
typedef std::shared_ptr<Texture> TexturePtr;
|
||||||
|
|
||||||
#endif // TEXTURE_H
|
#endif // TEXTURE_H
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "prerequisites.h"
|
#include "prerequisites.h"
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
|
|
||||||
typedef boost::weak_ptr<Texture> TextureWeakPtr;
|
typedef std::weak_ptr<Texture> TextureWeakPtr;
|
||||||
|
|
||||||
class TextureManager
|
class TextureManager
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
#include <physfs.h>
|
#include <physfs.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glext.h>
|
||||||
|
|
||||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
struct Win32PlatformPrivate {
|
struct Win32PlatformPrivate {
|
||||||
|
|
|
@ -108,7 +108,7 @@ int main(int argc, const char *argv[])
|
||||||
|
|
||||||
// state scope
|
// state scope
|
||||||
{
|
{
|
||||||
boost::scoped_ptr<MenuState> menuState(new MenuState);
|
std::unique_ptr<MenuState> menuState(new MenuState);
|
||||||
g_engine.changeState(menuState.get());
|
g_engine.changeState(menuState.get());
|
||||||
|
|
||||||
Platform::showWindow();
|
Platform::showWindow();
|
||||||
|
|
Loading…
Reference in New Issue