!src/tests/*.cpp
!src/tests/*.h
src/*.dll
+*.exe
LIB_x86_64 = ../contrib/lib/libSDL2-2.0.so.0 -lGL -lgmp
LIB_i386 = ../contrib/lib32/libSDL2-2.0.so.0 -lGL -lgmp
LIB_i686 = $(LIB_i386)
-LIB_win32 = -mwindows -lmingw32 -L../contrib/win32/lib/ -lSDL2main -lSDL2 -lgmp -static-libgcc -static-libstdc++
+LIB_win32 = -mwindows -lmingw32 -L../contrib/win32/lib/ -lSDL2main -lSDL2 -lgmp -static-libgcc -lopengl32 -static-libstdc++
MAINRPATH_x86_64 = -Wl,-rpath,'$$ORIGIN/../contrib/lib'
MAINRPATH_i386 = -Wl,-rpath,'$$ORIGIN/../contrib/lib32'
TESTRPATH_x86_64 = -Wl,-rpath,'$$ORIGIN/../../contrib/lib'
TESTRPATH_i386 = -Wl,-rpath,'$$ORIGIN/../../contrib/lib32'
TESTRPATH_i686 = $(TESTRPATH_i386)
+TESTRPATH_win32 = -Wl,-rpath,'$$ORIGIN/../../contrib/win32/lib'
OBJPATHS = $(OBJ:%=../obj/%)
DEPS := $(OBJPATHS:%.o=%.d)
CFLAGS_x86_64 := -I../contrib/include/SDL2 -I`pwd`
// object_count clock delta_clock x Log10(x) y Log10(y) w Log10(w) Size(w)
#ifdef QUADTREE_DISABLED
printf("%d\t%llu\t%llu\t%s\t%f\t%s\t%f\t%s\t%f\t%u\n",
- now.object_count, (uint64_t)now.clock,
- (uint64_t)(now.clock - m_perf_last.clock),
+ now.object_count, (long long unsigned)now.clock,
+ (long long unsigned)(now.clock - m_perf_last.clock),
Str(now.view_bounds.x).c_str(), Log10(Abs(now.view_bounds.x)),
Str(now.view_bounds.y).c_str(), Log10(Abs(now.view_bounds.y)),
Str(now.view_bounds.w).c_str(), Log10(now.view_bounds.w),
- Size(now.view_bounds.w));
+ (unsigned)Size(now.view_bounds.w));
#endif
m_perf_last = now;
}
int main(int argc, char ** argv)
{
+ //Debug("Main!");
signal(SIGFPE, sigfpe_handler);
#if REALTYPE == REAL_IRRAM
iRRAM_initialize(argc,argv);
namespace IPDF
{
#ifdef TRANSFORM_BEZIERS_TO_PATH
- typedef ParanoidNumber PReal;
+ typedef Gmprat PReal;
#else
typedef Real PReal;
#endif
#include "common.h"
#include <cmath>
+#include <cfloat>
#define REAL_SINGLE 0
inline double Log10(double a) {return log(a)/log(10.0);}
inline size_t Size(double a) {return sizeof(a);}
inline size_t Size(float a) {return sizeof(a);}
+
+ // Don't cause an exception
+ inline float ClampFloat(double d)
+ {
+ float f = (fabs(d) < FLT_MAX) ? ((fabs(d) > FLT_MIN) ? (float)d : FLT_MIN) : FLT_MAX;
+ return copysign(f, d);
+ }
inline int64_t Int64(double a)
{
#include "bufferbuilder.h"
#include "shaderprogram.h"
+
+
#define BASICTEX_VERT "shaders/basictex_vert.glsl"
#define BASICTEX_FRAG "shaders/basictex_frag.glsl"
m_frame_begin_time = SDL_GetPerformanceCounter();
m_last_frame_time = 0;
m_last_frame_gpu_timer = 0;
+
glGenQueries(1, &m_frame_gpu_timer);
glBeginQuery(GL_TIME_ELAPSED, m_frame_gpu_timer);
-
#ifndef __MINGW32__
glDebugMessageCallback(opengl_debug_callback, 0);
#endif
bool ShaderProgram::AttachShader(const char * src_file, GLenum type)
{
GLuint shader_obj = glCreateShader(type);
- glObjectLabel(GL_SHADER, shader_obj, -1, src_file);
+ //glObjectLabel(GL_SHADER, shader_obj, -1, src_file);
char * src = GetShaderSource(src_file);
if (src == NULL)
{
obj_bounds = TransformToViewCoords(m_document.m_objects.bounds[id]);
}
GPUObjBounds gpu_bounds = {
- (float)Float(obj_bounds.x),
- (float)Float(obj_bounds.y),
- (float)Float(obj_bounds.x + obj_bounds.w),
- (float)Float(obj_bounds.y + obj_bounds.h)
+ Float(obj_bounds.x),
+ Float(obj_bounds.y),
+ Float(obj_bounds.x + obj_bounds.w),
+ Float(obj_bounds.y + obj_bounds.h)
};
obj_bounds_builder.Add(gpu_bounds);
if (!m_use_gpu_transform)
obj_bounds = TransformToViewCoords(obj_bounds);
GPUObjBounds gpu_bounds = {
- Float(obj_bounds.x),
- Float(obj_bounds.y),
- Float(obj_bounds.x + obj_bounds.w),
- Float(obj_bounds.y + obj_bounds.h)
+ ClampFloat(obj_bounds.x),
+ ClampFloat(obj_bounds.y),
+ ClampFloat(obj_bounds.x + obj_bounds.w),
+ ClampFloat(obj_bounds.y + obj_bounds.h)
};
obj_bounds_builder.Add(gpu_bounds);
//Debug("Path %d %s -> %s via %s", id, m_document.m_objects.bounds[id].Str().c_str(), obj_bounds.Str().c_str(), pbounds.Str().c_str());
}
GPUObjBounds p_gpu_bounds = {
- Float(pbounds.x),
- Float(pbounds.y),
- Float(pbounds.x + pbounds.w),
- Float(pbounds.y + pbounds.h)
+ ClampFloat(pbounds.x),
+ ClampFloat(pbounds.y),
+ ClampFloat(pbounds.x + pbounds.w),
+ ClampFloat(pbounds.y + pbounds.h)
};
obj_bounds_builder.Add(p_gpu_bounds);
}
namespace IPDF
{
#ifdef TRANSFORM_BEZIERS_TO_PATH
- typedef ParanoidNumber VReal;
+ typedef Gmprat VReal;
#else
typedef Real VReal;
#endif