changes to prepare revgraphics

This commit is contained in:
Eduardo Bart
2011-12-01 17:38:46 -02:00
parent b1e1487745
commit 4afbe43e6f
12 changed files with 44 additions and 11508 deletions

View File

@@ -48,8 +48,7 @@ void Logger::log(Fw::LogLevel level, std::string message)
if(level == Fw::LogFatal) {
m_terminated = true;
g_platform.displayFatalError(message);
exit(-1);
throw std::runtime_error(message);
}
}

View File

@@ -30,10 +30,10 @@
#include <list>
struct LogMessage {
LogMessage(Fw::LogLevel level, const std::string& message, std::size_t when) : level(level), message(message), when(when) { }
Fw::LogLevel level;
std::string message;
std::size_t when;
LogMessage(Fw::LogLevel level, const std::string& message, std::size_t when) : level(level), message(message), when(when) { }
Fw::LogLevel level;
std::string message;
std::size_t when;
};
class Logger

View File

@@ -27,7 +27,7 @@
#include <framework/platform/platform.h>
#include <GL/gl.h>
#include <framework/thirdparty/glext.h>
#include <GL/glext.h>
PFNGLGENFRAMEBUFFERSPROC oglGenFramebuffers = 0;
PFNGLBINDFRAMEBUFFERPROC oglBindFramebuffer = 0;

View File

@@ -26,7 +26,7 @@
#include <framework/graphics/texture.h>
#include <GL/gl.h>
#include <framework/thirdparty/glext.h>
#include <GL/glext.h>
Graphics g_graphics;

View File

@@ -24,7 +24,7 @@
#include "graphics.h"
#include <GL/gl.h>
#include <framework/thirdparty/glext.h>
#include <GL/glext.h>
Texture::Texture()
{

View File

@@ -30,7 +30,7 @@ class OTMLNode : public std::enable_shared_from_this<OTMLNode>
public:
virtual ~OTMLNode() { }
static OTMLNodePtr create(std::string tag = Fw::empty_string, bool unique = false);
static OTMLNodePtr create(std::string tag = "", bool unique = false);
static OTMLNodePtr create(std::string tag, std::string value);
std::string tag() const { return m_tag; }

File diff suppressed because it is too large Load Diff

View File

@@ -29,10 +29,22 @@
#include <sstream>
#include <exception>
#include <cxxabi.h>
#include <chrono>
#include <unistd.h>
#include "types.h"
namespace Fw {
inline int getTicks() {
static auto firstTick = std::chrono::high_resolution_clock::now();
auto tickNow = std::chrono::high_resolution_clock::now();
return std::chrono::duration_cast<std::chrono::milliseconds>(tickNow - firstTick).count();
}
inline void sleep(int ms) {
usleep(ms);
}
// read utilities for istream
inline uint8 getU8(std::istream& in) {
uint8 tmp;
@@ -256,9 +268,6 @@ inline std::string ip2str(uint32 ip) {
return std::string(host);
}
// an empty string to use anywhere needed
const static std::string empty_string;
}
// shortcut for Fw::dump

View File

@@ -43,6 +43,8 @@
void OTClient::registerLuaFunctions()
{
using namespace std::placeholders;
g_lua.bindGlobalFunction("exit", std::bind(&OTClient::exit, &g_client));
g_lua.bindGlobalFunction("setOnClose", std::bind(&OTClient::setOnClose, &g_client, _1));
g_lua.bindGlobalFunction("importDat", std::bind(&ThingsType::load, &g_thingsType, _1));

View File

@@ -147,7 +147,7 @@ void OTClient::run()
g_platform.swapBuffers();
} else {
// sleeps until next poll to avoid massive cpu usage
g_platform.sleep(POLL_CYCLE_DELAY+1);
Fw::sleep(POLL_CYCLE_DELAY+1);
}
}