#opt = -O3 -ffast-math -fno-strict-aliasing
def = -DMINIGLUT_USE_LIBC -DGLEW_STATIC
incdir = -Isrc -Ilibs -Ilibs/imago/src -Ilibs/treestore -Ilibs/glew
-libdir = -Llibs/unix
+libs_path = libs/unix
+libdir = -L$(libs_path)
+
+libs = $(libs_path)/libimago.a $(libs_path)/libtreestore.a $(libs_path)/libanim.a \
+ $(libs_path)/libpsys.a
CFLAGS = $(warn) $(dbg) $(opt) $(def) $(incdir) -fcommon -MMD
LDFLAGS = $(libdir) $(libsys) $(libgl) -limago -lpsys -lanim -ltreestore $(libc)
bin = demo.exe
libgl = -lopengl32
libsys = -lmingw32 -lgdi32 -lwinmm -mconsole
- libdir = -Llibs/w32
+ libs_path = libs/w32
libc = -lm
else
libgl = -lGL -lX11 -lXext
libc = -lm -ldl
endif
-$(bin): $(obj) Makefile
+$(bin): $(obj) Makefile $(libs)
$(CC) -o $@ $(obj) $(LDFLAGS)
-include $(dep)
incdir = -Isrc -Ilibs -Ilibs/imago/src -Ilibs/treestore
libdir = -Llibs/android
+libs = libs/android/libimago.a libs/android/libtreestore.a libs/android/libanim.a \
+ libs/android/libpsys.a
+
CC = $(TC)clang
CFLAGS = $(CCSYSROOT) $(ISYS) $(warn) $(dbg) $(opt) $(def) $(incdir) -fPIC -fcommon -MMD
LDFLAGS = $(LDSYSROOT) $(libdir) -lm -landroid -llog -lEGL -lGLESv2 -limago -lpsys -lanim -ltreestore
cp -r sdr apkbuild/assets
aapt package -f -F $@ -I $(PLATFORM_JAR) -M AndroidManifest.xml apkbuild
-$(lib_so): $(obj) Makefile.android
+$(lib_so): $(obj) Makefile.android $(libs)
$(CC) -o $@ -shared -Wl,-soname,$(lib_so) $(obj) $(LDFLAGS)
-include $(dep)
lib = ../android/libanim.a
endif
-CFLAGS = -O3 -ffast-math -fno-strict-aliasing -I..
+CFLAGS = -g -ffast-math -fno-strict-aliasing -I..
$(lib): $(obj)
return -1;
}
anm_set_track_interpolator(&scr->track, ANM_INTERP_LINEAR);
- anm_set_track_extrapolator(&scr->track, ANM_EXTRAP_EXTEND);
+ anm_set_track_extrapolator(&scr->track, ANM_EXTRAP_CLAMP);
anm_set_track_default(&scr->track, 0);
dsys_screens[dsys_num_screens++] = scr;
#include "demo.h"
#include "noise.h"
+#include "cgmath/cgmath.h"
static int init(void);
static void destroy(void);
{
int i;
float t = dsys_time / 1000.0f;
+ float gap = cgm_lerp(0, 0.01, scr.vis);
glUseProgram(sdr_foo);
gl_begin(GL_QUADS);
for(i=0; i<16; i++) {
- float x0 = i / 8.0f - 1.0f + 0.01;
- float x1 = (i + 1) / 8.0f - 1.0f - 0.01;
- float y = noise2((float)i * 1.24f, t);
+ float x0 = i / 8.0f - 1.0f + gap;
+ float x1 = (i + 1) / 8.0f - 1.0f - gap;
+ float y = cgm_lerp(1.0f, noise2((float)i * 1.24f, t), scr.vis);
gl_vertex2f(x0, -1);
gl_vertex2f(x1, -1);
gl_vertex2f(x1, y);
#include "demo.h"
#include "noise.h"
+#include "cgmath/cgmath.h"
static int init(void);
static void destroy(void);
static unsigned int sdr_foo;
+static struct demoscreen scr = { "testb", init, destroy, 0, 0, 0, 0, draw };
+
void regscr_testb(void)
{
- static struct demoscreen scr = { "testb", init, destroy, 0, 0, 0, 0, draw };
dsys_add_screen(&scr);
}
y = (i + 0.5f) / (NY/2.0f) - 1.0f;
for(j=0; j<NX; j++) {
x = (j + 0.5f) / (NX/2.0f) - 1.0f;
- sz = noise2(x * 5.0f, t) * noise2(y * 5.0f, t) * 2.5f;
+ sz = cgm_lerp(1.0f, noise2(x * 5.0f, t) * noise2(y * 5.0f, t) * 2.5f, scr.vis);
if(sz < 0.0f) sz = 0.0f;
if(sz > 1.0f) sz = 1.0f;
xr = sz / NX;