use GLSL shaders

This commit is contained in:
Eduardo Bart
2011-12-06 22:31:55 -02:00
parent cf0aab6d4d
commit 7eead50806
64 changed files with 1219 additions and 630 deletions

View File

@@ -78,8 +78,8 @@ public:
void setBottomLeft(const TPoint<T> &p) { x1 = p.x; y2 = p.y; }
void setWidth(T width) { x2 = x1 + width - 1; }
void setHeight(T height) { y2 = y1 + height- 1; }
void setSize(T width, T height) { x2 = x1 + width - 1; y2 = y1 + height - 1; }
void setSize(const TSize<T>& size) { x2 = x1 + size.width() - 1; y2 = y1 + size.height() - 1; }
void resize(T width, T height) { x2 = x1 + width - 1; y2 = y1 + height - 1; }
void resize(const TSize<T>& size) { x2 = x1 + size.width() - 1; y2 = y1 + size.height() - 1; }
void setRect(T x, T y, T width, T height) { x1 = x; y1 = y; x2 = (x + width - 1); y2 = (y + height - 1); }
void setCoords(int left, int top, int right, int bottom) { x1 = left; y1 = top; x2 = right; y2 = bottom; }

View File

@@ -43,7 +43,7 @@ public:
int width() const { return wd; }
int height() const { return ht; }
void setSize(T w, T h) { wd = w; ht = h; }
void resize(T w, T h) { wd = w; ht = h; }
void setWidth(T w) { wd = w; }
void setHeight(T h) { ht = h; }
@@ -115,7 +115,7 @@ std::istream& operator>>(std::istream& in, TSize<T>& size)
{
T w, h;
in >> w >> h;
size.setSize(w, h);
size.resize(w, h);
return in;
}

View File

@@ -30,6 +30,8 @@
#include <sstream>
#include <exception>
#include <cxxabi.h>
#include <vector>
#include <boost/algorithm/string.hpp>
#include "types.h"
#include "exception.h"
@@ -258,6 +260,16 @@ inline std::string ip2str(uint32 ip) {
return std::string(host);
}
template<typename T = std::string>
std::vector<T> split(const std::string& str, const std::string& separators = " ") {
std::vector<std::string> splitted;
boost::split(splitted, str, boost::is_any_of(std::string(separators)));
std::vector<T> results(splitted.size());
for(uint i=0;i<splitted.size();++i)
results[i] = Fw::safeCast<T>(splitted[i]);
return results;
}
template<typename... T>
void throwException(const T&... args) {
throw Exception(Fw::mkstr(args...));