1. EuTigr Released!

Hi all,

I've finished my wrapper of the TIGR library for Euphoria. Note you'll need to use the 64-bit version of Euphoria to run it.

Grab it from here: https://github.com/gAndy50/EuTigr

include tigr.e 
 
procedure main() 
 
	atom screen = tigrWindow(100,100,"Hello World - Use arrow keys to change background color",TIGR_AUTO) 
	sequence colors = {0,0,0} 
	 
	while not tigrClosed(screen) and not tigrKeyDown(screen,TK_ESCAPE) do 
	 
		if tigrKeyDown(screen,TK_LEFT) then 
			colors = {255,0,0} 
			elsif tigrKeyDown(screen,TK_RIGHT) then 
				colors = {0,255,0} 
				elsif tigrKeyDown(screen,TK_UP) then 
					colors = {0,0,255} 
					elsif tigrKeyDown(screen,TK_DOWN) then 
						colors = {0,0,0} 
		end if 
		 
		tigrClear(screen,colors) 
		 
		tigrUpdate(screen) 
		 
	end while 
	 
	tigrFree(screen) 
	 
end procedure 
new topic     » topic index » view message » categorize

2. Re: EuTigr Released!

Icy_Viking said...

Note you'll need to use the 64-bit version of Euphoria to run it.

We can fix that with a few changes to our Makefile.

CFLAGS += -Os -s 
LDFLAGS += -shared 
TARGET = $(LIBPRE)tigr$(LIBEXT) 
ifeq ($(OS),Windows_NT) 
	CFLAGS += -DTIGR_SHARED 
	LDLIBS += -lopengl32 -lgdi32 
	LIBEXT := .dll 
else 
	CFLAGS += -fPIC 
	LIBPRE := lib 
	UNAME_S := $(shell uname -s) 
	ifeq ($(UNAME_S),Darwin) 
		LDLIBS += -framework OpenGL -framework Cocoa 
		LIBEXT := .dylib 
	else 
		LDLIBS += -lGLU -lGL -lX11 
		LIBEXT := .so 
	endif 
endif 
 
$(TARGET): tigr.c 
	gcc $(CFLAGS) -DTIGR_BUILDSHARED $(LDFLAGS) -o $@ $< $(LDLIBS) 

Now you can do this to create a separate 32-bit DLL:

mingw32-make CFLAGS=-m32 TARGET=tigr32.dll 

And even a separate 64-bit DLL if you want:

mingw32-make CFLAGS=-m64 TARGET=tigr64.dll 

Note: This only works on Windows with TDM-GCC-64 since it supports both architectures.

Icy_Viking said...
include tigr.e 
 
procedure main() 
 
	atom screen = tigrWindow(100,100,"Hello World - Use arrow keys to change background color",TIGR_AUTO) 
	sequence colors = {0,0,0} 
	 
	while not tigrClosed(screen) and not tigrKeyDown(screen,TK_ESCAPE) do 
	 
		if tigrKeyDown(screen,TK_LEFT) then 
			colors = {255,0,0} 
			elsif tigrKeyDown(screen,TK_RIGHT) then 
				colors = {0,255,0} 
				elsif tigrKeyDown(screen,TK_UP) then 
					colors = {0,0,255} 
					elsif tigrKeyDown(screen,TK_DOWN) then 
						colors = {0,0,0} 
		end if 
		 
		tigrClear(screen,colors) 
		 
		tigrUpdate(screen) 
		 
	end while 
	 
	tigrFree(screen) 
	 
end procedure 

What's

with
all
the
indents?

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: EuTigr Released!

ghaberek said...
Icy_Viking said...

Note you'll need to use the 64-bit version of Euphoria to run it.

We can fix that with a few changes to our Makefile.

CFLAGS += -Os -s 
LDFLAGS += -shared 
TARGET = $(LIBPRE)tigr$(LIBEXT) 
ifeq ($(OS),Windows_NT) 
	CFLAGS += -DTIGR_SHARED 
	LDLIBS += -lopengl32 -lgdi32 
	LIBEXT := .dll 
else 
	CFLAGS += -fPIC 
	LIBPRE := lib 
	UNAME_S := $(shell uname -s) 
	ifeq ($(UNAME_S),Darwin) 
		LDLIBS += -framework OpenGL -framework Cocoa 
		LIBEXT := .dylib 
	else 
		LDLIBS += -lGLU -lGL -lX11 
		LIBEXT := .so 
	endif 
endif 
 
$(TARGET): tigr.c 
	gcc $(CFLAGS) -DTIGR_BUILDSHARED $(LDFLAGS) -o $@ $< $(LDLIBS) 

Now you can do this to create a separate 32-bit DLL:

mingw32-make CFLAGS=-m32 TARGET=tigr32.dll 

And even a separate 64-bit DLL if you want:

mingw32-make CFLAGS=-m64 TARGET=tigr64.dll 

Note: This only works on Windows with TDM-GCC-64 since it supports both architectures.

Icy_Viking said...
include tigr.e 
 
procedure main() 
 
	atom screen = tigrWindow(100,100,"Hello World - Use arrow keys to change background color",TIGR_AUTO) 
	sequence colors = {0,0,0} 
	 
	while not tigrClosed(screen) and not tigrKeyDown(screen,TK_ESCAPE) do 
	 
		if tigrKeyDown(screen,TK_LEFT) then 
			colors = {255,0,0} 
			elsif tigrKeyDown(screen,TK_RIGHT) then 
				colors = {0,255,0} 
				elsif tigrKeyDown(screen,TK_UP) then 
					colors = {0,0,255} 
					elsif tigrKeyDown(screen,TK_DOWN) then 
						colors = {0,0,0} 
		end if 
		 
		tigrClear(screen,colors) 
		 
		tigrUpdate(screen) 
		 
	end while 
	 
	tigrFree(screen) 
	 
end procedure 

What's

with
all
the
indents?

-Greg

Thanks Greg. I made the indents so the code would be eaiser to read.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu