Refactor GLU usages in basis, and move opengl.glu to extra, and don't like VM with GLU
parent
b75e6ff445
commit
db3818814d
|
@ -1,3 +1,4 @@
|
||||||
Slava Pestov
|
Slava Pestov
|
||||||
Eduardo Cavazos
|
Eduardo Cavazos
|
||||||
Joe Groff
|
Joe Groff
|
||||||
|
Alex Chapman
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Slava Pestov
|
Alex Chapman
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Slava Pestov
|
|
|
@ -3,7 +3,7 @@
|
||||||
! Portions copyright (C) 2008 Joe Groff.
|
! Portions copyright (C) 2008 Joe Groff.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien alien.c-types continuations kernel libc math macros
|
USING: alien alien.c-types continuations kernel libc math macros
|
||||||
namespaces math.vectors math.parser opengl.gl opengl.glu combinators
|
namespaces math.vectors math.parser opengl.gl combinators
|
||||||
combinators.smart arrays sequences splitting words byte-arrays assocs
|
combinators.smart arrays sequences splitting words byte-arrays assocs
|
||||||
colors colors.constants accessors generalizations locals fry
|
colors colors.constants accessors generalizations locals fry
|
||||||
specialized-arrays.float specialized-arrays.uint ;
|
specialized-arrays.float specialized-arrays.uint ;
|
||||||
|
@ -16,10 +16,23 @@ IN: opengl
|
||||||
: gl-clear ( color -- )
|
: gl-clear ( color -- )
|
||||||
gl-clear-color GL_COLOR_BUFFER_BIT glClear ;
|
gl-clear-color GL_COLOR_BUFFER_BIT glClear ;
|
||||||
|
|
||||||
|
: error>string ( n -- string )
|
||||||
|
H{
|
||||||
|
{ HEX: 0 "No error" }
|
||||||
|
{ HEX: 0501 "Invalid value" }
|
||||||
|
{ HEX: 0500 "Invalid enumerant" }
|
||||||
|
{ HEX: 0502 "Invalid operation" }
|
||||||
|
{ HEX: 0503 "Stack overflow" }
|
||||||
|
{ HEX: 0504 "Stack underflow" }
|
||||||
|
{ HEX: 0505 "Out of memory" }
|
||||||
|
} at "Unknown error" or ;
|
||||||
|
|
||||||
|
TUPLE: gl-error code string ;
|
||||||
|
|
||||||
: gl-error ( -- )
|
: gl-error ( -- )
|
||||||
glGetError dup zero? [
|
glGetError dup 0 = [ drop ] [
|
||||||
"GL error: " over gluErrorString append throw
|
dup error>string \ gl-error boa throw
|
||||||
] unless drop ;
|
] if ;
|
||||||
|
|
||||||
: do-enabled ( what quot -- )
|
: do-enabled ( what quot -- )
|
||||||
over glEnable dip glDisable ; inline
|
over glEnable dip glDisable ; inline
|
||||||
|
@ -151,9 +164,6 @@ MACRO: all-enabled-client-state ( seq quot -- )
|
||||||
MACRO: set-draw-buffers ( buffers -- )
|
MACRO: set-draw-buffers ( buffers -- )
|
||||||
words>values '[ _ (set-draw-buffers) ] ;
|
words>values '[ _ (set-draw-buffers) ] ;
|
||||||
|
|
||||||
: gl-look-at ( eye focus up -- )
|
|
||||||
[ first3 ] tri@ gluLookAt ;
|
|
||||||
|
|
||||||
: gen-dlist ( -- id ) 1 glGenLists ;
|
: gen-dlist ( -- id ) 1 glGenLists ;
|
||||||
|
|
||||||
: make-dlist ( type quot -- id )
|
: make-dlist ( type quot -- id )
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2005, 2009 Slava Pestov.
|
! Copyright (C) 2005, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: math.rectangles math.vectors namespaces kernel accessors
|
USING: math.rectangles math.vectors namespaces kernel accessors
|
||||||
assocs combinators sequences opengl opengl.gl opengl.glu colors
|
assocs combinators sequences opengl opengl.gl colors
|
||||||
colors.constants ui.gadgets ui.pens ;
|
colors.constants ui.gadgets ui.pens ;
|
||||||
IN: ui.render
|
IN: ui.render
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ SYMBOL: viewport-translation
|
||||||
dim>>
|
dim>>
|
||||||
[ { 0 1 } v* viewport-translation set ]
|
[ { 0 1 } v* viewport-translation set ]
|
||||||
[ [ { 0 0 } ] dip gl-viewport ]
|
[ [ { 0 0 } ] dip gl-viewport ]
|
||||||
[ [ 0 ] dip first2 0 gluOrtho2D ] tri
|
[ [ 0 ] dip first2 0 1 -1 glOrtho ] tri
|
||||||
]
|
]
|
||||||
[ clip set ] bi
|
[ clip set ] bi
|
||||||
do-clip ;
|
do-clip ;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
USING: kernel namespaces math.vectors opengl 4DNav.turtle ;
|
USING: kernel namespaces math.vectors opengl opengl.glu 4DNav.turtle ;
|
||||||
|
|
||||||
IN: 4DNav.camera
|
IN: 4DNav.camera
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Alex Chapman
|
|
@ -1,8 +1,17 @@
|
||||||
! Copyright (C) 2005 Alex Chapman.
|
! Copyright (C) 2005 Alex Chapman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien alien.syntax kernel sequences words ;
|
USING: alien alien.libraries alien.syntax kernel sequences words system
|
||||||
|
combinators ;
|
||||||
IN: opengl.glu
|
IN: opengl.glu
|
||||||
|
|
||||||
|
os {
|
||||||
|
{ [ dup macosx? ] [ drop ] }
|
||||||
|
{ [ dup windows? ] [ drop ] }
|
||||||
|
{ [ dup unix? ] [ drop "glu" "libGLU.so.1" "cdecl" add-library ] }
|
||||||
|
} cond
|
||||||
|
|
||||||
|
LIBRARY: glu
|
||||||
|
|
||||||
! These are defined as structs in glu.h, but we only ever use pointers to them
|
! These are defined as structs in glu.h, but we only ever use pointers to them
|
||||||
TYPEDEF: void* GLUnurbs*
|
TYPEDEF: void* GLUnurbs*
|
||||||
TYPEDEF: void* GLUquadric*
|
TYPEDEF: void* GLUquadric*
|
||||||
|
@ -253,3 +262,6 @@ FUNCTION: GLint gluUnProject ( GLdouble winX, GLdouble winY, GLdouble winZ, GLdo
|
||||||
! FUNCTION: GLint gluBuild3DMipmaps ( GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* data ) ;
|
! FUNCTION: GLint gluBuild3DMipmaps ( GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* data ) ;
|
||||||
! FUNCTION: GLboolean gluCheckExtension ( GLubyte* extName, GLubyte* extString ) ;
|
! FUNCTION: GLboolean gluCheckExtension ( GLubyte* extName, GLubyte* extString ) ;
|
||||||
! FUNCTION: GLint gluUnProject4 ( GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, GLdouble* model, GLdouble* proj, GLint* view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW ) ;
|
! FUNCTION: GLint gluUnProject4 ( GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, GLdouble* model, GLdouble* proj, GLint* view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW ) ;
|
||||||
|
|
||||||
|
: gl-look-at ( eye focus up -- )
|
||||||
|
[ first3 ] tri@ gluLookAt ;
|
|
@ -14,7 +14,7 @@ PLAF_EXE_OBJS += vm/main-unix.o
|
||||||
ifdef NO_UI
|
ifdef NO_UI
|
||||||
X11_UI_LIBS =
|
X11_UI_LIBS =
|
||||||
else
|
else
|
||||||
X11_UI_LIBS = -lpango-1.0 -lpangocairo-1.0 -lcairo -lglib-2.0 -lgobject-2.0 -lGL -lGLU -lX11
|
X11_UI_LIBS = -lpango-1.0 -lpangocairo-1.0 -lcairo -lglib-2.0 -lgobject-2.0 -lGL -lX11
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# CFLAGS += -fPIC
|
# CFLAGS += -fPIC
|
||||||
|
|
Loading…
Reference in New Issue