Conflicts: src/mesa/array_cache/sources src/mesa/drivers/dri/i965/brw_context.c src/mesa/drivers/dri/i965/brw_draw.c src/mesa/drivers/dri/i965/brw_fallback.c src/mesa/drivers/dri/i965/brw_vs_emit.c src/mesa/drivers/dri/i965/brw_vs_tnl.c src/mesa/drivers/dri/mach64/mach64_context.c src/mesa/main/extensions.c src/mesa/main/getstring.c src/mesa/tnl/sources src/mesa/tnl/t_save_api.c src/mesa/tnl/t_save_playback.c src/mesa/tnl/t_vtx_api.c src/mesa/tnl/t_vtx_exec.c src/mesa/vbo/vbo_attrib.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_save_api.c src/mesa/vbo/vbo_save_draw.ctags/pre-merge-glsl-compiler-1
*~ | |||||
*.a | |||||
*.o | |||||
*.so | |||||
depend | |||||
depend.bak | |||||
lib | |||||
lib64 |
$(DIRECTORY)/include/GL/internal/glcore.h \ | $(DIRECTORY)/include/GL/internal/glcore.h \ | ||||
$(DIRECTORY)/include/GL/amesa.h \ | $(DIRECTORY)/include/GL/amesa.h \ | ||||
$(DIRECTORY)/include/GL/dmesa.h \ | $(DIRECTORY)/include/GL/dmesa.h \ | ||||
$(DIRECTORY)/include/GL/directfbgl.h \ | |||||
$(DIRECTORY)/include/GL/fxmesa.h \ | $(DIRECTORY)/include/GL/fxmesa.h \ | ||||
$(DIRECTORY)/include/GL/ggimesa.h \ | $(DIRECTORY)/include/GL/ggimesa.h \ | ||||
$(DIRECTORY)/include/GL/gl.h \ | $(DIRECTORY)/include/GL/gl.h \ | ||||
$(DIRECTORY)/src/mesa/depend \ | $(DIRECTORY)/src/mesa/depend \ | ||||
$(DIRECTORY)/src/mesa/main/*.[chS] \ | $(DIRECTORY)/src/mesa/main/*.[chS] \ | ||||
$(DIRECTORY)/src/mesa/main/descrip.mms \ | $(DIRECTORY)/src/mesa/main/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/main/sources \ | |||||
$(DIRECTORY)/src/mesa/glapi/*.[chS] \ | $(DIRECTORY)/src/mesa/glapi/*.[chS] \ | ||||
$(DIRECTORY)/src/mesa/glapi/descrip.mms \ | $(DIRECTORY)/src/mesa/glapi/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/glapi/sources \ | |||||
$(DIRECTORY)/src/mesa/array_cache/*.[ch] \ | $(DIRECTORY)/src/mesa/array_cache/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/array_cache/descrip.mms \ | $(DIRECTORY)/src/mesa/array_cache/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/array_cache/sources \ | |||||
$(DIRECTORY)/src/mesa/math/*.[ch] \ | $(DIRECTORY)/src/mesa/math/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/math/descrip.mms \ | $(DIRECTORY)/src/mesa/math/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/math/sources \ | |||||
$(DIRECTORY)/src/mesa/shader/*.[ch] \ | $(DIRECTORY)/src/mesa/shader/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/shader/descrip.mms \ | $(DIRECTORY)/src/mesa/shader/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/shader/sources \ | |||||
$(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \ | $(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/shader/grammar/descrip.mms \ | $(DIRECTORY)/src/mesa/shader/grammar/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/shader/grammar/sources \ | |||||
$(DIRECTORY)/src/mesa/shader/slang/*.[ch] \ | $(DIRECTORY)/src/mesa/shader/slang/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/shader/slang/descrip.mms \ | $(DIRECTORY)/src/mesa/shader/slang/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/shader/slang/sources \ | |||||
$(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \ | $(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/swrast/*.[ch] \ | $(DIRECTORY)/src/mesa/swrast/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/swrast/descrip.mms \ | $(DIRECTORY)/src/mesa/swrast/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/swrast/sources \ | |||||
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \ | $(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \ | $(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/swrast_setup/sources \ | |||||
$(DIRECTORY)/src/mesa/tnl/*.[chS] \ | $(DIRECTORY)/src/mesa/tnl/*.[chS] \ | ||||
$(DIRECTORY)/src/mesa/tnl/descrip.mms \ | $(DIRECTORY)/src/mesa/tnl/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/tnl/sources \ | |||||
$(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \ | $(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \ | $(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \ | $(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \ | ||||
$(DIRECTORY)/src/mesa/drivers/beos/Makefile \ | $(DIRECTORY)/src/mesa/drivers/beos/Makefile \ | ||||
$(DIRECTORY)/src/mesa/drivers/common/*.[ch] \ | $(DIRECTORY)/src/mesa/drivers/common/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/drivers/common/descrip.mms \ | $(DIRECTORY)/src/mesa/drivers/common/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/drivers/common/sources \ | |||||
$(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \ | $(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/drivers/directfb/Makefile \ | $(DIRECTORY)/src/mesa/drivers/directfb/Makefile \ | ||||
$(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \ | $(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \ | ||||
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \ | $(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \ | $(DIRECTORY)/src/mesa/drivers/windows/*/*.def \ | ||||
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \ | $(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \ | ||||
$(DIRECTORY)/src/mesa/drivers/x11/sources \ | |||||
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \ | $(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/ppc/*.[ch] \ | $(DIRECTORY)/src/mesa/ppc/*.[ch] \ | ||||
$(DIRECTORY)/src/mesa/sparc/*.[chS] \ | $(DIRECTORY)/src/mesa/sparc/*.[chS] \ |
elif [ -f "$FILE" ] ; then | elif [ -f "$FILE" ] ; then | ||||
#echo "$FILE" is a regular file | #echo "$FILE" is a regular file | ||||
$RM "$DEST/`basename $FILE`" | |||||
cp "$FILE" "$DEST" | cp "$FILE" "$DEST" | ||||
if [ $MODE ] ; then | if [ $MODE ] ; then | ||||
FILE=`basename "$FILE"` | FILE=`basename "$FILE"` |
ar -ruv ${LIBNAME} ${OBJECTS} | ar -ruv ${LIBNAME} ${OBJECTS} | ||||
FINAL_LIBS=${LIBNAME} | FINAL_LIBS=${LIBNAME} | ||||
else | else | ||||
LIBNAME="lib${LIBNAME}.so" | |||||
if [ $NOPREFIX = 0 ] ; then | |||||
LIBNAME="lib${LIBNAME}.so" | |||||
fi | |||||
echo "mklib: Making SunOS shared library: " ${LIBNAME} | echo "mklib: Making SunOS shared library: " ${LIBNAME} | ||||
if [ "x$LINK" = "x" ] ; then | if [ "x$LINK" = "x" ] ; then | ||||
# for debug: | # for debug: | ||||
#echo "mklib: linker is" ${LINK} ${OPTS} | #echo "mklib: linker is" ${LINK} ${OPTS} | ||||
rm -f ${LIBNAME}.${MAJOR} ${LIBNAME} | |||||
${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} | |||||
ln -s ${LIBNAME}.${MAJOR} ${LIBNAME} | |||||
if [ $NOPREFIX = 1 ] ; then | |||||
rm -f ${LIBNAME} | |||||
${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS} | |||||
else | |||||
rm -f ${LIBNAME}.${MAJOR} ${LIBNAME} | |||||
${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} | |||||
ln -s ${LIBNAME}.${MAJOR} ${LIBNAME} | |||||
fi | |||||
FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}" | FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}" | ||||
fi | fi | ||||
;; | ;; |
current |
LIBDRM_CFLAGS = `pkg-config --cflags libdrm` | LIBDRM_CFLAGS = `pkg-config --cflags libdrm` | ||||
LIBDRM_LIB = `pkg-config --libs libdrm` | LIBDRM_LIB = `pkg-config --libs libdrm` | ||||
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB) | DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB) | ||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread $(LIBDRM_LIB) | |||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \ | |||||
-lm -lpthread $(LIBDRM_LIB) | |||||
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm | GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm | ||||
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lX11 | GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lX11 |
LIBDRM_CFLAGS = `pkg-config --cflags libdrm` | LIBDRM_CFLAGS = `pkg-config --cflags libdrm` | ||||
LIBDRM_LIB = `pkg-config --libs libdrm` | LIBDRM_LIB = `pkg-config --libs libdrm` | ||||
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB) | DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB) | ||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \ | |||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \ | |||||
-lm -lpthread -ldl \ | |||||
$(LIBDRM_LIB) | $(LIBDRM_LIB) | ||||
# the new interface. i810 are missing because there is no x86-64 | # the new interface. i810 are missing because there is no x86-64 | ||||
# system where they could *ever* be used. | # system where they could *ever* be used. | ||||
# | # | ||||
DRI_DIRS = i915 mach64 mga r128 r200 radeon tdfx unichrome savage r300 | |||||
DRI_DIRS = i915tex i915 i965 mach64 mga r128 r200 radeon tdfx unichrome savage r300 | |||||
CONFIG_NAME = linux-fbdev | CONFIG_NAME = linux-fbdev | ||||
DRIVER_DIRS = fbdev | |||||
CFLAGS = -O3 -ffast-math -ansi -pedantic -fPIC -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -DUSE_GLFBDEV_DRIVER | |||||
SRC_DIRS = mesa glu glut/fbdev | SRC_DIRS = mesa glu glut/fbdev | ||||
CFLAGS = -O3 -ffast-math -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -DUSE_GLFBDEV_DRIVER | |||||
SRC_DIRS = mesa glu glut/fbdev | |||||
DRIVER_DIRS = fbdev | |||||
DRIVER_DIRS = fbdev osmesa | |||||
PROGRAM_DIRS = fbdev demos redbook samples | PROGRAM_DIRS = fbdev demos redbook samples | ||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread | GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread | ||||
OSMESA_LIB_DEPS = -lm -lpthread | |||||
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lgpm -lm | GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lgpm -lm | ||||
GLU_LIB_DEPS = | GLU_LIB_DEPS = | ||||
GLUT_LIB_DEPS = | GLUT_LIB_DEPS = | ||||
GLW_LIB_DEPS = | GLW_LIB_DEPS = | ||||
# Need to specify all libraries we may need | |||||
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm \ | |||||
-L/usr/X11R6/lib/ -lX11 -lXmu -lXi -lpthread | |||||
============ | ============ | ||||
To build Mesa with DirectFB (DirectFBGL) support you need: | To build Mesa with DirectFB (DirectFBGL) support you need: | ||||
- DirectFB at least 0.9.21 (http://directfb.org) | |||||
- DirectFB at least 1.0.0 (http://directfb.org) | |||||
- pkg-config at least 0.9 (http://pkgconfig.sf.net) | - pkg-config at least 0.9 (http://pkgconfig.sf.net) | ||||
Mesa 6.4.1 Release Notes | |||||
Introduction | |||||
------------ | |||||
Mesa uses an even/odd version number scheme like the Linux kernel. | |||||
Odd numbered versions (such as 6.3) designate new developmental releases. | |||||
Even numbered versions (such as 6.4) designate stable releases. | |||||
6.4.1 is a bug-fix release. See the VERSIONS file for details. | |||||
GLUT tarball | |||||
------------ | |||||
Starting with 6.4, the GLUT library sources are distributed in a separate | |||||
tarball. This was done at the request of Linux distro vendors who prefer | |||||
to use freeglut. | |||||
Driver Status | |||||
---------------------- ---------------------- | |||||
DRI drivers varies with the driver | |||||
XMesa (Xlib) implements OpenGL 1.5 | |||||
OSMesa (off-screen) implements OpenGL 1.5 | |||||
Windows/Win32 implements OpenGL 1.5 | |||||
Glide (3dfx Voodoo1/2) requires updates | |||||
SVGA requires updates | |||||
DJGPP requires updates | |||||
GGI requires updates | |||||
BeOS requires updates | |||||
Allegro requires updates | |||||
D3D requires updates | |||||
The drivers which require updates mostly need to be updated to work | |||||
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced | |||||
in Mesa 6.3. | |||||
---------------------------------------------------------------------- | |||||
$Id: RELNOTES-6.4.1,v 3.1 2006/02/03 17:21:54 brianp Exp $ |
Mesa 6.4.2 Release Notes | |||||
Introduction | |||||
------------ | |||||
Mesa uses an even/odd version number scheme like the Linux kernel. | |||||
Odd numbered versions (such as 6.3) designate new developmental releases. | |||||
Even numbered versions (such as 6.4) designate stable releases. | |||||
6.4.2 is a minor bug-fix release. See the VERSIONS file for details. | |||||
GLUT tarball | |||||
------------ | |||||
Starting with 6.4, the GLUT library sources are distributed in a separate | |||||
tarball. This was done at the request of Linux distro vendors who prefer | |||||
to use freeglut. | |||||
Driver Status | |||||
---------------------- ---------------------- | |||||
DRI drivers varies with the driver | |||||
XMesa (Xlib) implements OpenGL 1.5 | |||||
OSMesa (off-screen) implements OpenGL 1.5 | |||||
Windows/Win32 implements OpenGL 1.5 | |||||
Glide (3dfx Voodoo1/2) requires updates | |||||
SVGA requires updates | |||||
DJGPP requires updates | |||||
GGI requires updates | |||||
BeOS requires updates | |||||
Allegro requires updates | |||||
D3D requires updates | |||||
The drivers which require updates mostly need to be updated to work | |||||
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced | |||||
in Mesa 6.3. | |||||
---------------------------------------------------------------------- | |||||
$Id: RELNOTES-6.4.2,v 3.1 2006/02/03 17:21:54 brianp Exp $ |
Mesa 6.5 Release Notes | |||||
Introduction | |||||
------------ | |||||
Mesa uses an even/odd version number scheme like the Linux kernel. | |||||
Odd numbered versions (such as 6.5) designate new developmental releases. | |||||
Even numbered versions (such as 6.4) designate stable releases. | |||||
New Features | |||||
------------ | |||||
OpenGL Shading language support | |||||
This includes the GL_ARB_shader_objects, GL_ARB_shading_language_100, | |||||
GL_ARB_vertex_shader and GL_ARB_fragment_shader extensions. Most of | |||||
the work was done by Michal Krol. | |||||
There's probably a fair number of bugs since this is a pretty large, | |||||
complicated body of code. | |||||
The OpenGL 2.0 interface to these features will be implemented in a | |||||
future version of Mesa, | |||||
GL_EXT_timer_query | |||||
Used to measure the time of OpenGL operations at high precision. | |||||
Only supported in the software/Xlib driver at this time. | |||||
GL_EXT_packed_depth_stencil | |||||
Defines a new GL_DEPTH_STENCIL_EXT pixel format. | |||||
GL_EXT_framebuffer_blit | |||||
A simplified glCopyPixels-like feature for copying pixel rectangles. | |||||
GL_ARB_half_float_pixel | |||||
Adds a new half-precision floating point format for image transfers, | |||||
such as for glDrawPixels, glReadPixels, glTexImage, etc. | |||||
Removed Extensions | |||||
------------------ | |||||
The following extensions have been removed: | |||||
GL_HP_occlusion_test - this is superceded by GL_ARB_occlusion_query. | |||||
Known Issues | |||||
------------ | |||||
Rendering to depth textures will not work. Rendering to GL_DEPTH_STENCIL | |||||
textures should work. | |||||
Driver Interface Changes | |||||
------------------------ | |||||
Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by | |||||
the two-sided versions: Driver.Stencil*Separate(). | |||||
Render-to-texture: The functions for rendering to textures have changed. | |||||
To Do (someday) items | |||||
--------------------- | |||||
Switch to freeglut | |||||
Increase MAX_DRAWBUFFERS | |||||
Fix linux-glide target/driver. | |||||
Fix lambda calculation for frag progs. | |||||
Driver Status | |||||
---------------------- ---------------------- | |||||
DRI drivers varies with the driver | |||||
XMesa/GLX (on Xlib) implements OpenGL 1.5 | |||||
OSMesa (off-screen) implements OpenGL 1.5 | |||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3 | |||||
SVGA implements OpenGL 1.3 | |||||
Wind River UGL implements OpenGL 1.3 | |||||
Windows/Win32 implements OpenGL 1.5 | |||||
DJGPP implements OpenGL 1.5 | |||||
GGI implements OpenGL 1.3 | |||||
BeOS implements OpenGL 1.5 | |||||
Allegro needs updating | |||||
D3D needs updating | |||||
---------------------------------------------------------------------- | |||||
$Id: RELNOTES-6.5,v 3.4 2006/03/29 04:53:02 brianp Exp $ |
Mesa 6.5.1 Release Notes | |||||
Introduction | |||||
------------ | |||||
Mesa uses an even/odd version number scheme like the Linux kernel. | |||||
Odd numbered versions (such as 6.5) designate new developmental releases. | |||||
Even numbered versions (such as 6.4) designate stable releases. | |||||
Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of | |||||
bug fixes (see the VERSIONS file). | |||||
New Features | |||||
------------ | |||||
Intel i965 "broadwater" DRI driver | |||||
GL_APPLE_vertex_array_object - allows encapsulation of a set of vertex | |||||
arrays in an object. | |||||
GL_EXT_texture_sRGB - non-linearly mapped texture formats | |||||
GL_EXT_gpu_program_parameters - addes a few new functions for setting | |||||
multiple vertex/fragment program parameters with one call. | |||||
To Do (someday) items | |||||
--------------------- | |||||
Switch to freeglut | |||||
Increase MAX_DRAWBUFFERS | |||||
Fix linux-glide target/driver. | |||||
Fix lambda calculation for frag progs. | |||||
Driver Status | |||||
---------------------- ---------------------- | |||||
DRI drivers varies with the driver | |||||
XMesa/GLX (on Xlib) implements OpenGL 1.5 | |||||
OSMesa (off-screen) implements OpenGL 1.5 | |||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3 | |||||
SVGA implements OpenGL 1.3 | |||||
Wind River UGL implements OpenGL 1.3 | |||||
Windows/Win32 implements OpenGL 1.5 | |||||
DJGPP implements OpenGL 1.5 | |||||
GGI implements OpenGL 1.3 | |||||
BeOS implements OpenGL 1.5 | |||||
Allegro needs updating | |||||
D3D needs updating | |||||
---------------------------------------------------------------------- | |||||
$Id: RELNOTES-6.5.1,v 1.2 2006/08/18 20:24:54 brianp Exp $ |
<b>Developer Topics</b> | <b>Developer Topics</b> | ||||
<ul> | <ul> | ||||
<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a> | <li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a> | ||||
<li><a href="cvs_access.html" target="MainFrame">CVS Access</a> | |||||
<li><a href="cvs_branches.html" target="MainFrame">CVS Branch Info</a> | |||||
<li><a href="repository.html" target="MainFrame">Source Code Repository</a> | |||||
<li><a href="utilities.html" target="MainFrame">Utilities</a> | <li><a href="utilities.html" target="MainFrame">Utilities</a> | ||||
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a> | <li><a href="helpwanted.html" target="MainFrame">Help Wanted</a> | ||||
<li><a href="devinfo.html" target="MainFrame">Development Notes</a> | <li><a href="devinfo.html" target="MainFrame">Development Notes</a> |
<HTML> | |||||
<TITLE>CVS Access</TITLE> | |||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head> | |||||
<BODY> | |||||
<h1>CVS Access</h1> | |||||
<p> | |||||
Mesa's CVS repository (code management system) is hosted on | |||||
<a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>. | |||||
</p> | |||||
<p> | |||||
You may access the repository either as an | |||||
<a href="#anonymous">anonymous user</a> (read-only) or as a | |||||
<a href="#developer">developer</a> | |||||
(read/write). | |||||
</p> | |||||
<p> | |||||
You may also | |||||
<a href="http://freedesktop.org/cgi-bin/viewcvs.cgi/mesa/Mesa/" | |||||
target="_parent">browse the CVS repository</a>. | |||||
</p> | |||||
<a name="anonymous"> | |||||
<H2>Anonymous CVS Access</H2> | |||||
<p> | |||||
Anonymous, public, read-only access to the CVS repository is available. | |||||
Here are the basic instructions for Unix systems: | |||||
</p> | |||||
<ol> | |||||
<li>Install CVS client software on your computer if needed. | |||||
Version 1.9.28 is known to work. | |||||
<li>Login as an anonymous user: | |||||
<pre> | |||||
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa login | |||||
</pre> | |||||
Just press Enter/Return when prompted for a password. | |||||
<br> | |||||
<br> | |||||
<li>Check out the code: | |||||
<pre> | |||||
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa co Mesa | |||||
</pre> | |||||
</ol> | |||||
<p>To update your Mesa CVS source to the latest CVS source:</p> | |||||
<ol> | |||||
<li><code>cd Mesa</code> | |||||
<li><code>cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa update</code> | |||||
</ol> | |||||
<a name="developer"> | |||||
<H2>Developer CVS Access</H2> | |||||
<p> | |||||
Mesa developers working with the Mesa CVS repository need to first | |||||
have an account on <a href="http://www.freedesktop.org" target="_parent"> | |||||
freedesktop.org</a>. | |||||
To get an account, please ask Brian or the other Mesa developers for | |||||
permission. | |||||
Then, if there are no objections, follow this | |||||
<a href="http://www.freedesktop.org/wiki/AccountRequests" target="_parent"> | |||||
procedure</a>. | |||||
</p> | |||||
<p> | |||||
Once your account is established, you can check out the Mesa CVS tree | |||||
with: | |||||
<pre> | |||||
setenv CVS_RSH ssh (if using a csh-like shell) | |||||
</pre> | |||||
<em>OR</em> | |||||
<pre> | |||||
export CVS_RSH=rsh (if using a bash-like shell) | |||||
</pre> | |||||
followed by: | |||||
<pre> | |||||
cvs -d:ext:yourusername@cvs.freedesktop.org:/cvs/mesa co Mesa | |||||
</pre> | |||||
<p> | |||||
Of course, replace <em>yourusername</em> with your actual login name. | |||||
</p> | |||||
<p> | |||||
Subsequent updates should only require: | |||||
</p> | |||||
<pre> | |||||
cvs update | |||||
</pre> | |||||
</body> | |||||
</html> |
<HTML> | |||||
<TITLE>CVS Branches</TITLE> | |||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head> | |||||
<BODY> | |||||
<H1>CVS Branch Information</H1> | |||||
<p> | |||||
At any given time, there may be several active branches in Mesa's | |||||
CVS repository. | |||||
Generally, the CVS trunk contains the latest development (unstable) | |||||
code while a CVS branch has the latest stable code. | |||||
</p> | |||||
<p> | |||||
Currently (Oct 2004), the trunk is the Mesa 6.3 development code | |||||
while the mesa_6_2_branch branch has the stable Mesa 6.2.x code. | |||||
</p> | |||||
<p> | |||||
Mesa releases use an even/odd numbering scheme to represent stable/development | |||||
releases. | |||||
For example, Mesa 6.2 (0 is considered even) is a stable release while | |||||
Mesa 6.3 is a development release. | |||||
</p> | |||||
<p> | |||||
To checkout a specific CVS branch pass <code>-r</code> and | |||||
the branch tag after your CVS command. | |||||
For example <code>cvs checkout -r mesa_6_2_branch Mesa</code> will | |||||
checkout the 6.2 branch and <code>cvs update -r | |||||
mesa_6_2_branch</code> will convert your current CVS tree to the 6.2 | |||||
branch. | |||||
Consult <a href="http://www.durak.org/cvswebsites/doc/cvs_5.php3#SEC54" | |||||
target="_parent">http://www.durak.org/cvswebsites/doc/cvs_5.php3#SEC54</a> | |||||
for more on branching in CVS. | |||||
</p> | |||||
<p> | |||||
To see a list of all the CVS branches run <code>cvs log README</code> (or any | |||||
other file) and look for the section labeled <code>symbolic names</code>. | |||||
You'll see something like this: | |||||
</p> | |||||
<pre> symbolic names: | |||||
mesa_4_0: 1.3 | |||||
mesa_4_0_branch: 1.3.0.6 | |||||
mesa_3_5: 1.3 | |||||
mesa_3_4_2: 1.3 | |||||
mesa_3_4_1: 1.3 | |||||
mesa_3_4: 1.3 | |||||
mesa_3_4_branch: 1.3.0.4 | |||||
mesa_3_3: 1.3 | |||||
mesa_3_2_1: 1.1.1.1 | |||||
mesa_3_3_texture_env_combine2: 1.3.0.2 | |||||
mesa_3_2: 1.1.1.1 | |||||
mesa_3_2_beta_1: 1.1.1.1 | |||||
mesa_3_1: 1.1.1.1 | |||||
mesa_3_2_dev: 1.1.1.1.0.2 | |||||
mesa_3_1_beta_3: 1.1.1.1 | |||||
start: 1.1.1.1 | |||||
mesa: 1.1.1 | |||||
</pre> | |||||
<p> | |||||
Most will be obsolete branches. Generally, the newer branches are at | |||||
the top. Ask on the mesa3d-dev mailing list to learn which branches | |||||
are active. | |||||
</p> | |||||
</body> | |||||
</html> |
<H1>Downloading</H1> | <H1>Downloading</H1> | ||||
<p> | <p> | ||||
Last development release: <b>6.5.1</b> | |||||
Last development release: <b>6.5.2</b> | |||||
</p> | </p> | ||||
<p> | <p> |
<H1>Mailing Lists</H1> | <H1>Mailing Lists</H1> | ||||
<p>There are four Mesa mailing lists:</p> | |||||
<p>There are four Mesa mailing lists: | |||||
</p> | |||||
<ul> | <ul> | ||||
<li><b>mesa3d-users</b> - intended for users of the Mesa library. | |||||
Newbie questions are appropriate, but please try reading the Mesa documentation first. | |||||
</li><li><b>mesa3d-dev</b> - intended for developers of the Mesa library. | |||||
This is not for beginners. | |||||
</li><li><b>mesa3d-cvs</b> - CVS check-in messages are sent to this list. | |||||
This is useful for tracking ongoing development changes. | |||||
</li><li><b>mesa3d-announce</b> - announcements of new Mesa versions are sent to this list. | |||||
</li></ul> | |||||
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-announce" | |||||
target="_parent">mesa3d-announce</a> - announcements of new Mesa | |||||
versions are sent to this list. | |||||
</li> | |||||
<br> | |||||
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-users" | |||||
target="_parent">mesa3d-users</a> - intended for users of the Mesa library. | |||||
Newbie questions are appropriate, but please try the general OpenGL | |||||
resources and Mesa documentation first. | |||||
</li> | |||||
<br> | |||||
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-dev" | |||||
target="_parent">mesa3d-dev</a> - for discussion of Mesa development. | |||||
Not for beginners. | |||||
</li> | |||||
<br> | |||||
<li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-commit" | |||||
target="_parent">mesa-commit</a> - relays git check-in messages | |||||
(for developers). | |||||
</li> | |||||
</ul> | |||||
<p> | |||||
To subscribe or unsubscribe, go to the | |||||
<a href="http://www.sourceforge.net/mail/?group_id=3" target="_parent"> | |||||
SourceForge lists page.</a> | |||||
</p> | |||||
<p>Note: the old mesa3d-cvs list is no longer in use.</p> | |||||
<p>The mailing lists are managed by SourceForge. If you're having trouble | |||||
with the mailing lists please contact the SourceForge administrators for help.</p> | |||||
<br> | |||||
<p>Archives of the old Mesa mailing list which was hosted by unicamp.br | |||||
are available <a href="http://groups.yahoo.com/group/mesa/messages/" | |||||
target="_parent">here</a>.</p> | |||||
<H1>OpenGL Forums</H1> | |||||
<p> | <p> | ||||
Here are some other OpenGL-related forums you might find useful: | Here are some other OpenGL-related forums you might find useful: | ||||
</p> | </p> | ||||
<p> | |||||
Usenet newsgroups: | |||||
<ul> | <ul> | ||||
<li>comp.graphics.algorithms | |||||
<li>comp.graphics.api.opengl | |||||
<li>comp.os.linux.x | |||||
<li><a href="http://www.opengl.org/cgi-bin/ubb/ultimatebb.cgi" | |||||
target="_parent">OpenGL discussion forums</A> at www.opengl.org</li> | |||||
<li>Usenet newsgroups: | |||||
<ul> | |||||
<li>comp.graphics.algorithms</li> | |||||
<li>comp.graphics.api.opengl</li> | |||||
<li>comp.os.linux.x</li> | |||||
</ul> | |||||
</ul> | </ul> | ||||
</p> | |||||
<p> | |||||
<a href="http://www.opengl.org/" target="_parent">OpenGL discussion forums</A> | |||||
at www.opengl.org | |||||
</p> | |||||
</HTML> | </HTML> | ||||
</BODY> | </BODY> |
<p> | <p> | ||||
To do this, recompile Mesa with the compiler flag -DUSE_MGL_NAMESPACE. | To do this, recompile Mesa with the compiler flag -DUSE_MGL_NAMESPACE. | ||||
Add the flag to CFLAGS in the configuration file which you want to use. | Add the flag to CFLAGS in the configuration file which you want to use. | ||||
For example: | |||||
<pre> | |||||
CFLAGS += -DUSE_MGL_NAMESPACE | |||||
</pre> | |||||
</p> | </p> | ||||
<H1>News</H1> | <H1>News</H1> | ||||
<h2>December 5, 2006</h2> | |||||
<p> | |||||
Mesa is now using git as its source code management system. | |||||
The previous CVS repository should no longer be used. | |||||
See the <a href="repository.html">repository page</a> for more information. | |||||
</p> | |||||
<h2>December 2, 2006</h2> | |||||
<p> | |||||
<a href="relnotes-6.5.2.html">Mesa 6.5.2</a> has been released. | |||||
This is a new development release. | |||||
</p> | |||||
<h2>September 15, 2006</h2> | <h2>September 15, 2006</h2> | ||||
<p> | <p> | ||||
<a href="relnotes-6.5.1.html">Mesa 6.5.1</a> has been released. | <a href="relnotes-6.5.1.html">Mesa 6.5.1</a> has been released. | ||||
<hr> | <hr> | ||||
$Id: news.html,v 3.32 2006/09/21 22:51:16 brianp Exp $ | |||||
$Id: news.html,v 3.33 2006/12/02 18:18:41 brianp Exp $ | |||||
</body> | </body> | ||||
</html> | </html> |
<p> | <p> | ||||
Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of | Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of | ||||
<a href="versions.html#6.5.1">bug fixes</a>. | |||||
bug fixes. | |||||
</p> | </p> | ||||
<body bgcolor="#eeeeee"> | <body bgcolor="#eeeeee"> | ||||
<H1>Mesa 6.5.2 Release Notes / (in progress)</H1> | |||||
<H1>Mesa 6.5.2 Release Notes / December 2, 2006</H1> | |||||
<p> | <p> | ||||
Mesa 6.5.2 is a 6.5 follow-on development release mostly consisting of | |||||
<a href="versions.html#6.5.1">bug fixes</a>. | |||||
Mesa 6.5.2 is a 6.5 follow-on development release with a few new features | |||||
but mostly consisting of bug fixes. | |||||
</p> | </p> | ||||
<h2>MD5 checksums</h2> | <h2>MD5 checksums</h2> | ||||
<pre> | <pre> | ||||
11a033b078e090b3caaeb467234fe299 MesaLib-6.5.2.tar.gz | |||||
e4d894181f1859651658b3704633e10d MesaLib-6.5.2.tar.bz2 | |||||
63bf1d444fa738cca52ce1043e284021 MesaLib-6.5.2.zip | |||||
2b8f1375d16bda5f5a2304174cd5bcf7 MesaDemos-6.5.2.tar.gz | |||||
e870efe98d3a50be01ab211b9b2e25d9 MesaDemos-6.5.2.tar.bz2 | |||||
d92cc6f5fee5ca75af0be04f9f4908f0 MesaDemos-6.5.2.zip | |||||
8d4d77e3a7132f4217bbc7c1ab157030 MesaGLUT-6.5.2.tar.gz | |||||
e84edbb11c69c8e408dfadd2ed08e95b MesaGLUT-6.5.2.tar.bz2 | |||||
c6d7134843ed5faf11f6686ecb5d2a2e MesaGLUT-6.5.2.zip | |||||
</pre> | </pre> | ||||
<h2>New Features</h2> | |||||
<h2>New features</h2> | |||||
<ul> | <ul> | ||||
<li>New DRI memory manager system. Currently used by the i915tex driver. | |||||
Other DRI drivers will be updated to use the new memory manager in coming | |||||
months. | |||||
<br> | |||||
To use the new driver you'll need the most recent DRM library and drivers | |||||
(version 2.2 or later) and a recent xf86-video-intel driver module from X.org. | |||||
<br> | |||||
New features resulting from this work include: | |||||
<ul> | |||||
<li>EXT_framebuffer_objects, render to texture | |||||
<li>ARB_pixel_buffer_objects | |||||
<li>Accelerated CopyTexSubimage, DrawPixels, ReadPixels, CopyPixels | |||||
<li>Accelerated texture uploads from pixel buffer objects | |||||
<li>Potentially texturing directly from the pixel buffer object (zero | |||||
copy texturing). | |||||
</ul> | |||||
<li>New Intel i965 DRI driver | |||||
<li>New <code>minstall</code> script to replace normal install program | <li>New <code>minstall</code> script to replace normal install program | ||||
<li>Faster fragment program execution in software | <li>Faster fragment program execution in software | ||||
</ul> | |||||
<h2>Changes</h2> | |||||
<li>Added (or fixed) support for <a href="http://www.opengl.org/registry/specs/SGI/make_current_read.txt"> | |||||
GLX_SGI_make_current_read</a> to the following drivers:</li> | |||||
<ul> | |||||
<li>radeon</li> | |||||
<li>savage</li> | |||||
<li>mga</li> | |||||
<li>tdfx</li> | |||||
</ul> | |||||
<li>Added support for ARB_occlusion_query to the tdfx driver (Ian | |||||
Romanick).</li> | |||||
</ul> | </ul> | ||||
<h2>Bug fixes</h2> | <h2>Bug fixes</h2> | ||||
<li>glDrawPixels into a user-created framebuffer object could crash Xlib driver | <li>glDrawPixels into a user-created framebuffer object could crash Xlib driver | ||||
<li>Line clipping was broken in some circumstances | <li>Line clipping was broken in some circumstances | ||||
<li>fragment.fogcoord register didn't always contain the correct value | <li>fragment.fogcoord register didn't always contain the correct value | ||||
<li>RGBA logicops didn't work reliably in some DRI drivers | |||||
<li>Fixed broken RGBA LogicOps in Intel DRI drivers | |||||
<li>Fixed some fragment program bugs in Intel i915 DRI driver | |||||
<li>Fixed glGetVertexAttribfvARB bug 8883 | |||||
<li>Implemented glGetUniform[fi]vARB() functions | |||||
<li>Fixed glDrawPixels(GL_COLOR_INDEX, GL_BITMAP) segfault (bug 9044) | |||||
<li>Fixed some gluBuild2DMipmaps() bugs (Greg McGarragh) | |||||
<li>Fixed broken "mgl" name mangling | |||||
<li>Indirect rending was broken for glMap* functions (bug 8899) | |||||
</ul> | </ul> | ||||
<h2>Internal code changes</h2> | <h2>Internal code changes</h2> | ||||
<ul> | |||||
<li>The device driver functions ResizeBuffers and GetBufferSize have been | |||||
decprecated. | |||||
<li>OpenGL 2.0 and 2.1 support is nearly done. We need to do quite a bit | |||||
more testing of the shading language functions. | |||||
</ul> | |||||
<h2>To Do (someday) items</h2> | <h2>To Do (someday) items</h2> |
<HTML> | |||||
<TITLE>Mesa Release Notes</TITLE> | |||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head> | |||||
<BODY> | |||||
<body bgcolor="#eeeeee"> | |||||
<H1>Mesa 6.5.3 Release Notes / (in progress)</H1> | |||||
<p> | |||||
Mesa 6.5.3 is a 6.5 follow-on development release mostly consisting of | |||||
bug fixes</a>. | |||||
</p> | |||||
<h2>MD5 checksums</h2> | |||||
<pre> | |||||
TBD | |||||
</pre> | |||||
<h2>New features</h2> | |||||
<ul> | |||||
</ul> | |||||
<h2>Bug fixes</h2> | |||||
<ul> | |||||
<li>Fog was errantly applied when a fragment shader was enabled (bug 9346) | |||||
<li>glPush/PopClientAttrib didn't handle VBO bindings correctly (bug 9445) | |||||
<li>With 32-bit Z buffer, the fragment Z of lines and points was sometimes wrong. | |||||
</ul> | |||||
<h2>Internal code changes</h2> | |||||
<ul> | |||||
<li>The _MaintainTnlProgram, _MaintainTexEnvProgram, _TexEnvProgram and | |||||
_TnlProgram fields have been moved. | |||||
<li>The ctx->FragmentProgram._Active field has been removed. | |||||
<li>The ctx->Vertex/FragmentProgram._Current fields point to the program | |||||
in effect, whether it comes from a shader, user-program or generated | |||||
fixed-function program. | |||||
<li>The _UseTexEnvProgram field has been removed. | |||||
</ul> | |||||
<h2>To Do (someday) items</h2> | |||||
<ul> | |||||
<li>Switch to freeglut | |||||
<li>Increase MAX_DRAWBUFFERS | |||||
<li>Fix linux-glide target/driver. | |||||
<li>Improved lambda and derivative calculation for frag progs. | |||||
</ul> | |||||
<h2>Driver Status</h2> | |||||
<pre> | |||||
Driver Status | |||||
---------------------- ---------------------- | |||||
DRI drivers varies with the driver | |||||
XMesa/GLX (on Xlib) implements OpenGL 1.5 | |||||
OSMesa (off-screen) implements OpenGL 1.5 | |||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3 | |||||
SVGA implements OpenGL 1.3 | |||||
Wind River UGL implements OpenGL 1.3 | |||||
Windows/Win32 implements OpenGL 1.5 | |||||
DJGPP implements OpenGL 1.5 | |||||
GGI implements OpenGL 1.3 | |||||
BeOS implements OpenGL 1.5 | |||||
Allegro needs updating | |||||
D3D needs updating | |||||
</pre> | |||||
</body> | |||||
</html> |
</p> | </p> | ||||
<UL> | <UL> | ||||
<LI><A HREF="relnotes-6.5.3.html">6.5.3 release notes</A> | |||||
<LI><A HREF="relnotes-6.5.2.html">6.5.2 release notes</A> | <LI><A HREF="relnotes-6.5.2.html">6.5.2 release notes</A> | ||||
<LI><A HREF="relnotes-6.5.1.html">6.5.1 release notes</A> | <LI><A HREF="relnotes-6.5.1.html">6.5.1 release notes</A> | ||||
<LI><A HREF="relnotes-6.5.html">6.5 release notes</A> | <LI><A HREF="relnotes-6.5.html">6.5 release notes</A> |
<HTML> | |||||
<TITLE>Cocd Repository</TITLE> | |||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head> | |||||
<BODY> | |||||
<h1>Code Repository</h1> | |||||
<p> | |||||
As of December 5, 2006, Mesa is using | |||||
<a href="http://git.or.cz/"target="_parent">git</a> | |||||
as its source code management system. | |||||
CVS was used previously. | |||||
The old CVS repository should no longer be used. | |||||
</p> | |||||
The master git repository is hosted on | |||||
<a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>. | |||||
</p> | |||||
<p> | |||||
You may access the repository either as an | |||||
<a href="#anonymous">anonymous user</a> (read-only) or as a | |||||
<a href="#developer">developer</a> | |||||
(read/write). | |||||
</p> | |||||
<p> | |||||
You may also | |||||
<a href="http://gitweb.freedesktop.org/?p=mesa/mesa.git" | |||||
target="_parent">browse the git repository</a>. | |||||
</p> | |||||
<a name="anonymous"> | |||||
<H2>Anonymous git Access</H2> | |||||
<p> | |||||
To get the Mesa sources anonymously (read-only): | |||||
</p> | |||||
<ol> | |||||
<li>Install the git software on your computer if needed.<br><br> | |||||
<li>Get an initial, local copy of the repository with: | |||||
<pre> | |||||
git clone git://anongit.freedesktop.org/git/mesa/mesa | |||||
</pre> | |||||
<li>Later, you can update your tree from the master repository with: | |||||
<pre> | |||||
git pull origin | |||||
</pre> | |||||
</ol> | |||||
<a name="developer"> | |||||
<H2>Developer git Access</H2> | |||||
<p> | |||||
Mesa developers need to first have an account on | |||||
<a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>. | |||||
To get an account, please ask Brian or the other Mesa developers for | |||||
permission. | |||||
Then, if there are no objections, follow this | |||||
<a href="http://www.freedesktop.org/wiki/AccountRequests" target="_parent"> | |||||
procedure</a>. | |||||
</p> | |||||
<p> | |||||
Once your account is established: | |||||
</p> | |||||
<ol> | |||||
<li>Install the git software on your computer if needed.<br><br> | |||||
<li>Get an initial, local copy of the repository with: | |||||
<pre> | |||||
git clone git+ssh://username@git.freedesktop.org/git/mesa/mesa | |||||
</pre> | |||||
Replace <em>username</em> with your actual login name.<br><br> | |||||
<li>Later, you can update your tree from the master repository with: | |||||
<pre> | |||||
git pull origin | |||||
</pre> | |||||
</ol> | |||||
<a name="developer"> | |||||
<H2>Development Branches</H2> | |||||
<p> | |||||
At any given time, there may be several active branches in Mesa's | |||||
repository. | |||||
Generally, the trunk contains the latest development (unstable) | |||||
code while a branch has the latest stable code. | |||||
</p> | |||||
<p> | |||||
Questions about active Mesa development branches should be posted to | |||||
the mesa3d-dev mailing list. | |||||
</p> | |||||
</body> | |||||
</html> | |||||
#endif /* GL_ARB_shader_objects */ | #endif /* GL_ARB_shader_objects */ | ||||
/* | |||||
* ???. GL_MESA_trace | |||||
* XXX obsolete | |||||
*/ | |||||
#ifndef GL_MESA_trace | |||||
#define GL_MESA_trace 1 | |||||
#define GL_TRACE_ALL_BITS_MESA 0xFFFF | |||||
#define GL_TRACE_OPERATIONS_BIT_MESA 0x0001 | |||||
#define GL_TRACE_PRIMITIVES_BIT_MESA 0x0002 | |||||
#define GL_TRACE_ARRAYS_BIT_MESA 0x0004 | |||||
#define GL_TRACE_TEXTURES_BIT_MESA 0x0008 | |||||
#define GL_TRACE_PIXELS_BIT_MESA 0x0010 | |||||
#define GL_TRACE_ERRORS_BIT_MESA 0x0020 | |||||
#define GL_TRACE_MASK_MESA 0x8755 | |||||
#define GL_TRACE_NAME_MESA 0x8756 | |||||
GLAPI void GLAPIENTRY glEnableTraceMESA( GLbitfield mask ); | |||||
GLAPI void GLAPIENTRY glDisableTraceMESA( GLbitfield mask ); | |||||
GLAPI void GLAPIENTRY glNewTraceMESA( GLbitfield mask, const GLubyte * traceName ); | |||||
GLAPI void GLAPIENTRY glEndTraceMESA( void ); | |||||
GLAPI void GLAPIENTRY glTraceAssertAttribMESA( GLbitfield attribMask ); | |||||
GLAPI void GLAPIENTRY glTraceCommentMESA( const GLubyte * comment ); | |||||
GLAPI void GLAPIENTRY glTraceTextureMESA( GLuint name, const GLubyte* comment ); | |||||
GLAPI void GLAPIENTRY glTraceListMESA( GLuint name, const GLubyte* comment ); | |||||
GLAPI void GLAPIENTRY glTracePointerMESA( GLvoid* pointer, const GLubyte* comment ); | |||||
GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid* last, const GLubyte* comment ); | |||||
#endif /* GL_MESA_trace */ | |||||
/* | /* | ||||
* ???. GL_MESA_packed_depth_stencil | * ???. GL_MESA_packed_depth_stencil | ||||
* XXX obsolete | * XXX obsolete |
#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS) | #define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS) | ||||
#define glDisableClientState MANGLE(DisableClientState) | #define glDisableClientState MANGLE(DisableClientState) | ||||
#define glDisable MANGLE(Disable) | #define glDisable MANGLE(Disable) | ||||
#define glDisableTraceMESA MANGLE(DisableTraceMESA) | |||||
#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT) | #define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT) | ||||
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB) | #define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB) | ||||
#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray) | #define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray) | ||||
#define glElementPointerATI MANGLE(ElementPointerATI) | #define glElementPointerATI MANGLE(ElementPointerATI) | ||||
#define glEnableClientState MANGLE(EnableClientState) | #define glEnableClientState MANGLE(EnableClientState) | ||||
#define glEnable MANGLE(Enable) | #define glEnable MANGLE(Enable) | ||||
#define glEnableTraceMESA MANGLE(EnableTraceMESA) | |||||
#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT) | #define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT) | ||||
#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB) | #define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB) | ||||
#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray) | #define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray) | ||||
#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV) | #define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV) | ||||
#define glEndQueryARB MANGLE(EndQueryARB) | #define glEndQueryARB MANGLE(EndQueryARB) | ||||
#define glEndQuery MANGLE(EndQuery) | #define glEndQuery MANGLE(EndQuery) | ||||
#define glEndTraceMESA MANGLE(EndTraceMESA) | |||||
#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT) | #define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT) | ||||
#define glEvalCoord1d MANGLE(EvalCoord1d) | #define glEvalCoord1d MANGLE(EvalCoord1d) | ||||
#define glEvalCoord1dv MANGLE(EvalCoord1dv) | #define glEvalCoord1dv MANGLE(EvalCoord1dv) | ||||
#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf) | #define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf) | ||||
#define glNewList MANGLE(NewList) | #define glNewList MANGLE(NewList) | ||||
#define glNewObjectBufferATI MANGLE(NewObjectBufferATI) | #define glNewObjectBufferATI MANGLE(NewObjectBufferATI) | ||||
#define glNewTraceMESA MANGLE(NewTraceMESA) | |||||
#define glNormal3b MANGLE(Normal3b) | #define glNormal3b MANGLE(Normal3b) | ||||
#define glNormal3bv MANGLE(Normal3bv) | #define glNormal3bv MANGLE(Normal3bv) | ||||
#define glNormal3d MANGLE(Normal3d) | #define glNormal3d MANGLE(Normal3d) | ||||
#define glRectsv MANGLE(Rectsv) | #define glRectsv MANGLE(Rectsv) | ||||
#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX) | #define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX) | ||||
#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT) | #define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT) | ||||
#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT) | |||||
#define glRenderMode MANGLE(RenderMode) | #define glRenderMode MANGLE(RenderMode) | ||||
#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN) | #define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN) | ||||
#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN) | #define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN) | ||||
#define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX) | #define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX) | ||||
#define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX) | #define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX) | ||||
#define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX) | #define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX) | ||||
#define glStencilClearTagEXT MANGLE(StencilClearTagEXT) | |||||
#define glStencilFunc MANGLE(StencilFunc) | #define glStencilFunc MANGLE(StencilFunc) | ||||
#define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI) | #define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI) | ||||
#define glStencilFuncSeparate MANGLE(StencilFuncSeparate) | #define glStencilFuncSeparate MANGLE(StencilFuncSeparate) | ||||
#define glTextureLightEXT MANGLE(TextureLightEXT) | #define glTextureLightEXT MANGLE(TextureLightEXT) | ||||
#define glTextureMaterialEXT MANGLE(TextureMaterialEXT) | #define glTextureMaterialEXT MANGLE(TextureMaterialEXT) | ||||
#define glTextureNormalEXT MANGLE(TextureNormalEXT) | #define glTextureNormalEXT MANGLE(TextureNormalEXT) | ||||
#define glTraceAssertAttribMESA MANGLE(TraceAssertAttribMESA) | |||||
#define glTraceCommentMESA MANGLE(TraceCommentMESA) | |||||
#define glTraceListMESA MANGLE(TraceListMESA) | |||||
#define glTracePointerMESA MANGLE(TracePointerMESA) | |||||
#define glTracePointerRangeMESA MANGLE(TracePointerRangeMESA) | |||||
#define glTraceTextureMESA MANGLE(TraceTextureMESA) | |||||
#define glTrackMatrixNV MANGLE(TrackMatrixNV) | #define glTrackMatrixNV MANGLE(TrackMatrixNV) | ||||
#define glTranslated MANGLE(Translated) | #define glTranslated MANGLE(Translated) | ||||
#define glTranslatef MANGLE(Translatef) | #define glTranslatef MANGLE(Translatef) | ||||
#define glUniform4iv MANGLE(Uniform4iv) | #define glUniform4iv MANGLE(Uniform4iv) | ||||
#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB) | #define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB) | ||||
#define glUniformMatrix2fv MANGLE(UniformMatrix2fv) | #define glUniformMatrix2fv MANGLE(UniformMatrix2fv) | ||||
#define glUniformMatrix2x3fv MANGLE(UniformMatrix2x3fv) | |||||
#define glUniformMatrix2x4fv MANGLE(UniformMatrix2x4fv) | |||||
#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB) | #define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB) | ||||
#define glUniformMatrix3fv MANGLE(UniformMatrix3fv) | #define glUniformMatrix3fv MANGLE(UniformMatrix3fv) | ||||
#define glUniformMatrix3x2fv MANGLE(UniformMatrix3x2fv) | |||||
#define glUniformMatrix3x4fv MANGLE(UniformMatrix3x4fv) | |||||
#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB) | #define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB) | ||||
#define glUniformMatrix4fv MANGLE(UniformMatrix4fv) | #define glUniformMatrix4fv MANGLE(UniformMatrix4fv) | ||||
#define glUniformMatrix4x2fv MANGLE(UniformMatrix4x2fv) | |||||
#define glUniformMatrix4x3fv MANGLE(UniformMatrix4x3fv) | |||||
#define glUnlockArraysEXT MANGLE(UnlockArraysEXT) | #define glUnlockArraysEXT MANGLE(UnlockArraysEXT) | ||||
#define glUnmapBufferARB MANGLE(UnmapBufferARB) | #define glUnmapBufferARB MANGLE(UnmapBufferARB) | ||||
#define glUnmapBuffer MANGLE(UnmapBuffer) | #define glUnmapBuffer MANGLE(UnmapBuffer) |
/* | /* | ||||
* Mesa 3-D graphics library | * Mesa 3-D graphics library | ||||
* Version: 4.1 | |||||
* Copyright (C) 1995-1998 Brian Paul | |||||
* | |||||
* This library is free software; you can redistribute it and/or | |||||
* modify it under the terms of the GNU Library General Public | |||||
* License as published by the Free Software Foundation; either | |||||
* version 2 of the License, or (at your option) any later version. | |||||
* | |||||
* This library is distributed in the hope that it will be useful, | |||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||||
* Library General Public License for more details. | |||||
* | |||||
* You should have received a copy of the GNU Library General Public | |||||
* License along with this library; if not, write to the Free | |||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
* Version: 6.5 | |||||
* | |||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved. | |||||
* | |||||
* Permission is hereby granted, free of charge, to any person obtaining a | |||||
* copy of this software and associated documentation files (the "Software"), | |||||
* to deal in the Software without restriction, including without limitation | |||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |||||
* and/or sell copies of the Software, and to permit persons to whom the | |||||
* Software is furnished to do so, subject to the following conditions: | |||||
* | |||||
* The above copyright notice and this permission notice shall be included | |||||
* in all copies or substantial portions of the Software. | |||||
* | |||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | |||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||||
*/ | */ | ||||
#define glXGetVideoSyncSGI mglXGetVideoSyncSGI | #define glXGetVideoSyncSGI mglXGetVideoSyncSGI | ||||
#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI | #define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI | ||||
/* GLX 1.2 */ | |||||
#define glXGetCurrentDisplay mglXGetCurrentDisplay | |||||
/* GLX 1.3 */ | |||||
#define glXChooseFBConfig mglXChooseFBConfig | |||||
#define glXGetFBConfigAttrib mglXGetFBConfigAttrib | |||||
#define glXGetFBConfigs mglXGetFBConfigs | |||||
#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig | |||||
#define glXCreateWindow mglXCreateWindow | |||||
#define glXDestroyWindow mglXDestroyWindow | |||||
#define glXCreatePixmap mglXCreatePixmap | |||||
#define glXDestroyPixmap mglXDestroyPixmap | |||||
#define glXCreatePbuffer mglXCreatePbuffer | |||||
#define glXDestroyPbuffer mglXDestroyPbuffer | |||||
#define glXQueryDrawable mglXQueryDrawable | |||||
#define glXCreateNewContext mglXCreateNewContext | |||||
#define glXMakeContextCurrent mglXMakeContextCurrent | |||||
#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable | |||||
#define glXQueryContext mglXQueryContext | |||||
#define glXSelectEvent mglXSelectEvent | |||||
#define glXGetSelectedEvent mglXGetSelectedEvent | |||||
/* GLX 1.4 */ | /* GLX 1.4 */ | ||||
#define glXGetProcAddress mglXGetProcAddress | #define glXGetProcAddress mglXGetProcAddress | ||||
GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable, | GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable, | ||||
int32_t * numerator, int32_t * denominator); | int32_t * numerator, int32_t * denominator); | ||||
/*@}*/ | /*@}*/ | ||||
/** | |||||
* Reports areas of the given drawable which have been modified by the | |||||
* driver. | |||||
* | |||||
* \param drawable which the drawing was done to. | |||||
* \param rects rectangles affected, with the drawable origin as the | |||||
* origin. | |||||
* \param x X offset of the drawable within the screen (used in the | |||||
* front_buffer case) | |||||
* \param y Y offset of the drawable within the screen. | |||||
* \param front_buffer boolean flag for whether the drawing to the | |||||
* drawable was actually done directly to the front buffer (instead | |||||
* of backing storage, for example) | |||||
*/ | |||||
void (*reportDamage)(__DRInativeDisplay * dpy, int screen, | |||||
__DRIid drawable, | |||||
int x, int y, | |||||
drm_clip_rect_t *rects, int num_rects, | |||||
int front_buffer); | |||||
}; | }; | ||||
/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.7 2001/03/25 05:32:00 tsi Exp $ */ | |||||
#ifndef __gl_core_h_ | #ifndef __gl_core_h_ | ||||
#define __gl_core_h_ | #define __gl_core_h_ | ||||
** | ** | ||||
*/ | */ | ||||
#ifndef XFree86LOADER | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#endif | |||||
#ifdef CAPI | #ifdef CAPI | ||||
#undef CAPI | #undef CAPI |
fire \ | fire \ | ||||
fogcoord \ | fogcoord \ | ||||
fplight \ | fplight \ | ||||
fslight \ | |||||
gamma \ | gamma \ | ||||
gearbox \ | gearbox \ | ||||
gears \ | gears \ |
/** | |||||
* Test OpenGL 2.0 vertex/fragment shaders. | |||||
* Brian Paul | |||||
* 1 November 2006 | |||||
* | |||||
* Based on ARB version by: | |||||
* Michal Krol | |||||
* 20 February 2006 | |||||
* | |||||
* Based on the original demo by: | |||||
* Brian Paul | |||||
* 17 April 2003 | |||||
*/ | |||||
#include <assert.h> | |||||
#include <string.h> | |||||
#include <stdio.h> | |||||
#include <stdlib.h> | |||||
#include <math.h> | |||||
#include <GL/gl.h> | |||||
#include <GL/glut.h> | |||||
#include <GL/glext.h> | |||||
static GLfloat diffuse[4] = { 0.5f, 0.5f, 1.0f, 1.0f }; | |||||
static GLfloat specular[4] = { 0.8f, 0.8f, 0.8f, 1.0f }; | |||||
static GLfloat lightPos[4] = { 0.0f, 10.0f, 20.0f, 1.0f }; | |||||
static GLfloat delta = 1.0f; | |||||
static GLuint fragShader; | |||||
static GLuint vertShader; | |||||
static GLuint program; | |||||
static GLint uLightPos; | |||||
static GLint uDiffuse; | |||||
static GLint uSpecular; | |||||
static GLint win = 0; | |||||
static GLboolean anim = GL_TRUE; | |||||
static GLboolean wire = GL_FALSE; | |||||
static GLboolean pixelLight = GL_TRUE; | |||||
static GLint t0 = 0; | |||||
static GLint frames = 0; | |||||
static GLfloat xRot = 0.0f, yRot = 0.0f; | |||||
static PFNGLCREATESHADERPROC glCreateShader_func = NULL; | |||||
static PFNGLSHADERSOURCEPROC glShaderSource_func = NULL; | |||||
static PFNGLGETSHADERSOURCEPROC glGetShaderSource_func = NULL; | |||||
static PFNGLCOMPILESHADERPROC glCompileShader_func = NULL; | |||||
static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL; | |||||
static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL; | |||||
static PFNGLDELETESHADERPROC glDeleteShader_func = NULL; | |||||
static PFNGLATTACHSHADERPROC glAttachShader_func = NULL; | |||||
static PFNGLLINKPROGRAMPROC glLinkProgram_func = NULL; | |||||
static PFNGLUSEPROGRAMPROC glUseProgram_func = NULL; | |||||
static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation_func = NULL; | |||||
static PFNGLISPROGRAMPROC glIsProgram_func = NULL; | |||||
static PFNGLISSHADERPROC glIsShader_func = NULL; | |||||
static PFNGLUNIFORM3FVPROC glUniform3fv_func = NULL; | |||||
static PFNGLUNIFORM3FVPROC glUniform4fv_func = NULL; | |||||
static void | |||||
normalize(GLfloat *dst, const GLfloat *src) | |||||
{ | |||||
GLfloat len = sqrtf(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]); | |||||
dst[0] = src[0] / len; | |||||
dst[1] = src[1] / len; | |||||
dst[2] = src[2] / len; | |||||
} | |||||
static void | |||||
Redisplay(void) | |||||
{ | |||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | |||||
if (pixelLight) { | |||||
GLfloat vec[3]; | |||||
glUseProgram_func(program); | |||||
normalize(vec, lightPos); | |||||
glUniform3fv_func(uLightPos, 1, vec); | |||||
glDisable(GL_LIGHTING); | |||||
} | |||||
else { | |||||
glUseProgram_func(0); | |||||
glLightfv(GL_LIGHT0, GL_POSITION, lightPos); | |||||
glEnable(GL_LIGHTING); | |||||
} | |||||
glPushMatrix(); | |||||
glRotatef(xRot, 1.0f, 0.0f, 0.0f); | |||||
glRotatef(yRot, 0.0f, 1.0f, 0.0f); | |||||
glutSolidSphere(2.0, 10, 5); | |||||
glPopMatrix(); | |||||
glutSwapBuffers(); | |||||
frames++; | |||||
if (anim) { | |||||
GLint t = glutGet(GLUT_ELAPSED_TIME); | |||||
if (t - t0 >= 5000) { | |||||
GLfloat seconds =(GLfloat)(t - t0) / 1000.0f; | |||||
GLfloat fps = frames / seconds; | |||||
printf("%d frames in %6.3f seconds = %6.3f FPS\n", | |||||
frames, seconds, fps); | |||||
t0 = t; | |||||
frames = 0; | |||||
} | |||||
} | |||||
} | |||||
static void | |||||
Idle(void) | |||||
{ | |||||
lightPos[0] += delta; | |||||
if (lightPos[0] > 25.0f || lightPos[0] < -25.0f) | |||||
delta = -delta; | |||||
glutPostRedisplay(); | |||||
} | |||||
static void | |||||
Reshape(int width, int height) | |||||
{ | |||||
glViewport(0, 0, width, height); | |||||
glMatrixMode(GL_PROJECTION); | |||||
glLoadIdentity(); | |||||
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0); | |||||
glMatrixMode(GL_MODELVIEW); | |||||
glLoadIdentity(); | |||||
glTranslatef(0.0f, 0.0f, -15.0f); | |||||
} | |||||
static void | |||||
CleanUp(void) | |||||
{ | |||||
glDeleteShader_func(fragShader); | |||||
glDeleteShader_func(vertShader); | |||||
glDeleteProgram_func(program); | |||||
glutDestroyWindow(win); | |||||
} | |||||
static void | |||||
Key(unsigned char key, int x, int y) | |||||
{ | |||||
(void) x; | |||||
(void) y; | |||||
switch(key) { | |||||
case ' ': | |||||
case 'a': | |||||
anim = !anim; | |||||
if (anim) | |||||
glutIdleFunc(Idle); | |||||
else | |||||
glutIdleFunc(NULL); | |||||
break; | |||||
case 'x': | |||||
lightPos[0] -= 1.0f; | |||||
break; | |||||
case 'X': | |||||
lightPos[0] += 1.0f; | |||||
break; | |||||
case 'w': | |||||
wire = !wire; | |||||
if (wire) | |||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); | |||||
else | |||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); | |||||
break; | |||||
case 'p': | |||||
pixelLight = !pixelLight; | |||||
if (pixelLight) | |||||
printf("Per-pixel lighting\n"); | |||||
else | |||||
printf("Conventional lighting\n"); | |||||
break; | |||||
case 27: | |||||
CleanUp(); | |||||
exit(0); | |||||
break; | |||||
} | |||||
glutPostRedisplay(); | |||||
} | |||||
static void | |||||
SpecialKey(int key, int x, int y) | |||||
{ | |||||
const GLfloat step = 3.0f; | |||||
(void) x; | |||||
(void) y; | |||||
switch(key) { | |||||
case GLUT_KEY_UP: | |||||
xRot -= step; | |||||
break; | |||||
case GLUT_KEY_DOWN: | |||||
xRot += step; | |||||
break; | |||||
case GLUT_KEY_LEFT: | |||||
yRot -= step; | |||||
break; | |||||
case GLUT_KEY_RIGHT: | |||||
yRot += step; | |||||
break; | |||||
} | |||||
glutPostRedisplay(); | |||||
} | |||||
static void | |||||
Init(void) | |||||
{ | |||||
static const char *fragShaderText = | |||||
"uniform vec3 lightPos;\n" | |||||
"uniform vec4 diffuse;\n" | |||||
"uniform vec4 specular;\n" | |||||
"varying vec3 normal;\n" | |||||
"void main() {\n" | |||||
" // Compute dot product of light direction and normal vector\n" | |||||
" float dotProd = max(dot(lightPos, normalize(normal)), 0.0);\n" | |||||
" // Compute diffuse and specular contributions\n" | |||||
" gl_FragColor = diffuse * dotProd + specular * pow(dotProd, 20.0);\n" | |||||
"}\n"; | |||||
static const char *vertShaderText = | |||||
"varying vec3 normal;\n" | |||||
"void main() {\n" | |||||
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" | |||||
" normal = gl_NormalMatrix * gl_Normal;\n" | |||||
"}\n"; | |||||
const char *version; | |||||
version = (const char *) glGetString(GL_VERSION); | |||||
if (version[0] != '2' || version[1] != '.') { | |||||
printf("Warning: this program expects OpenGL 2.0\n"); | |||||
/*exit(1);*/ | |||||
} | |||||
glCreateShader_func = (PFNGLCREATESHADERPROC) glutGetProcAddress("glCreateShader"); | |||||
glDeleteShader_func = (PFNGLDELETESHADERPROC) glutGetProcAddress("glDeleteShader"); | |||||
glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) glutGetProcAddress("glDeleteProgram"); | |||||
glShaderSource_func = (PFNGLSHADERSOURCEPROC) glutGetProcAddress("glShaderSource"); | |||||
glGetShaderSource_func = (PFNGLGETSHADERSOURCEPROC) glutGetProcAddress("glGetShaderSource"); | |||||
glCompileShader_func = (PFNGLCOMPILESHADERPROC) glutGetProcAddress("glCompileShader"); | |||||
glCreateProgram_func = (PFNGLCREATEPROGRAMPROC) glutGetProcAddress("glCreateProgram"); | |||||
glAttachShader_func = (PFNGLATTACHSHADERPROC) glutGetProcAddress("glAttachShader"); | |||||
glLinkProgram_func = (PFNGLLINKPROGRAMPROC) glutGetProcAddress("glLinkProgram"); | |||||
glUseProgram_func = (PFNGLUSEPROGRAMPROC) glutGetProcAddress("glUseProgram"); | |||||
glGetUniformLocation_func = (PFNGLGETUNIFORMLOCATIONPROC) glutGetProcAddress("glGetUniformLocation"); | |||||
glIsProgram_func = (PFNGLISPROGRAMPROC) glutGetProcAddress("glIsProgram"); | |||||
glIsShader_func = (PFNGLISSHADERPROC) glutGetProcAddress("glIsShader"); | |||||
glUniform3fv_func = (PFNGLUNIFORM3FVPROC) glutGetProcAddress("glUniform3fv"); | |||||
glUniform4fv_func = (PFNGLUNIFORM3FVPROC) glutGetProcAddress("glUniform4fv"); | |||||
fragShader = glCreateShader_func(GL_FRAGMENT_SHADER); | |||||
glShaderSource_func(fragShader, 1, &fragShaderText, NULL); | |||||
glCompileShader_func(fragShader); | |||||
vertShader = glCreateShader_func(GL_VERTEX_SHADER); | |||||
glShaderSource_func(vertShader, 1, &vertShaderText, NULL); | |||||
glCompileShader_func(vertShader); | |||||
program = glCreateProgram_func(); | |||||
glAttachShader_func(program, fragShader); | |||||
glAttachShader_func(program, vertShader); | |||||
glLinkProgram_func(program); | |||||
glUseProgram_func(program); | |||||
uLightPos = glGetUniformLocation_func(program, "lightPos"); | |||||
uDiffuse = glGetUniformLocation_func(program, "diffuse"); | |||||
uSpecular = glGetUniformLocation_func(program, "specular"); | |||||
glUniform4fv_func(uDiffuse, 1, diffuse); | |||||
glUniform4fv_func(uSpecular, 1, specular); | |||||
glClearColor(0.3f, 0.3f, 0.3f, 0.0f); | |||||
glEnable(GL_DEPTH_TEST); | |||||
glEnable(GL_LIGHT0); | |||||
glEnable(GL_LIGHTING); | |||||
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse); | |||||
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular); | |||||
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 20.0f); | |||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); | |||||
printf("Press p to toggle between per-pixel and per-vertex lighting\n"); | |||||
/* test glGetShaderSource() */ | |||||
{ | |||||
GLsizei len = strlen(fragShaderText) + 1; | |||||
GLsizei lenOut; | |||||
GLchar *src =(GLchar *) malloc(len * sizeof(GLchar)); | |||||
glGetShaderSource_func(fragShader, 0, NULL, src); | |||||
glGetShaderSource_func(fragShader, len, &lenOut, src); | |||||
assert(len == lenOut + 1); | |||||
assert(strcmp(src, fragShaderText) == 0); | |||||
free(src); | |||||
} | |||||
assert(glIsProgram_func(program)); | |||||
assert(glIsShader_func(fragShader)); | |||||
assert(glIsShader_func(vertShader)); | |||||
} | |||||
int | |||||
main(int argc, char *argv[]) | |||||
{ | |||||
glutInit(&argc, argv); | |||||
glutInitWindowPosition( 0, 0); | |||||
glutInitWindowSize(200, 200); | |||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); | |||||
win = glutCreateWindow(argv[0]); | |||||
glutReshapeFunc(Reshape); | |||||
glutKeyboardFunc(Key); | |||||
glutSpecialFunc(SpecialKey); | |||||
glutDisplayFunc(Redisplay); | |||||
if (anim) | |||||
glutIdleFunc(Idle); | |||||
Init(); | |||||
glutMainLoop(); | |||||
return 0; | |||||
} | |||||
#include <math.h> | #include <math.h> | ||||
#include <directfb.h> | #include <directfb.h> | ||||
#include <directfbgl.h> | |||||
#include <GL/gl.h> | #include <GL/gl.h> | ||||
#include <GL/directfbgl.h> | |||||
/* the super interface */ | /* the super interface */ |
#include <unistd.h> | #include <unistd.h> | ||||
#include <directfb.h> | #include <directfb.h> | ||||
#include <directfbgl.h> | |||||
#include <GL/gl.h> | #include <GL/gl.h> | ||||
#include <GL/directfbgl.h> | |||||
/* the super interface */ | /* the super interface */ |
#include <math.h> | #include <math.h> | ||||
#include <directfb.h> | #include <directfb.h> | ||||
#include <directfbgl.h> | |||||
#include <GL/glu.h> | #include <GL/glu.h> | ||||
#include <GL/directfbgl.h> | |||||
#include "util/showbuffer.c" | #include "util/showbuffer.c" | ||||
#include "util/readtex.c" | #include "util/readtex.c" |
/* $Id: cva.c,v 1.7 2003/12/08 09:03:35 joukj Exp $ */ | |||||
/* $Id: cva.c,v 1.8 2006/11/22 19:37:21 sroland Exp $ */ | |||||
/* | /* | ||||
* Trivial CVA test, good for testing driver fastpaths (especially | * Trivial CVA test, good for testing driver fastpaths (especially | ||||
{ | { | ||||
GLenum type; | GLenum type; | ||||
char *string; | char *string; | ||||
double version; | |||||
glutInit( &argc, argv ); | glutInit( &argc, argv ); | ||||
*/ | */ | ||||
string = (char *) glGetString( GL_VERSION ); | string = (char *) glGetString( GL_VERSION ); | ||||
if ( !strstr(string, "1.2") && | |||||
!strstr(string, "1.3") && | |||||
!strstr(string, "1.4")) { | |||||
version = atof(string); | |||||
if ( version < 1.2 ) { | |||||
fprintf( stderr, "This program requires OpenGL 1.2 vertex arrays.\n" ); | fprintf( stderr, "This program requires OpenGL 1.2 vertex arrays.\n" ); | ||||
exit( -1 ); | exit( -1 ); | ||||
} | } |
} | } | ||||
static GLboolean | |||||
test_StencilFuncSeparate(generic_func func) | |||||
{ | |||||
#ifdef GL_VERSION_2_0 | |||||
PFNGLSTENCILFUNCSEPARATEPROC stencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) func; | |||||
GLint frontFunc, backFunc; | |||||
GLint frontRef, backRef; | |||||
GLint frontMask, backMask; | |||||
(*stencilFuncSeparate)(GL_BACK, GL_GREATER, 2, 0xa); | |||||
glGetIntegerv(GL_STENCIL_FUNC, &frontFunc); | |||||
glGetIntegerv(GL_STENCIL_BACK_FUNC, &backFunc); | |||||
glGetIntegerv(GL_STENCIL_REF, &frontRef); | |||||
glGetIntegerv(GL_STENCIL_BACK_REF, &backRef); | |||||
glGetIntegerv(GL_STENCIL_VALUE_MASK, &frontMask); | |||||
glGetIntegerv(GL_STENCIL_BACK_VALUE_MASK, &backMask); | |||||
if (frontFunc != GL_ALWAYS || | |||||
backFunc != GL_GREATER || | |||||
frontRef != 0 || | |||||
backRef != 2 || | |||||
frontMask == 0xa || /* might be 0xff or ~0 */ | |||||
backMask != 0xa) | |||||
return GL_FALSE; | |||||
#endif | |||||
return GL_TRUE; | |||||
} | |||||
static GLboolean | |||||
test_StencilOpSeparate(generic_func func) | |||||
{ | |||||
#ifdef GL_VERSION_2_0 | |||||
PFNGLSTENCILOPSEPARATEPROC stencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) func; | |||||
GLint frontFail, backFail; | |||||
GLint frontZFail, backZFail; | |||||
GLint frontZPass, backZPass; | |||||
(*stencilOpSeparate)(GL_BACK, GL_INCR, GL_DECR, GL_INVERT); | |||||
glGetIntegerv(GL_STENCIL_FAIL, &frontFail); | |||||
glGetIntegerv(GL_STENCIL_BACK_FAIL, &backFail); | |||||
glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, &frontZFail); | |||||
glGetIntegerv(GL_STENCIL_BACK_PASS_DEPTH_FAIL, &backZFail); | |||||
glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, &frontZPass); | |||||
glGetIntegerv(GL_STENCIL_BACK_PASS_DEPTH_PASS, &backZPass); | |||||
if (frontFail != GL_KEEP || | |||||
backFail != GL_INCR || | |||||
frontZFail != GL_KEEP || | |||||
backZFail != GL_DECR || | |||||
frontZPass != GL_KEEP || | |||||
backZPass != GL_INVERT) | |||||
return GL_FALSE; | |||||
#endif | |||||
return GL_TRUE; | |||||
} | |||||
static GLboolean | |||||
test_StencilMaskSeparate(generic_func func) | |||||
{ | |||||
#ifdef GL_VERSION_2_0 | |||||
PFNGLSTENCILMASKSEPARATEPROC stencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) func; | |||||
GLint frontMask, backMask; | |||||
(*stencilMaskSeparate)(GL_BACK, 0x1b); | |||||
glGetIntegerv(GL_STENCIL_WRITEMASK, &frontMask); | |||||
glGetIntegerv(GL_STENCIL_BACK_WRITEMASK, &backMask); | |||||
if (frontMask == 0x1b || | |||||
backMask != 0x1b) | |||||
return GL_FALSE; | |||||
#endif | |||||
return GL_TRUE; | |||||
} | |||||
/* | /* | ||||
* The following file is auto-generated with Python. | * The following file is auto-generated with Python. | ||||
*/ | */ | ||||
for (entry = functions; entry->name; entry++) { | for (entry = functions; entry->name; entry++) { | ||||
if (entry->name[0] == '-') { | if (entry->name[0] == '-') { | ||||
/* XXX update for OpenGL 2.0 */ | |||||
const char *version = (const char *) glGetString(GL_VERSION); | |||||
if (entry->name[1] == '1') { | if (entry->name[1] == '1') { | ||||
/* check GL version X.Y */ | |||||
const char *version = (const char *) glGetString(GL_VERSION); | |||||
if (version[0] == entry->name[1] && | |||||
version[1] == entry->name[2] && | |||||
/* check GL version 1.x */ | |||||
if (version[0] == '1' && | |||||
version[1] == '.' && | |||||
version[2] >= entry->name[3]) | |||||
doTests = 1; | |||||
else | |||||
doTests = 0; | |||||
} | |||||
else if (entry->name[1] == '2') { | |||||
if (version[0] == '2' && | |||||
version[1] == '.' && | |||||
version[2] >= entry->name[3]) | version[2] >= entry->name[3]) | ||||
doTests = 1; | doTests = 1; | ||||
else | else | ||||
GLX_RED_SIZE, 1, | GLX_RED_SIZE, 1, | ||||
GLX_GREEN_SIZE, 1, | GLX_GREEN_SIZE, 1, | ||||
GLX_BLUE_SIZE, 1, | GLX_BLUE_SIZE, 1, | ||||
GLX_STENCIL_SIZE, 1, | |||||
None }; | None }; | ||||
int attribDouble[] = { | int attribDouble[] = { | ||||
GLX_RGBA, | GLX_RGBA, | ||||
GLX_RED_SIZE, 1, | GLX_RED_SIZE, 1, | ||||
GLX_GREEN_SIZE, 1, | GLX_GREEN_SIZE, 1, | ||||
GLX_BLUE_SIZE, 1, | GLX_BLUE_SIZE, 1, | ||||
GLX_STENCIL_SIZE, 1, | |||||
GLX_DOUBLEBUFFER, | GLX_DOUBLEBUFFER, | ||||
None }; | None }; | ||||
GLfloat tcm = 4.0; | GLfloat tcm = 4.0; | ||||
printf("BASE_LEVEL = %d MAX_LEVEL = %d MIN_LOD = %f MAX_LOD = %f Bias = %.2g filter = %s\n", | printf("BASE_LEVEL = %d MAX_LEVEL = %d MIN_LOD = %f MAX_LOD = %f Bias = %.2g filter = %s\n", | ||||
BaseLevel, MaxLevel, MinLod, MaxLod, LodBias, | BaseLevel, MaxLevel, MinLod, MaxLod, LodBias, | ||||
NearestFilter ? "LINEAR" : "NEAREST"); | |||||
NearestFilter ? "NEAREST" : "LINEAR"); | |||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel); | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel); | ||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel); | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel); | ||||
pbinfo \ | pbinfo \ | ||||
pbdemo \ | pbdemo \ | ||||
wincopy \ | wincopy \ | ||||
xdemo \ | |||||
xfont \ | xfont \ | ||||
xrotfontdemo \ | xrotfontdemo \ | ||||
yuvrect_client | yuvrect_client | ||||
# omit this XMesa API demo: xdemo | |||||
##### RULES ##### | ##### RULES ##### |
dpy = XOpenDisplay(displayName); | dpy = XOpenDisplay(displayName); | ||||
if (!dpy) { | if (!dpy) { | ||||
fprintf(stderr, "Unable to open display %s\n", displayName); | |||||
fprintf(stderr, "Unable to open display %s\n", XDisplayName(displayName)); | |||||
return -1; | return -1; | ||||
} | } | ||||
} | } |
dpy = XOpenDisplay(dpyName); | dpy = XOpenDisplay(dpyName); | ||||
if (!dpy) { | if (!dpy) { | ||||
printf("Error: couldn't open display %s\n", | |||||
dpyName ? dpyName : getenv("DISPLAY")); | |||||
fprintf(stderr, "Error: couldn't open display %s\n", | |||||
XDisplayName(dpyName)); | |||||
return -1; | return -1; | ||||
} | } | ||||
dpy = XOpenDisplay(dpyName); | dpy = XOpenDisplay(dpyName); | ||||
if (!dpy) { | if (!dpy) { | ||||
printf("Error: couldn't open display %s\n", dpyName); | |||||
printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); | |||||
return -1; | return -1; | ||||
} | } | ||||
static void | static void | ||||
Error(const char *display, const char *msg) | Error(const char *display, const char *msg) | ||||
{ | { | ||||
fprintf(stderr, "Error on display %s - %s\n", display, msg); | |||||
fprintf(stderr, "Error on display %s - %s\n", XDisplayName(display), msg); | |||||
exit(1); | exit(1); | ||||
} | } | ||||
} | } | ||||
printf("display: %s screen: %d\n", displayName, scrnum); | printf("display: %s screen: %d\n", displayName, scrnum); | ||||
free(displayName); | free(displayName); | ||||
printf("direct rendering: %s\n", glXIsDirect(dpy, ctx) ? "Yes" : "No"); | |||||
printf("direct rendering: "); | |||||
if (glXIsDirect(dpy, ctx)) { | |||||
printf("Yes\n"); | |||||
} else { | |||||
if (!allowDirect) { | |||||
printf("No (-i specified)\n"); | |||||
} else if (getenv("LIBGL_ALWAYS_INDIRECT")) { | |||||
printf("No (LIBGL_ALWAYS_INDIRECT set)\n"); | |||||
} else { | |||||
printf("No (If you want to find out why, try setting " | |||||
"LIBGL_DEBUG=verbose)\n"); | |||||
} | |||||
} | |||||
printf("server glx vendor string: %s\n", serverVendor); | printf("server glx vendor string: %s\n", serverVendor); | ||||
printf("server glx version string: %s\n", serverVersion); | printf("server glx version string: %s\n", serverVersion); | ||||
printf("server glx extensions:\n"); | printf("server glx extensions:\n"); | ||||
dpy = XOpenDisplay(displayName); | dpy = XOpenDisplay(displayName); | ||||
if (!dpy) { | if (!dpy) { | ||||
fprintf(stderr, "Error: unable to open display %s\n", displayName); | |||||
fprintf(stderr, "Error: unable to open display %s\n", XDisplayName(displayName)); | |||||
return -1; | return -1; | ||||
} | } | ||||
dpy = XOpenDisplay(dpyName); | dpy = XOpenDisplay(dpyName); | ||||
if (!dpy) { | if (!dpy) { | ||||
printf("Error: couldn't open display %s\n", dpyName); | |||||
printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); | |||||
return -1; | return -1; | ||||
} | } | ||||
static void | static void | ||||
Error(const char *display, const char *msg) | Error(const char *display, const char *msg) | ||||
{ | { | ||||
fprintf(stderr, "Error on display %s - %s\n", display, msg); | |||||
fprintf(stderr, "Error on display %s - %s\n", XDisplayName(display), msg); | |||||
exit(1); | exit(1); | ||||
} | } | ||||
dpy = XOpenDisplay(dpyName); | dpy = XOpenDisplay(dpyName); | ||||
if (!dpy) { | if (!dpy) { | ||||
printf("Error: couldn't open display %s\n", dpyName); | |||||
printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); | |||||
exit(1); | exit(1); | ||||
} | } | ||||
dpy = XOpenDisplay(dpyName); | dpy = XOpenDisplay(dpyName); | ||||
if (!dpy) { | if (!dpy) { | ||||
printf("Error: couldn't open display %s\n", dpyName ? dpyName : ":0"); | |||||
printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); | |||||
return 1; | return 1; | ||||
} | } | ||||
dpy = XOpenDisplay(dpyName); | dpy = XOpenDisplay(dpyName); | ||||
if (!dpy) { | if (!dpy) { | ||||
printf("Error: couldn't open display %s\n", | printf("Error: couldn't open display %s\n", | ||||
dpyName ? dpyName : getenv("DISPLAY")); | |||||
XDisplayName(dpyName)); | |||||
return -1; | return -1; | ||||
} | } | ||||
Version | Version | ||||
10 (10 August 2005) | |||||
11 (27 January 2006) | |||||
Number | Number | ||||
isn't always reliable (consider video projectors) but can still be | isn't always reliable (consider video projectors) but can still be | ||||
used to determine the pixel aspect ratio. | used to determine the pixel aspect ratio. | ||||
Arguments for: | |||||
X supports a similar query with DisplayWidthMM(), DisplayHeightMM(). | |||||
If this information can be easily queried with EDID, why not | |||||
make it available to the user? | |||||
Arguments against: | |||||
Historically, these values aren't always accurate. Also, they're | |||||
not always applicable to the display device. | |||||
Other options: | |||||
Perhaps just a pixel aspect ratio should be supported. [M. Danzer] | |||||
Postpone for a future extension, if needed. [A. Jackson] | |||||
Resolution: Omit. The EGL 1.2 specification includes queries for | |||||
the display resolution and pixel aspect ratio. | |||||
6. Should detailed mode timing information be exposed by this API? | 6. Should detailed mode timing information be exposed by this API? | ||||
14. What if the physical screen size can't be determined? Should | 14. What if the physical screen size can't be determined? Should | ||||
a query of EGL_PHYSICAL_SIZE_MESA return [0,0]? | a query of EGL_PHYSICAL_SIZE_MESA return [0,0]? | ||||
TBD. | |||||
Obsolete: EGL_PHYSICAL_SIZE_MESA not used. | |||||
15. Suppose the device's number of RAMDACs is different from the | 15. Suppose the device's number of RAMDACs is different from the | ||||
EGL_SCREEN_COUNT_MESA | EGL_SCREEN_COUNT_MESA | ||||
EGL_SCREEN_POSITION_MESA | EGL_SCREEN_POSITION_MESA | ||||
EGL_PHYSICAL_SIZE_MESA | |||||
EGL_SCREEN_BIT_MESA | EGL_SCREEN_BIT_MESA | ||||
EGL_SCREEN_POSITION_GRANULARITY_MESA | EGL_SCREEN_POSITION_GRANULARITY_MESA | ||||
EGL_SCREEN_POSITION_GRANULARITY_MESA | EGL_SCREEN_POSITION_GRANULARITY_MESA | ||||
Returns the granularity, in pixels, for | Returns the granularity, in pixels, for | ||||
which the screen position is constrained. | which the screen position is constrained. | ||||
EGL_PHYSICAL_SIZE_MESA Physical width and height of the screen | |||||
in millimeters | |||||
Any other token will generate the error EGL_BAD_ATTRIBUTE. | Any other token will generate the error EGL_BAD_ATTRIBUTE. | ||||
10. 10 August 2005 - BrianP | 10. 10 August 2005 - BrianP | ||||
Added EGL_SCREEN_POSITION_GRANULARITY_MESA. | Added EGL_SCREEN_POSITION_GRANULARITY_MESA. | ||||
11. 27 January 2006 - BrianP | |||||
EGL_PHYSICAL_SIZE_MESA removed since EGL 1.2 has a similar feature. | |||||
{ | { | ||||
int i, j, k; | int i, j, k; | ||||
int newwidth, newheight; | int newwidth, newheight; | ||||
int padBytes; | |||||
GLubyte *s; | GLubyte *s; | ||||
const char *t; | const char *t; | ||||
newwidth = width / 2; | newwidth = width / 2; | ||||
newheight = height / 2; | newheight = height / 2; | ||||
padBytes = ysize - (width*group_size); | |||||
s = dataout; | s = dataout; | ||||
t = (const char *)datain; | t = (const char *)datain; | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
} | } | ||||
{ | { | ||||
int i, j, k; | int i, j, k; | ||||
int newwidth, newheight; | int newwidth, newheight; | ||||
int padBytes; | |||||
GLbyte *s; | GLbyte *s; | ||||
const char *t; | const char *t; | ||||
newwidth = width / 2; | newwidth = width / 2; | ||||
newheight = height / 2; | newheight = height / 2; | ||||
padBytes = ysize - (width*group_size); | |||||
s = dataout; | s = dataout; | ||||
t = (const char *)datain; | t = (const char *)datain; | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
} | } | ||||
{ | { | ||||
int i, j, k; | int i, j, k; | ||||
int newwidth, newheight; | int newwidth, newheight; | ||||
int padBytes; | |||||
GLushort *s; | GLushort *s; | ||||
const char *t; | const char *t; | ||||
newwidth = width / 2; | newwidth = width / 2; | ||||
newheight = height / 2; | newheight = height / 2; | ||||
padBytes = ysize - (width*group_size); | |||||
s = dataout; | s = dataout; | ||||
t = (const char *)datain; | t = (const char *)datain; | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
else | else | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
} | } | ||||
{ | { | ||||
int i, j, k; | int i, j, k; | ||||
int newwidth, newheight; | int newwidth, newheight; | ||||
int padBytes; | |||||
GLshort *s; | GLshort *s; | ||||
const char *t; | const char *t; | ||||
newwidth = width / 2; | newwidth = width / 2; | ||||
newheight = height / 2; | newheight = height / 2; | ||||
padBytes = ysize - (width*group_size); | |||||
s = dataout; | s = dataout; | ||||
t = (const char *)datain; | t = (const char *)datain; | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
else | else | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
} | } | ||||
{ | { | ||||
int i, j, k; | int i, j, k; | ||||
int newwidth, newheight; | int newwidth, newheight; | ||||
int padBytes; | |||||
GLuint *s; | GLuint *s; | ||||
const char *t; | const char *t; | ||||
newwidth = width / 2; | newwidth = width / 2; | ||||
newheight = height / 2; | newheight = height / 2; | ||||
padBytes = ysize - (width*group_size); | |||||
s = dataout; | s = dataout; | ||||
t = (const char *)datain; | t = (const char *)datain; | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
else | else | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
} | } | ||||
{ | { | ||||
int i, j, k; | int i, j, k; | ||||
int newwidth, newheight; | int newwidth, newheight; | ||||
int padBytes; | |||||
GLint *s; | GLint *s; | ||||
const char *t; | const char *t; | ||||
newwidth = width / 2; | newwidth = width / 2; | ||||
newheight = height / 2; | newheight = height / 2; | ||||
padBytes = ysize - (width*group_size); | |||||
s = dataout; | s = dataout; | ||||
t = (const char *)datain; | t = (const char *)datain; | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
else | else | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
} | } | ||||
{ | { | ||||
int i, j, k; | int i, j, k; | ||||
int newwidth, newheight; | int newwidth, newheight; | ||||
int padBytes; | |||||
GLfloat *s; | GLfloat *s; | ||||
const char *t; | const char *t; | ||||
newwidth = width / 2; | newwidth = width / 2; | ||||
newheight = height / 2; | newheight = height / 2; | ||||
padBytes = ysize - (width*group_size); | |||||
s = dataout; | s = dataout; | ||||
t = (const char *)datain; | t = (const char *)datain; | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
else | else | ||||
} | } | ||||
t += group_size; | t += group_size; | ||||
} | } | ||||
t += padBytes; | |||||
t += ysize; | t += ysize; | ||||
} | } | ||||
} | } | ||||
if (width == newwidth && height == newheight) { | if (width == newwidth && height == newheight) { | ||||
/* Use usersImage for level userLevel */ | /* Use usersImage for level userLevel */ | ||||
if (baseLevel <= level && level <= maxLevel) { | if (baseLevel <= level && level <= maxLevel) { | ||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); | |||||
glTexImage2D(target, level, internalFormat, width, | glTexImage2D(target, level, internalFormat, width, | ||||
height, 0, format, type, | height, 0, format, type, | ||||
usersImage); | usersImage); | ||||
} | } | ||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); | |||||
if(levels == 0) { /* we're done. clean up and return */ | if(levels == 0) { /* we're done. clean up and return */ | ||||
glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); | glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); | ||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); | glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); | ||||
int halfHeight= height / 2; | int halfHeight= height / 2; | ||||
int halfDepth= depth / 2; | int halfDepth= depth / 2; | ||||
const char *src= (const char *)dataIn; | const char *src= (const char *)dataIn; | ||||
int padBytes= rowSizeInBytes - (width * groupSizeInBytes); | |||||
int rowPadBytes= rowSizeInBytes - (width * groupSizeInBytes); | |||||
int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes); | |||||
int outIndex= 0; | int outIndex= 0; | ||||
assert((width == 1 || height == 1) && depth >= 2); | assert((width == 1 || height == 1) && depth >= 2); | ||||
/* skip over to next horizontal square of 4 */ | /* skip over to next horizontal square of 4 */ | ||||
src+= groupSizeInBytes; | src+= groupSizeInBytes; | ||||
} /* for jj */ | } /* for jj */ | ||||
src+= padBytes; | |||||
src+= rowPadBytes; | |||||
src+= rowSizeInBytes; | src+= rowSizeInBytes; | ||||
} /* for ii */ | } /* for ii */ | ||||
src+= elementSizeInBytes; | src+= elementSizeInBytes; | ||||
} /* for cc */ | } /* for cc */ | ||||
src+= padBytes; | |||||
src+= rowPadBytes; | |||||
/* skip over to next vertical square of 4 */ | /* skip over to next vertical square of 4 */ | ||||
src+= rowSizeInBytes; | src+= rowSizeInBytes; | ||||
} /* for jj */ | } /* for jj */ | ||||
src+= imagePadBytes; | |||||
src+= imageSizeInBytes; | src+= imageSizeInBytes; | ||||
} /* for ii */ | } /* for ii */ | ||||
int halfHeight= height / 2; | int halfHeight= height / 2; | ||||
int halfDepth= depth / 2; | int halfDepth= depth / 2; | ||||
const char *src= (const char *) dataIn; | const char *src= (const char *) dataIn; | ||||
int padBytes= rowSizeInBytes - (width*groupSizeInBytes); | |||||
int rowPadBytes= rowSizeInBytes - (width*groupSizeInBytes); | |||||
int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes); | |||||
int outIndex= 0; | int outIndex= 0; | ||||
for (dd= 0; dd < halfDepth; dd++) { | for (dd= 0; dd < halfDepth; dd++) { | ||||
src+= groupSizeInBytes; | src+= groupSizeInBytes; | ||||
} /* for jj */ | } /* for jj */ | ||||
/* skip past pad bytes, if any, to get to next row */ | /* skip past pad bytes, if any, to get to next row */ | ||||
src+= padBytes; | |||||
src+= rowPadBytes; | |||||
/* src is at beginning of a row here, but it's the second row of | /* src is at beginning of a row here, but it's the second row of | ||||
* the square block of 4 pixels that we just worked on so we | * the square block of 4 pixels that we just worked on so we | ||||
src+= rowSizeInBytes; | src+= rowSizeInBytes; | ||||
} /* for ii */ | } /* for ii */ | ||||
/* skip past pad bytes, if any, to get to next image */ | |||||
src+= imagePadBytes; | |||||
src+= imageSizeInBytes; | src+= imageSizeInBytes; | ||||
} /* for dd */ | } /* for dd */ | ||||
return glut_functions[i].address; | return glut_functions[i].address; | ||||
} | } | ||||
#if DIRECTFBGL_INTERFACE_VERSION >= 1 | |||||
if (g_current) { | |||||
void *address = NULL; | |||||
g_current->gl->GetProcAddress( g_current->gl, name, &address ); | |||||
return address; | |||||
} | |||||
#endif | |||||
return NULL; | return NULL; | ||||
} | } | ||||
#include <directfb.h> | #include <directfb.h> | ||||
#include <directfb_version.h> | #include <directfb_version.h> | ||||
#include <directfbgl.h> | |||||
#include "GL/glut.h" | #include "GL/glut.h" | ||||
#include "GL/directfbgl.h" | |||||
#define VERSION_CODE( M, m, r ) (((M) << 16) | ((m) << 8) | ((r))) | #define VERSION_CODE( M, m, r ) (((M) << 16) | ((m) << 8) | ((r))) |
* Written by Sean D'Epagnier (c) 2006 | * Written by Sean D'Epagnier (c) 2006 | ||||
*/ | */ | ||||
#include <stdlib.h> | |||||
#include <GL/glut.h> | #include <GL/glut.h> | ||||
#include "internal.h" | #include "internal.h" | ||||
void glutMouseFunc(void (*func)(int button, int state, int x, int y)) | void glutMouseFunc(void (*func)(int button, int state, int x, int y)) | ||||
{ | { | ||||
MouseEnabled = 1; | |||||
MouseFunc = func; | MouseFunc = func; | ||||
} | } | ||||
void glutMotionFunc(void (*func)(int x, int y)) | void glutMotionFunc(void (*func)(int x, int y)) | ||||
{ | { | ||||
MouseEnabled = 1; | |||||
MotionFunc = func; | MotionFunc = func; | ||||
} | } | ||||
void glutPassiveMotionFunc(void (*func)(int x, int y)) | void glutPassiveMotionFunc(void (*func)(int x, int y)) | ||||
{ | { | ||||
MouseEnabled = 1; | |||||
PassiveMotionFunc = func; | PassiveMotionFunc = func; | ||||
} | } | ||||
* Written by Sean D'Epagnier (c) 2006 | * Written by Sean D'Epagnier (c) 2006 | ||||
*/ | */ | ||||
#include <stdio.h> | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <linux/fb.h> | #include <linux/fb.h> | ||||
#define TORMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat)(REVERSECMAPSIZE-1)) | #define TORMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat)(REVERSECMAPSIZE-1)) | ||||
#define FROMCMAP(x) (GLfloat)x / (GLfloat)((1<<16) - 1) | #define FROMCMAP(x) (GLfloat)x / (GLfloat)((1<<16) - 1) | ||||
static struct fb_cmap ColorMap; | |||||
static struct fb_cmap ColorMap, OriginalColorMap; | |||||
unsigned short RedColorMap[256], GreenColorMap[256], BlueColorMap[256]; | unsigned short RedColorMap[256], GreenColorMap[256], BlueColorMap[256]; | ||||
void RestoreColorMap(void) | void RestoreColorMap(void) | ||||
{ | { | ||||
if(FixedInfo.visual == FB_VISUAL_TRUECOLOR) | |||||
return; | |||||
if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &ColorMap) < 0) | if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &ColorMap) < 0) | ||||
sprintf(exiterror, "ioctl(FBIOPUTCMAP) failed!\n"); | sprintf(exiterror, "ioctl(FBIOPUTCMAP) failed!\n"); | ||||
} | } | ||||
void LoadColorMap(void) | void LoadColorMap(void) | ||||
{ | { | ||||
if(FixedInfo.visual == FB_VISUAL_TRUECOLOR) | |||||
return; | |||||
ColorMap.start = 0; | ColorMap.start = 0; | ||||
ColorMap.red = RedColorMap; | ColorMap.red = RedColorMap; | ||||
ColorMap.green = GreenColorMap; | ColorMap.green = GreenColorMap; |
to render the cursor, this is faster, it would be good to use a hardware | to render the cursor, this is faster, it would be good to use a hardware | ||||
cursor if it exists instead */ | cursor if it exists instead */ | ||||
#include <stdio.h> | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#include <string.h> | |||||
#include <linux/fb.h> | #include <linux/fb.h> | ||||
unsigned char *src = MouseBuffer; | unsigned char *src = MouseBuffer; | ||||
if(!MouseVisible || CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS) | |||||
return; | |||||
for(i = 0; i<CURSOR_HEIGHT; i++) { | for(i = 0; i<CURSOR_HEIGHT; i++) { | ||||
memcpy(BackBuffer + off, src, stride); | memcpy(BackBuffer + off, src, stride); | ||||
src += stride; | src += stride; | ||||
unsigned char *c; | unsigned char *c; | ||||
const unsigned char *d; | const unsigned char *d; | ||||
if(CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS) | |||||
if(!MouseVisible || CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS) | |||||
return; | return; | ||||
px = MouseX - CursorsXOffset[CurrentCursor]; | px = MouseX - CursorsXOffset[CurrentCursor]; | ||||
int miny = MIN(py, LastMouseY); | int miny = MIN(py, LastMouseY); | ||||
int sizey = abs(py - LastMouseY); | int sizey = abs(py - LastMouseY); | ||||
DrawCursor(); | |||||
/* now update the portion of the screen that has changed */ | |||||
if(MouseVisible) | |||||
DrawCursor(); | |||||
if(DisplayMode & GLUT_DOUBLE && (sizex || sizey)) { | |||||
/* now update the portion of the screen that has changed, this is also | |||||
used to hide the mouse if MouseVisible is 0 */ | |||||
if(DisplayMode & GLUT_DOUBLE && ((sizex || sizey) || !MouseVisible)) { | |||||
int off, stride, i; | int off, stride, i; | ||||
if(minx < 0) | if(minx < 0) | ||||
minx = 0; | minx = 0; | ||||
+ minx * VarInfo.bits_per_pixel / 8; | + minx * VarInfo.bits_per_pixel / 8; | ||||
stride = (sizex + CURSOR_WIDTH) * VarInfo.bits_per_pixel / 8; | stride = (sizex + CURSOR_WIDTH) * VarInfo.bits_per_pixel / 8; | ||||
for(i = 0; i< sizey + CURSOR_HEIGHT; i++) { | |||||
for(i = 0; i < sizey + CURSOR_HEIGHT; i++) { | |||||
memcpy(FrameBuffer+off, BackBuffer+off, stride); | memcpy(FrameBuffer+off, BackBuffer+off, stride); | ||||
off += FixedInfo.line_length; | off += FixedInfo.line_length; | ||||
} | } | ||||
if(cursor == GLUT_CURSOR_FULL_CROSSHAIR) | if(cursor == GLUT_CURSOR_FULL_CROSSHAIR) | ||||
cursor = GLUT_CURSOR_CROSSHAIR; | cursor = GLUT_CURSOR_CROSSHAIR; | ||||
if(CurrentCursor >= 0 && CurrentCursor < NUM_CURSORS) | |||||
EraseCursor(); | |||||
EraseCursor(); | |||||
MouseVisible = 1; | |||||
CurrentCursor = cursor; | CurrentCursor = cursor; | ||||
MouseEnabled = 1; | |||||
SwapCursor(); | SwapCursor(); | ||||
} | } |
* Written by Sean D'Epagnier (c) 2006 | * Written by Sean D'Epagnier (c) 2006 | ||||
*/ | */ | ||||
#include <stdio.h> | |||||
#include <GL/gl.h> | #include <GL/gl.h> | ||||
#include <GL/glut.h> | #include <GL/glut.h> | ||||
int Visible; | int Visible; | ||||
int VisibleSwitch; | int VisibleSwitch; | ||||
int Active; | int Active; | ||||
static int Resized; | |||||
/* we have to poll to see if we are visible | /* we have to poll to see if we are visible | ||||
on a framebuffer that is not active */ | on a framebuffer that is not active */ | ||||
int VisiblePoll; | int VisiblePoll; | ||||
fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", | fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", | ||||
strerror(errno)); | strerror(errno)); | ||||
munmap(FrameBuffer, FixedInfo.smem_len); | |||||
if(FrameBuffer) | |||||
munmap(FrameBuffer, FixedInfo.smem_len); | |||||
close(FrameBufferFD); | close(FrameBufferFD); | ||||
} | } | ||||
/* free allocated back buffer */ | /* free allocated back buffer */ | ||||
void glutMainLoop(void) | void glutMainLoop(void) | ||||
{ | { | ||||
int idleiters; | |||||
if(ReshapeFunc) | if(ReshapeFunc) | ||||
ReshapeFunc(VarInfo.xres, VarInfo.yres); | ReshapeFunc(VarInfo.xres, VarInfo.yres); | ||||
else | else | ||||
if(VisiblePoll) | if(VisiblePoll) | ||||
TestVisible(); | TestVisible(); | ||||
else | |||||
usleep(1); | |||||
if(IdleFunc) | if(IdleFunc) | ||||
IdleFunc(); | IdleFunc(); | ||||
VisibilityFunc(Visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE); | VisibilityFunc(Visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE); | ||||
} | } | ||||
if(Resized) { | |||||
SetVideoMode(); | |||||
CreateBuffer(); | |||||
if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { | |||||
sprintf(exiterror, "Failure to Make Current\n"); | |||||
exit(0); | |||||
} | |||||
InitializeMenus(); | |||||
if(ReshapeFunc) | |||||
ReshapeFunc(VarInfo.xres, VarInfo.yres); | |||||
Redisplay = 1; | |||||
Resized = 0; | |||||
} | |||||
if(Visible && Redisplay) { | if(Visible && Redisplay) { | ||||
Redisplay = 0; | Redisplay = 0; | ||||
if(MouseEnabled) | |||||
EraseCursor(); | |||||
EraseCursor(); | |||||
DisplayFunc(); | DisplayFunc(); | ||||
if(!(DisplayMode & GLUT_DOUBLE)) { | if(!(DisplayMode & GLUT_DOUBLE)) { | ||||
if(ActiveMenu) | if(ActiveMenu) | ||||
DrawMenus(); | DrawMenus(); | ||||
if(MouseEnabled) | |||||
DrawCursor(); | |||||
DrawCursor(); | |||||
} | } | ||||
idleiters = 0; | |||||
} else { | |||||
/* we sleep if not receiving redisplays, and | |||||
the main loop is running faster than 2khz */ | |||||
static int lasttime; | |||||
int time = glutGet(GLUT_ELAPSED_TIME); | |||||
if(time > lasttime) { | |||||
if(idleiters >= 2) | |||||
usleep(100); | |||||
idleiters = 0; | |||||
lasttime = time; | |||||
} | |||||
idleiters++; | |||||
} | } | ||||
} | } | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
/* ---------- Window Management ----------*/ | |||||
void SetVideoMode(void) | void SetVideoMode(void) | ||||
{ | { | ||||
/* set new variable screen info */ | /* set new variable screen info */ | ||||
if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { | if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { | ||||
sprintf(exiterror, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", | |||||
strerror(errno)); | |||||
sprintf(exiterror, "FBIOPUT_VSCREENINFO failed: %s\n", strerror(errno)); | |||||
strcat(exiterror, "Perhaps the device does not support the selected mode\n"); | |||||
exit(0); | exit(0); | ||||
} | } | ||||
/* reload the screen info to update offsets */ | |||||
/* reload the screen info to update rgb bits */ | |||||
if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &VarInfo)) { | if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &VarInfo)) { | ||||
sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", | sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", | ||||
strerror(errno)); | strerror(errno)); | ||||
LoadColorMap(); | LoadColorMap(); | ||||
} | } | ||||
void CreateBuffer() | |||||
void CreateBuffer(void) | |||||
{ | { | ||||
int size = VarInfo.xres_virtual * VarInfo.yres_virtual | int size = VarInfo.xres_virtual * VarInfo.yres_virtual | ||||
* VarInfo.bits_per_pixel / 8; | * VarInfo.bits_per_pixel / 8; | ||||
} | } | ||||
} | } | ||||
static void ResizeVisual(void) | |||||
{ | |||||
if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { | |||||
sprintf(exiterror, "Failure to Make Current\n"); | |||||
exit(0); | |||||
} | |||||
InitializeMenus(); | |||||
if(ReshapeFunc) | |||||
ReshapeFunc(VarInfo.xres, VarInfo.yres); | |||||
Redisplay = 1; | |||||
} | |||||
static void SignalWinch(int arg) | static void SignalWinch(int arg) | ||||
{ | { | ||||
/* we can't change bitdepth without destroying the visual */ | /* we can't change bitdepth without destroying the visual */ | ||||
VarInfo.blue = blue; | VarInfo.blue = blue; | ||||
VarInfo.transp = transp; | VarInfo.transp = transp; | ||||
SetVideoMode(); | |||||
CreateBuffer(); | |||||
ResizeVisual(); | |||||
Resized = 1; | |||||
} | } | ||||
int glutCreateWindow (const char *title) | int glutCreateWindow (const char *title) | ||||
glFBDevDestroyContext(Context); | glFBDevDestroyContext(Context); | ||||
glFBDevDestroyBuffer(Buffer); | glFBDevDestroyBuffer(Buffer); | ||||
glFBDevDestroyVisual(Visual); | glFBDevDestroyVisual(Visual); | ||||
Visual = NULL; | Visual = NULL; | ||||
} | } | ||||
{ | { | ||||
glFlush(); | glFlush(); | ||||
if(!(DisplayMode & GLUT_DOUBLE)) | |||||
return; | |||||
if(ActiveMenu) | if(ActiveMenu) | ||||
DrawMenus(); | DrawMenus(); | ||||
if(MouseEnabled) | |||||
DrawCursor(); | |||||
DrawCursor(); | |||||
if(DisplayMode & GLUT_DOUBLE && Visible) { | |||||
if(Visible) { | |||||
Swapping = 1; | Swapping = 1; | ||||
glFBDevSwapBuffers(Buffer); | glFBDevSwapBuffers(Buffer); | ||||
Swapping = 0; | Swapping = 0; | ||||
signal(SIGWINCH, SIG_IGN); | signal(SIGWINCH, SIG_IGN); | ||||
SetVideoMode(); | SetVideoMode(); | ||||
CreateBuffer(); | |||||
ResizeVisual(); | |||||
signal(SIGWINCH, SignalWinch); | signal(SIGWINCH, SignalWinch); | ||||
Resized = 1; | |||||
} | } | ||||
void glutFullScreen(void) | void glutFullScreen(void) |
* Written by Sean D'Epagnier (c) 2006 | * Written by Sean D'Epagnier (c) 2006 | ||||
*/ | */ | ||||
#include <stdio.h> | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
int GpmMouse; | int GpmMouse; | ||||
#endif | #endif | ||||
int CurrentVT; | |||||
int CurrentVT = 0; | |||||
int ConsoleFD = -1; | int ConsoleFD = -1; | ||||
int KeyboardModifiers; | int KeyboardModifiers; | ||||
int KeyRepeatMode = GLUT_KEY_REPEAT_DEFAULT; | int KeyRepeatMode = GLUT_KEY_REPEAT_DEFAULT; | ||||
/* only display the mouse if there is a registered callback for it */ | |||||
int MouseEnabled = 0; | |||||
int MouseVisible = 0; | |||||
int LastMouseTime = 0; | |||||
static int OldKDMode = -1; | static int OldKDMode = -1; | ||||
static int OldMode = KD_TEXT; | static int OldMode = KD_TEXT; | ||||
static int kbdpipe[2]; | static int kbdpipe[2]; | ||||
static int LastStdinKeyTime, LastStdinSpecialKey = -1, LastStdinCode = -1; | |||||
#define MODIFIER(mod) \ | #define MODIFIER(mod) \ | ||||
KeyboardModifiers = release ? KeyboardModifiers & ~mod \ | KeyboardModifiers = release ? KeyboardModifiers & ~mod \ | ||||
: KeyboardModifiers | mod; | : KeyboardModifiers | mod; | ||||
unsigned char code; | unsigned char code; | ||||
while(read(ConsoleFD, &code, 1) == 1) { | while(read(ConsoleFD, &code, 1) == 1) { | ||||
int release, labelval; | int release, labelval; | ||||
struct kbentry entry; | struct kbentry entry; | ||||
static int lalt; /* only left alt does vt switch */ | static int lalt; /* only left alt does vt switch */ | ||||
KeyboardLedState ^= led; | KeyboardLedState ^= led; | ||||
releaseflag &= ~led; | releaseflag &= ~led; | ||||
} | } | ||||
ioctl(ConsoleFD, KDSKBLED, KeyboardLedState); | ioctl(ConsoleFD, KDSKBLED, KeyboardLedState); | ||||
ioctl(ConsoleFD, KDSETLED, 0x80); | ioctl(ConsoleFD, KDSETLED, 0x80); | ||||
} | } | ||||
static void HandleKeyPress(unsigned char key, int up) | |||||
{ | |||||
if(up) { | |||||
if(KeyboardUpFunc) | |||||
KeyboardUpFunc(key, MouseX, MouseY); | |||||
} else | |||||
if(KeyboardFunc) | |||||
KeyboardFunc(key, MouseX, MouseY); | |||||
else | |||||
if(key == 27) | |||||
exit(0); /* no handler, to provide a way to exit */ | |||||
} | |||||
static void HandleSpecialPress(int key, int up) | |||||
{ | |||||
if(up) { | |||||
if(SpecialUpFunc) | |||||
SpecialUpFunc(key, MouseX, MouseY); | |||||
} else | |||||
if(SpecialFunc) | |||||
SpecialFunc(key, MouseX, MouseY); | |||||
} | |||||
static void ReleaseStdinKey(void) | |||||
{ | |||||
if(LastStdinSpecialKey != -1) { | |||||
HandleSpecialPress(LastStdinSpecialKey, 1); | |||||
LastStdinSpecialKey = -1; | |||||
} | |||||
if(LastStdinCode != -1) { | |||||
HandleKeyPress(LastStdinCode, 1); | |||||
LastStdinCode = -1; | |||||
} | |||||
} | |||||
#define READKEY read(kbdpipe[0], &code, 1) | #define READKEY read(kbdpipe[0], &code, 1) | ||||
static int ReadKey(void) | static int ReadKey(void) | ||||
{ | { | ||||
int specialkey = 0; | int specialkey = 0; | ||||
struct kbentry entry; | struct kbentry entry; | ||||
if(READKEY != 1) | |||||
if(READKEY != 1) { | |||||
/* if we are reading from stdin, we detect key releases when the key | |||||
does not repeat after a given timeout */ | |||||
if(ConsoleFD == 0 && LastStdinKeyTime + 100 < glutGet(GLUT_ELAPSED_TIME)) | |||||
ReleaseStdinKey(); | |||||
return 0; | return 0; | ||||
} | |||||
if(code == 0) | if(code == 0) | ||||
return 0; | return 0; | ||||
KeyboardModifiers = 0; | KeyboardModifiers = 0; | ||||
altset: | altset: | ||||
if(code == 27 && READKEY == 1) { | if(code == 27 && READKEY == 1) { | ||||
switch(code) { | |||||
case 79: /* function key */ | |||||
READKEY; | |||||
if(code == 50) { | |||||
READKEY; | |||||
shiftfunc: | |||||
KeyboardModifiers |= GLUT_ACTIVE_SHIFT; | |||||
specialkey = GLUT_KEY_F1 + code - 53; | |||||
READKEY; | |||||
} else { | |||||
READKEY; | |||||
specialkey = GLUT_KEY_F1 + code - 80; | |||||
} | |||||
break; | |||||
case 91: | |||||
READKEY; | |||||
switch(code) { | |||||
case 68: | |||||
specialkey = GLUT_KEY_LEFT; break; | |||||
case 65: | |||||
specialkey = GLUT_KEY_UP; break; | |||||
case 67: | |||||
specialkey = GLUT_KEY_RIGHT; break; | |||||
case 66: | |||||
specialkey = GLUT_KEY_DOWN; break; | |||||
case 53: | |||||
specialkey = GLUT_KEY_PAGE_UP; READKEY; break; | |||||
case 54: | |||||
specialkey = GLUT_KEY_PAGE_DOWN; READKEY; break; | |||||
case 49: | |||||
specialkey = GLUT_KEY_HOME; READKEY; break; | |||||
case 52: | |||||
specialkey = GLUT_KEY_END; READKEY; break; | |||||
case 50: | |||||
READKEY; | |||||
if(code != 126) | |||||
goto shiftfunc; | |||||
specialkey = GLUT_KEY_INSERT; | |||||
break; | |||||
case 51: | |||||
code = '\b'; | |||||
goto stdkey; | |||||
case 91: | |||||
READKEY; | |||||
specialkey = GLUT_KEY_F1 + code - 65; | |||||
break; | |||||
default: | |||||
return 0; | |||||
} | |||||
break; | |||||
default: | |||||
if(code != 91) { | |||||
KeyboardModifiers |= GLUT_ACTIVE_ALT; | KeyboardModifiers |= GLUT_ACTIVE_ALT; | ||||
goto altset; | goto altset; | ||||
} | } | ||||
READKEY; | |||||
switch(code) { | |||||
case 68: | |||||
specialkey = GLUT_KEY_LEFT; break; | |||||
case 65: | |||||
specialkey = GLUT_KEY_UP; break; | |||||
case 67: | |||||
specialkey = GLUT_KEY_RIGHT; break; | |||||
case 66: | |||||
specialkey = GLUT_KEY_DOWN; break; | |||||
case 52: | |||||
specialkey = GLUT_KEY_END; READKEY; break; | |||||
case 53: | |||||
specialkey = GLUT_KEY_PAGE_UP; READKEY; break; | |||||
case 54: | |||||
specialkey = GLUT_KEY_PAGE_DOWN; READKEY; break; | |||||
case 49: | |||||
READKEY; | |||||
if(code == 126) | |||||
specialkey = GLUT_KEY_HOME; | |||||
else { | |||||
specialkey = GLUT_KEY_F1 + code - 50; | |||||
READKEY; | |||||
} | |||||
break; | |||||
case 50: | |||||
READKEY; | |||||
if(code == 126) | |||||
specialkey = GLUT_KEY_INSERT; | |||||
else { | |||||
if(code > '1') | |||||
code--; | |||||
if(code > '6') | |||||
code--; | |||||
if(code > '3') { | |||||
KeyboardModifiers |= GLUT_ACTIVE_SHIFT; | |||||
code -= 12; | |||||
} | |||||
specialkey = GLUT_KEY_F1 + code - 40; | |||||
READKEY; | |||||
} | |||||
break; | |||||
case 51: | |||||
READKEY; | |||||
if(code == 126) { | |||||
code = '\b'; | |||||
goto stdkey; | |||||
} | |||||
KeyboardModifiers |= GLUT_ACTIVE_SHIFT; | |||||
specialkey = GLUT_KEY_F1 + code - 45; | |||||
READKEY; | |||||
break; | |||||
case 91: | |||||
READKEY; | |||||
specialkey = GLUT_KEY_F1 + code - 65; | |||||
break; | |||||
default: | |||||
return 0; | |||||
} | |||||
} | } | ||||
if(specialkey) { | if(specialkey) { | ||||
if(SpecialFunc) | |||||
SpecialFunc(specialkey, MouseX, MouseY); | |||||
LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME); | |||||
if(LastStdinSpecialKey != specialkey) { | |||||
ReleaseStdinKey(); | |||||
HandleSpecialPress(specialkey, 0); | |||||
LastStdinSpecialKey = specialkey; | |||||
LastStdinKeyTime += 200; /* initial repeat */ | |||||
} else | |||||
if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF) | |||||
HandleSpecialPress(specialkey, 0); | |||||
} else { | } else { | ||||
if(code >= 1 && code <= 26 && code != '\r') { | if(code >= 1 && code <= 26 && code != '\r') { | ||||
KeyboardModifiers |= GLUT_ACTIVE_CTRL; | KeyboardModifiers |= GLUT_ACTIVE_CTRL; | ||||
KeyboardModifiers |= GLUT_ACTIVE_SHIFT; | KeyboardModifiers |= GLUT_ACTIVE_SHIFT; | ||||
stdkey: | stdkey: | ||||
if(KeyboardFunc) | |||||
KeyboardFunc(code, MouseX, MouseY); | |||||
LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME); | |||||
if(LastStdinCode != code) { | |||||
ReleaseStdinKey(); | |||||
HandleKeyPress(code, 0); | |||||
LastStdinCode = code; | |||||
LastStdinKeyTime += 200; /* initial repeat */ | |||||
} else | |||||
if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF) | |||||
HandleSpecialPress(code, 0); | |||||
} | } | ||||
return 1; | return 1; | ||||
} | } | ||||
labelval = '\b'; | labelval = '\b'; | ||||
break; | break; | ||||
case K_ENTER: | case K_ENTER: | ||||
case K_ENTER - 1: /* keypad enter */ | |||||
labelval = '\r'; break; | labelval = '\r'; break; | ||||
} | } | ||||
/* likely a keypad input, but depends on keyboard mapping, ignore */ | |||||
if(labelval == 512) | |||||
return 1; | |||||
/* dispatch callback */ | /* dispatch callback */ | ||||
if(specialkey) { | |||||
if(release) { | |||||
if(SpecialUpFunc) | |||||
SpecialUpFunc(specialkey, MouseX, MouseY); | |||||
} else | |||||
if(SpecialFunc) | |||||
SpecialFunc(specialkey, MouseX, MouseY); | |||||
} else { | |||||
if(specialkey) | |||||
HandleSpecialPress(specialkey, release); | |||||
else { | |||||
char c = labelval; | char c = labelval; | ||||
if(KeyboardLedState & LED_CAP) { | if(KeyboardLedState & LED_CAP) { | ||||
if(c >= 'a' && c <= 'z') | if(c >= 'a' && c <= 'z') | ||||
c += 'A' - 'a'; | c += 'A' - 'a'; | ||||
} | } | ||||
if(release) { | |||||
if(KeyboardUpFunc) | |||||
KeyboardUpFunc(c, MouseX, MouseY); | |||||
} else | |||||
if(KeyboardFunc) | |||||
KeyboardFunc(c, MouseX, MouseY); | |||||
HandleKeyPress(c, release); | |||||
} | } | ||||
return 1; | return 1; | ||||
} | } | ||||
dy = event.dy; | dy = event.dy; | ||||
} else | } else | ||||
#endif | #endif | ||||
{ | |||||
char data[4]; | |||||
if(MouseFD == -1) | |||||
return 0; | |||||
{ | |||||
char data[4]; | |||||
if(fcntl(MouseFD, F_SETFL, O_NONBLOCK) == -1) { | |||||
close(MouseFD); | |||||
MouseFD = -1; | |||||
return 0; | |||||
} | |||||
if(MouseFD == -1) | |||||
return 0; | |||||
if(read(MouseFD, data, 4) != 4) | |||||
return 0; | |||||
if(read(MouseFD, data, 4) != 4) | |||||
return 0; | |||||
l = ((data[0] & 0x20) >> 3); | |||||
m = ((data[3] & 0x10) >> 3); | |||||
r = ((data[0] & 0x10) >> 4); | |||||
l = ((data[0] & 0x20) >> 3); | |||||
m = ((data[3] & 0x10) >> 3); | |||||
r = ((data[0] & 0x10) >> 4); | |||||
dx = (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); | |||||
dy = (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); | |||||
} | |||||
dx = (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); | |||||
dy = (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); | |||||
} | |||||
MouseX += dx * MouseSpeed; | MouseX += dx * MouseSpeed; | ||||
if(MouseX < 0) | if(MouseX < 0) | ||||
ll = l, lm = m, lr = r; | ll = l, lm = m, lr = r; | ||||
if(dx || dy) { | |||||
if(dx || dy || !MouseVisible) { | |||||
if(l || m || r) { | if(l || m || r) { | ||||
if(MotionFunc) | if(MotionFunc) | ||||
MotionFunc(MouseX, MouseY); | MotionFunc(MouseX, MouseY); | ||||
EraseCursor(); | EraseCursor(); | ||||
MouseVisible = 1; | |||||
if(ActiveMenu) | if(ActiveMenu) | ||||
Redisplay = 1; | Redisplay = 1; | ||||
else | else | ||||
SwapCursor(); | SwapCursor(); | ||||
} | } | ||||
LastMouseTime = glutGet(GLUT_ELAPSED_TIME); | |||||
return 1; | return 1; | ||||
} | } | ||||
if(ConsoleFD != -1) | if(ConsoleFD != -1) | ||||
while(ReadKey()); | while(ReadKey()); | ||||
if(MouseEnabled) | |||||
while(ReadMouse()); | |||||
while(ReadMouse()); | |||||
/* implement a 2 second timeout on the mouse */ | |||||
if(MouseVisible && glutGet(GLUT_ELAPSED_TIME) - LastMouseTime > 2000) { | |||||
EraseCursor(); | |||||
MouseVisible = 0; | |||||
SwapCursor(); | |||||
} | |||||
} | } | ||||
static void VTSwitchHandler(int sig) | static void VTSwitchHandler(int sig) | ||||
if(st.v_active) | if(st.v_active) | ||||
ioctl(ConsoleFD, VT_RELDISP, VT_ACKACQ); | ioctl(ConsoleFD, VT_RELDISP, VT_ACKACQ); | ||||
/* this is a hack to turn the cursor off */ | |||||
ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo); | |||||
RestoreColorMap(); | RestoreColorMap(); | ||||
Active = 1; | Active = 1; | ||||
VisibleSwitch = 1; | VisibleSwitch = 1; | ||||
Redisplay = 1; | Redisplay = 1; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
signal(SIGIO, SIG_IGN); | signal(SIGIO, SIG_IGN); | ||||
/* save old terminos settings */ | |||||
if (tcgetattr(0, &OldTermios) < 0) { | |||||
sprintf(exiterror, "tcgetattr failed\n"); | |||||
exit(0); | |||||
} | |||||
tio = OldTermios; | |||||
/* terminos settings for straight-through mode */ | |||||
tio.c_lflag &= ~(ICANON | ECHO | ISIG); | |||||
tio.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON); | |||||
tio.c_iflag |= IGNBRK; | |||||
tio.c_cc[VMIN] = 0; | |||||
tio.c_cc[VTIME] = 0; | |||||
if (tcsetattr(0, TCSANOW, &tio) < 0) { | |||||
sprintf(exiterror, "tcsetattr failed\n"); | |||||
exit(0); | |||||
} | |||||
if(fcntl(0, F_SETFL, O_NONBLOCK | O_ASYNC) < 0) { | |||||
sprintf(exiterror, "Failed to set keyboard to non-blocking\n"); | |||||
exit(0); | |||||
} | |||||
Active = 1; | Active = 1; | ||||
if(usestdin) { | if(usestdin) { | ||||
ConsoleFD = 0; | ConsoleFD = 0; | ||||
return; | |||||
goto setattribs; | |||||
} | } | ||||
/* detect the current vt if it was not specified */ | /* detect the current vt if it was not specified */ | ||||
sprintf(exiterror, "Failed to open /dev/tty\n"); | sprintf(exiterror, "Failed to open /dev/tty\n"); | ||||
exit(0); | exit(0); | ||||
} | } | ||||
if(ioctl(fd, VT_GETSTATE, &st) == -1) { | if(ioctl(fd, VT_GETSTATE, &st) == -1) { | ||||
fprintf(stderr, "Could not detect current vt, specify with -vt\n"); | fprintf(stderr, "Could not detect current vt, specify with -vt\n"); | ||||
fprintf(stderr, "Defaulting to stdin input\n"); | fprintf(stderr, "Defaulting to stdin input\n"); | ||||
ConsoleFD = 0; | ConsoleFD = 0; | ||||
close(fd); | close(fd); | ||||
return; | |||||
} else | |||||
CurrentVT = st.v_active; | |||||
goto setattribs; | |||||
} | |||||
CurrentVT = st.v_active; | |||||
close(fd); | close(fd); | ||||
} | } | ||||
sprintf(exiterror, "error couldn't open %s," | sprintf(exiterror, "error couldn't open %s," | ||||
" defaulting to stdin \n", console); | " defaulting to stdin \n", console); | ||||
ConsoleFD = 0; | ConsoleFD = 0; | ||||
return; | |||||
goto setattribs; | |||||
} | } | ||||
signal(SIGUSR1, VTSwitchHandler); | signal(SIGUSR1, VTSwitchHandler); | ||||
sprintf(exiterror,"Failed to grab %s, defaulting to stdin\n", console); | sprintf(exiterror,"Failed to grab %s, defaulting to stdin\n", console); | ||||
close(ConsoleFD); | close(ConsoleFD); | ||||
ConsoleFD = 0; | ConsoleFD = 0; | ||||
return; | |||||
goto setattribs; | |||||
} | } | ||||
vt = OldVTMode; | vt = OldVTMode; | ||||
exit(0); | exit(0); | ||||
} | } | ||||
fcntl(0, F_SETOWN, getpid()); | |||||
fcntl(ConsoleFD, F_SETOWN, getpid()); | |||||
if(ioctl(ConsoleFD, KDGETMODE, &OldMode) < 0) | if(ioctl(ConsoleFD, KDGETMODE, &OldMode) < 0) | ||||
sprintf(exiterror, "Warning: Failed to get terminal mode\n"); | sprintf(exiterror, "Warning: Failed to get terminal mode\n"); | ||||
if(ioctl(ConsoleFD, KDSKBMODE, K_MEDIUMRAW) < 0) { | if(ioctl(ConsoleFD, KDSKBMODE, K_MEDIUMRAW) < 0) { | ||||
sprintf(exiterror, "ioctl KDSKBMODE failed!\n"); | sprintf(exiterror, "ioctl KDSKBMODE failed!\n"); | ||||
tcsetattr(0, TCSANOW, &OldTermios); | |||||
exit(0); | exit(0); | ||||
} | } | ||||
sprintf(exiterror, "ioctl KDGKBLED failed!\n"); | sprintf(exiterror, "ioctl KDGKBLED failed!\n"); | ||||
exit(0); | exit(0); | ||||
} | } | ||||
setattribs: | |||||
/* enable async input input */ | |||||
if(fcntl(ConsoleFD, F_SETFL, O_ASYNC) < 0) { | |||||
sprintf(exiterror, "Failed to set O_ASYNC mode on fd %d\n", ConsoleFD); | |||||
exit(0); | |||||
} | |||||
/* save old terminos settings */ | |||||
if (tcgetattr(ConsoleFD, &OldTermios) < 0) { | |||||
sprintf(exiterror, "tcgetattr failed\n"); | |||||
exit(0); | |||||
} | |||||
tio = OldTermios; | |||||
/* terminos settings for straight-through mode */ | |||||
tio.c_lflag &= ~(ICANON | ECHO | ISIG); | |||||
tio.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON); | |||||
tio.c_iflag |= IGNBRK; | |||||
tio.c_cc[VMIN] = 0; | |||||
tio.c_cc[VTIME] = 0; | |||||
if (tcsetattr(ConsoleFD, TCSANOW, &tio) < 0) { | |||||
sprintf(exiterror, "tcsetattr failed\n"); | |||||
exit(0); | |||||
} | |||||
} | } | ||||
void RestoreVT(void) | void RestoreVT(void) | ||||
if(ConsoleFD < 0) | if(ConsoleFD < 0) | ||||
return; | return; | ||||
if (tcsetattr(0, TCSANOW, &OldTermios) < 0) | |||||
fprintf(stderr, "tcsetattr failed\n"); | |||||
if (tcsetattr(ConsoleFD, TCSANOW, &OldTermios) < 0) | |||||
sprintf(exiterror, "tcsetattr failed\n"); | |||||
/* setting the mode to text from graphics restores the colormap*/ | |||||
/* setting the mode to text from graphics restores the colormap */ | |||||
if( | if( | ||||
#ifdef HAVE_GPM | #ifdef HAVE_GPM | ||||
GpmMouse || | |||||
!GpmMouse || | |||||
#endif | #endif | ||||
ConsoleFD == 0) | ConsoleFD == 0) | ||||
if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) | if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) | ||||
const char *mousedev = getenv("MOUSE"); | const char *mousedev = getenv("MOUSE"); | ||||
if(!mousedev) | if(!mousedev) | ||||
mousedev = MOUSEDEV; | mousedev = MOUSEDEV; | ||||
if((MouseFD = open(mousedev, O_RDONLY)) >= 0) { | |||||
if(!MouseSpeed) | |||||
MouseSpeed = 1; | |||||
NumMouseButtons = 3; | |||||
return; | |||||
if((MouseFD = open(mousedev, O_RDONLY | O_NONBLOCK)) >= 0) { | |||||
if(!MouseSpeed) | |||||
MouseSpeed = 1; | |||||
NumMouseButtons = 3; | |||||
return; | |||||
} | } | ||||
} | } | ||||
#ifdef HAVE_GPM | #ifdef HAVE_GPM |
void TestVisible(void); | void TestVisible(void); | ||||
int ParseFBModes(int, int, int, int, int, int); | int ParseFBModes(int, int, int, int, int, int); | ||||
void SetVideoMode(void); | |||||
void CreateBuffer(void); | |||||
void CreateVisual(void); | void CreateVisual(void); | ||||
extern int FrameBufferFD; | extern int FrameBufferFD; | ||||
#define REVERSECMAPSIZE (1<<REVERSECMAPSIZELOG) | #define REVERSECMAPSIZE (1<<REVERSECMAPSIZELOG) | ||||
extern unsigned short RedColorMap[256], | extern unsigned short RedColorMap[256], | ||||
GreenColorMap[256], | |||||
BlueColorMap[256]; | |||||
GreenColorMap[256], | |||||
BlueColorMap[256]; | |||||
extern unsigned char ReverseColorMap[REVERSECMAPSIZE] | extern unsigned char ReverseColorMap[REVERSECMAPSIZE] | ||||
[REVERSECMAPSIZE] | [REVERSECMAPSIZE] | ||||
[REVERSECMAPSIZE]; | [REVERSECMAPSIZE]; | ||||
void LoadOldColorMap(void); | |||||
void LoadColorMap(void); | void LoadColorMap(void); | ||||
void UnloadColorMap(void); | |||||
void RestoreColorMap(void); | void RestoreColorMap(void); | ||||
/* --- mouse --- */ | /* --- mouse --- */ | ||||
extern int MouseX, MouseY; | extern int MouseX, MouseY; | ||||
extern int CurrentCursor; | extern int CurrentCursor; | ||||
extern int MouseEnabled; | |||||
extern int MouseVisible; | |||||
extern int LastMouseTime; | |||||
extern int NumMouseButtons; | extern int NumMouseButtons; | ||||
void InitializeCursor(void); | void InitializeCursor(void); |
*/ | */ | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | |||||
#include <string.h> | |||||
#include <linux/fb.h> | #include <linux/fb.h> | ||||
free(Menus[i].Items[j].name); | free(Menus[i].Items[j].name); | ||||
free(Menus[i].Items); | free(Menus[i].Items); | ||||
} | } | ||||
free(Menus); | free(Menus); | ||||
} | } | ||||
int glutCreateMenu(void (*func)(int value)) | int glutCreateMenu(void (*func)(int value)) | ||||
{ | { | ||||
MouseEnabled = 1; | |||||
CurrentMenu = NumMenus; | CurrentMenu = NumMenus; | ||||
NumMenus++; | NumMenus++; | ||||
Menus = realloc(Menus, sizeof(*Menus) * NumMenus); | Menus = realloc(Menus, sizeof(*Menus) * NumMenus); |
* Written by Sean D'Epagnier (c) 2006 | * Written by Sean D'Epagnier (c) 2006 | ||||
*/ | */ | ||||
#include <stdlib.h> | |||||
#include <GL/gl.h> | #include <GL/gl.h> | ||||
void glutEstablishOverlay(void) | void glutEstablishOverlay(void) |
* Written by Sean D'Epagnier (c) 2006 | * Written by Sean D'Epagnier (c) 2006 | ||||
*/ | */ | ||||
#include <string.h> | |||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <linux/fb.h> | #include <linux/fb.h> |
GLXDrawable drawable = (GLXDrawable) draw; | GLXDrawable drawable = (GLXDrawable) draw; | ||||
drm_clip_rect_t * cliprect; | drm_clip_rect_t * cliprect; | ||||
Display* display = (Display*)dpy; | Display* display = (Display*)dpy; | ||||
__DRIscreenPrivate *psp = display->driScreen.private; | |||||
__DRIcontextPrivate *pcp = (__DRIcontextPrivate *)CurrentContext->driContext.private; | __DRIcontextPrivate *pcp = (__DRIcontextPrivate *)CurrentContext->driContext.private; | ||||
__DRIdrawablePrivate *pdp = pcp->driDrawablePriv; | |||||
if (drawable == 0) { | if (drawable == 0) { | ||||
return GL_FALSE; | return GL_FALSE; | ||||
} | } | ||||
*index = display->clientID; | *index = display->clientID; | ||||
*stamp = pcp->driScreenPriv->pSAREA->drawableTable[display->clientID].stamp; | *stamp = pcp->driScreenPriv->pSAREA->drawableTable[display->clientID].stamp; | ||||
drmUpdateDrawableInfo(psp->fd, pdp->hHWDrawable, DRM_DRAWABLE_CLIPRECTS, 1, cliprect); | |||||
*x = drawable->x; | *x = drawable->x; | ||||
*y = drawable->y; | *y = drawable->y; | ||||
*width = drawable->w; | *width = drawable->w; | ||||
xf86DRI_CreateDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable, | xf86DRI_CreateDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable, | ||||
drm_drawable_t *hHWDrawable ) | drm_drawable_t *hHWDrawable ) | ||||
{ | { | ||||
return GL_TRUE; | |||||
Display *display = (Display *)dpy; | |||||
__DRIscreenPrivate *psp = display->driScreen.private; | |||||
int ret; | |||||
ret = drmCreateDrawable(psp->fd, hHWDrawable); | |||||
fprintf(stderr, "drawable is %d %08X ret is %d\n", *hHWDrawable, drawable, -ret); | |||||
if (ret != 0) | |||||
return GL_FALSE; | |||||
return GL_TRUE; | |||||
} | } | ||||
static GLboolean | static GLboolean | ||||
xf86DRI_DestroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable) | xf86DRI_DestroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable) | ||||
{ | { | ||||
return GL_TRUE; | |||||
return GL_TRUE; | |||||
} | } | ||||
glcontextmodes.c |
*hSAREA = rep.hSAREALow; | *hSAREA = rep.hSAREALow; | ||||
if (sizeof(drm_handle_t) == 8) { | if (sizeof(drm_handle_t) == 8) { | ||||
const int shift = 32; /* var to prevent warning on next line */ | |||||
int shift = 32; /* var to prevent warning on next line */ | |||||
*hSAREA |= ((drm_handle_t) rep.hSAREAHigh) << shift; | *hSAREA |= ((drm_handle_t) rep.hSAREAHigh) << shift; | ||||
} | } | ||||
*hFrameBuffer = rep.hFrameBufferLow; | *hFrameBuffer = rep.hFrameBufferLow; | ||||
if (sizeof(drm_handle_t) == 8) { | if (sizeof(drm_handle_t) == 8) { | ||||
const int shift = 32; /* var to prevent warning on next line */ | |||||
int shift = 32; /* var to prevent warning on next line */ | |||||
*hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift; | *hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift; | ||||
} | } | ||||
* 20050727 - Gut all the old interfaces. This breaks compatability with | * 20050727 - Gut all the old interfaces. This breaks compatability with | ||||
* any DRI driver built to any previous version. | * any DRI driver built to any previous version. | ||||
* 20060314 - Added support for GLX_MESA_copy_sub_buffer. | * 20060314 - Added support for GLX_MESA_copy_sub_buffer. | ||||
* 20070105 - Added support for damage reporting. | |||||
*/ | */ | ||||
return 20060314; | |||||
return 20070105; | |||||
} | } | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <X11/extensions/Xext.h> | #include <X11/extensions/Xext.h> | ||||
#include <X11/extensions/extutil.h> | #include <X11/extensions/extutil.h> | ||||
#include <X11/extensions/Xfixes.h> | |||||
#include <X11/extensions/Xdamage.h> | |||||
#include <assert.h> | #include <assert.h> | ||||
#include "indirect_init.h" | #include "indirect_init.h" | ||||
#include "glapi.h" | #include "glapi.h" | ||||
return NULL; | return NULL; | ||||
} | } | ||||
#ifdef XDAMAGE_1_1_INTERFACE | |||||
static GLboolean has_damage_post(__DRInativeDisplay *dpy) | |||||
{ | |||||
static GLboolean inited = GL_FALSE; | |||||
static GLboolean has_damage; | |||||
if (!inited) { | |||||
int major, minor; | |||||
if (XDamageQueryVersion(dpy, &major, &minor) && | |||||
major == 1 && minor >= 1) | |||||
{ | |||||
has_damage = GL_TRUE; | |||||
} else { | |||||
has_damage = GL_FALSE; | |||||
} | |||||
inited = GL_TRUE; | |||||
} | |||||
return has_damage; | |||||
} | |||||
#endif /* XDAMAGE_1_1_INTERFACE */ | |||||
static void __glXReportDamage(__DRInativeDisplay *dpy, int screen, | |||||
__DRIid drawable, | |||||
int x, int y, | |||||
drm_clip_rect_t *rects, int num_rects, | |||||
GLboolean front_buffer) | |||||
{ | |||||
#ifdef XDAMAGE_1_1_INTERFACE | |||||
XRectangle *xrects; | |||||
XserverRegion region; | |||||
int i; | |||||
int x_off, y_off; | |||||
if (!has_damage_post(dpy)) | |||||
return; | |||||
if (front_buffer) { | |||||
x_off = x; | |||||
y_off = y; | |||||
drawable = RootWindow(dpy, screen); | |||||
} else{ | |||||
x_off = 0; | |||||
y_off = 0; | |||||
} | |||||
xrects = malloc(sizeof(XRectangle) * num_rects); | |||||
if (xrects == NULL) | |||||
return; | |||||
for (i = 0; i < num_rects; i++) { | |||||
xrects[i].x = rects[i].x1 + x_off; | |||||
xrects[i].y = rects[i].y1 + y_off; | |||||
xrects[i].width = rects[i].x2 - rects[i].x1; | |||||
xrects[i].height = rects[i].y2 - rects[i].y1; | |||||
} | |||||
region = XFixesCreateRegion(dpy, xrects, num_rects); | |||||
XDamageAdd(dpy, drawable, region); | |||||
XFixesDestroyRegion(dpy, region); | |||||
#endif | |||||
} | |||||
/** | /** | ||||
* Table of functions exported by the loader to the driver. | * Table of functions exported by the loader to the driver. | ||||
__glXGetUST, | __glXGetUST, | ||||
__glXGetMscRateOML, | __glXGetMscRateOML, | ||||
}; | |||||
#define DRM_MAX_FDS 16 | |||||
static struct { | |||||
char *BusID; | |||||
int fd; | |||||
int refcount; | |||||
} connection[DRM_MAX_FDS]; | |||||
static int nr_fds = 0; | |||||
int drmOpenOnce(void *unused, | |||||
const char *BusID, | |||||
int *newlyopened) | |||||
{ | |||||
int i; | |||||
int fd; | |||||
for (i = 0; i < nr_fds; i++) | |||||
if (strcmp(BusID, connection[i].BusID) == 0) { | |||||
connection[i].refcount++; | |||||
*newlyopened = 0; | |||||
return connection[i].fd; | |||||
} | |||||
fd = drmOpen(unused, BusID); | |||||
if (fd <= 0 || nr_fds == DRM_MAX_FDS) | |||||
return fd; | |||||
connection[nr_fds].BusID = strdup(BusID); | |||||
connection[nr_fds].fd = fd; | |||||
connection[nr_fds].refcount = 1; | |||||
*newlyopened = 1; | |||||
if (0) | |||||
fprintf(stderr, "saved connection %d for %s %d\n", | |||||
nr_fds, connection[nr_fds].BusID, | |||||
strcmp(BusID, connection[nr_fds].BusID)); | |||||
nr_fds++; | |||||
return fd; | |||||
} | |||||
__glXReportDamage, | |||||
}; | |||||
void drmCloseOnce(int fd) | |||||
{ | |||||
int i; | |||||
for (i = 0; i < nr_fds; i++) { | |||||
if (fd == connection[i].fd) { | |||||
if (--connection[i].refcount == 0) { | |||||
drmClose(connection[i].fd); | |||||
free(connection[i].BusID); | |||||
if (i < --nr_fds) | |||||
connection[i] = connection[nr_fds]; | |||||
return; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
/** | /** |
#include "glxclient.h" | #include "glxclient.h" | ||||
#include "indirect_size.h" | #include "indirect_size.h" | ||||
#include "dispatch.h" | #include "dispatch.h" | ||||
#include "glthread.h" | |||||
#include "glapi.h" | #include "glapi.h" | ||||
#include "glthread.h" | |||||
#include <GL/glxproto.h> | #include <GL/glxproto.h> | ||||
#ifdef USE_XCB | #ifdef USE_XCB | ||||
#include <X11/Xlib-xcb.h> | #include <X11/Xlib-xcb.h> |
struct array_state_vector * arrays; | struct array_state_vector * arrays; | ||||
unsigned array_count; | unsigned array_count; | ||||
unsigned texture_units = 1; | |||||
unsigned i; | |||||
unsigned j; | |||||
unsigned vertex_program_attribs = 0; | |||||
int texture_units = 1, vertex_program_attribs = 0; | |||||
unsigned i, j; | |||||
GLboolean got_fog = GL_FALSE; | GLboolean got_fog = GL_FALSE; | ||||
GLboolean got_secondary_color = GL_FALSE; | GLboolean got_secondary_color = GL_FALSE; | ||||
emit_DrawArrays_header_old( __GLXcontext * gc, | emit_DrawArrays_header_old( __GLXcontext * gc, | ||||
struct array_state_vector * arrays, | struct array_state_vector * arrays, | ||||
size_t * elements_per_request, | size_t * elements_per_request, | ||||
unsigned int * total_requests, | |||||
size_t * total_requests, | |||||
GLenum mode, GLsizei count ) | GLenum mode, GLsizei count ) | ||||
{ | { | ||||
size_t command_size; | size_t command_size; | ||||
GLubyte * pc; | GLubyte * pc; | ||||
size_t elements_per_request; | size_t elements_per_request; | ||||
unsigned total_requests = 0; | |||||
size_t total_requests = 0; | |||||
unsigned i; | unsigned i; | ||||
size_t total_sent = 0; | size_t total_sent = 0; | ||||
GLubyte * pc; | GLubyte * pc; | ||||
size_t elements_per_request; | size_t elements_per_request; | ||||
unsigned total_requests = 0; | |||||
size_t total_requests = 0; | |||||
unsigned i; | unsigned i; | ||||
unsigned req; | unsigned req; | ||||
*/gen_matypes | |||||
*/matypes.h |
$(MAKE) beos ; \ | $(MAKE) beos ; \ | ||||
elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \ | elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \ | ||||
$(MAKE) directfb ; \ | $(MAKE) directfb ; \ | ||||
elif [ "$(DRIVER_DIRS)" = "fbdev" ]; then \ | |||||
$(MAKE) fbdev ; \ | |||||
elif [ "$(DRIVER_DIRS)" = "fbdev osmesa" ]; then \ | |||||
$(MAKE) fbdev ; $(MAKE) osmesa-only ; \ | |||||
else \ | else \ | ||||
$(MAKE) stand-alone ; \ | $(MAKE) stand-alone ; \ | ||||
fi | fi |
MESA_ARRAY_CACHE_SOURCES = \ | |||||
ac_context.c \ | |||||
ac_import.c | |||||
MESA_ARRAY_CACHE_HEADERS = \ | |||||
ac_context.h \ | |||||
acache.h |
#include <pthread.h> | #include <pthread.h> | ||||
#include <direct/messages.h> | |||||
#include <direct/interface.h> | |||||
#include <direct/mem.h> | |||||
#include <directfb.h> | #include <directfb.h> | ||||
#include <directfb_version.h> | #include <directfb_version.h> | ||||
#define VERSION_CODE( M, m, r ) (((M) * 1000) + ((m) * 100) + ((r))) | |||||
#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \ | |||||
DIRECTFB_MINOR_VERSION, \ | |||||
DIRECTFB_MICRO_VERSION ) | |||||
#include <directfbgl.h> | |||||
#include <direct/mem.h> | |||||
#include <direct/messages.h> | |||||
#include <direct/interface.h> | |||||
#ifdef CLAMP | |||||
# undef CLAMP | |||||
#endif | |||||
#include "GL/directfbgl.h" | |||||
#undef CLAMP | |||||
#include "glheader.h" | #include "glheader.h" | ||||
#include "buffers.h" | #include "buffers.h" | ||||
#include "context.h" | #include "context.h" | ||||
#include "drivers/common/driverfuncs.h" | #include "drivers/common/driverfuncs.h" | ||||
#define VERSION_CODE( M, m, r ) (((M) * 1000) + ((m) * 100) + ((r))) | |||||
#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \ | |||||
DIRECTFB_MINOR_VERSION, \ | |||||
DIRECTFB_MICRO_VERSION ) | |||||
static DFBResult | static DFBResult | ||||
Probe( void *data ); | Probe( void *data ); | ||||
typedef struct { | typedef struct { | ||||
int ref; /* reference counter */ | int ref; /* reference counter */ | ||||
DFBBoolean locked; | |||||
int locked; | |||||
IDirectFBSurface *surface; | IDirectFBSurface *surface; | ||||
DFBSurfacePixelFormat format; | DFBSurfacePixelFormat format; | ||||
int height; | int height; | ||||
struct { | struct { | ||||
__u8 *start; | |||||
__u8 *end; | |||||
GLubyte *start; | |||||
GLubyte *end; | |||||
int pitch; | int pitch; | ||||
} video; | } video; | ||||
IDirectFBSurface *surface; | IDirectFBSurface *surface; | ||||
int width = 0; | int width = 0; | ||||
int height = 0; | int height = 0; | ||||
DFBResult err; | |||||
DFBResult ret; | |||||
DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); | DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); | ||||
if (data->locked) | |||||
return DFB_LOCKED; | |||||
if (data->locked) { | |||||
data->locked++; | |||||
return DFB_OK; | |||||
} | |||||
if (directfbgl_lock()) | if (directfbgl_lock()) | ||||
return DFB_LOCKED; | return DFB_LOCKED; | ||||
surface = data->surface; | surface = data->surface; | ||||
surface->GetSize( surface, &width, &height ); | surface->GetSize( surface, &width, &height ); | ||||
err = surface->Lock( surface, DSLF_READ | DSLF_WRITE, | |||||
ret = surface->Lock( surface, DSLF_READ | DSLF_WRITE, | |||||
(void*)&data->video.start, &data->video.pitch ); | (void*)&data->video.start, &data->video.pitch ); | ||||
if (err != DFB_OK) { | |||||
if (ret) { | |||||
D_ERROR( "DirectFBGL/Mesa: couldn't lock surface.\n" ); | D_ERROR( "DirectFBGL/Mesa: couldn't lock surface.\n" ); | ||||
return err; | |||||
directfbgl_unlock(); | |||||
return ret; | |||||
} | } | ||||
data->video.end = data->video.start + (height-1) * data->video.pitch; | data->video.end = data->video.start + (height-1) * data->video.pitch; | ||||
&data->framebuffer, &data->framebuffer ); | &data->framebuffer, &data->framebuffer ); | ||||
if (data->width != width || data->height != height) { | if (data->width != width || data->height != height) { | ||||
_mesa_resize_framebuffer( &data->context, | |||||
&data->framebuffer, width, height ); | |||||
data->width = width; | data->width = width; | ||||
data->height = height; | |||||
_mesa_resize_framebuffer(&data->context, | |||||
&data->framebuffer, width, height); | |||||
data->height = height; | |||||
} | } | ||||
data->locked = DFB_TRUE; | |||||
data->locked++; | |||||
return DFB_OK; | return DFB_OK; | ||||
} | } | ||||
if (!data->locked) | if (!data->locked) | ||||
return DFB_OK; | return DFB_OK; | ||||
_mesa_make_current( NULL, NULL, NULL ); | |||||
if (--data->locked == 0) { | |||||
_mesa_make_current( NULL, NULL, NULL ); | |||||
data->surface->Unlock( data->surface ); | |||||
directfbgl_unlock(); | |||||
data->surface->Unlock( data->surface ); | |||||
data->locked = DFB_FALSE; | |||||
directfbgl_unlock(); | |||||
} | |||||
return DFB_OK; | return DFB_OK; | ||||
} | } | ||||
attributes->accum_green_size = visual->accumGreenBits; | attributes->accum_green_size = visual->accumGreenBits; | ||||
attributes->accum_blue_size = visual->accumBlueBits; | attributes->accum_blue_size = visual->accumBlueBits; | ||||
attributes->accum_alpha_size = visual->accumAlphaBits; | attributes->accum_alpha_size = visual->accumAlphaBits; | ||||
attributes->double_buffer = (caps & DSCAPS_FLIPPING) ? 1 : 0; | |||||
attributes->double_buffer = ((caps & DSCAPS_FLIPPING) != 0); | |||||
attributes->stereo = (visual->stereoMode != 0); | attributes->stereo = (visual->stereoMode != 0); | ||||
return DFB_OK; | return DFB_OK; | ||||
} | } | ||||
#if DIRECTFBGL_INTERFACE_VERSION >= 1 | |||||
static DFBResult | |||||
IDirectFBGL_Mesa_GetProcAddress( IDirectFBGL *thiz, | |||||
const char *name, | |||||
void **ret_address ) | |||||
{ | |||||
DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); | |||||
if (!name) | |||||
return DFB_INVARG; | |||||
if (!ret_address) | |||||
return DFB_INVARG; | |||||
*ret_address = _glapi_get_proc_address( name ); | |||||
return (*ret_address) ? DFB_OK : DFB_UNSUPPORTED; | |||||
} | |||||
#endif | |||||
/* exported symbols */ | /* exported symbols */ | ||||
static DFBResult | static DFBResult | ||||
Construct( IDirectFBGL *thiz, IDirectFBSurface *surface ) | Construct( IDirectFBGL *thiz, IDirectFBSurface *surface ) | ||||
{ | { | ||||
DFBResult ret; | |||||
/* Initialize global resources. */ | /* Initialize global resources. */ | ||||
if (directfbgl_init()) | if (directfbgl_init()) | ||||
return DFB_INIT; | return DFB_INIT; | ||||
DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IDirectFBGL ); | DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IDirectFBGL ); | ||||
/* Initialize interface data. */ | /* Initialize interface data. */ | ||||
data->ref = 1; | |||||
data->surface = surface; | |||||
data->ref = 1; | |||||
surface->AddRef( surface ); | |||||
surface->GetPixelFormat( surface, &data->format ); | |||||
surface->GetSize( surface, &data->width, &data->height ); | |||||
/* Duplicate destination surface. */ | |||||
ret = surface->GetSubSurface( surface, NULL, &data->surface ); | |||||
if (ret) { | |||||
IDirectFBGL_Mesa_Destruct( thiz ); | |||||
return ret; | |||||
} | |||||
data->surface->GetPixelFormat( data->surface, &data->format ); | |||||
data->surface->GetSize( data->surface, &data->width, &data->height ); | |||||
/* Configure visual. */ | /* Configure visual. */ | ||||
if (!directfbgl_init_visual( &data->visual, data->format )) { | if (!directfbgl_init_visual( &data->visual, data->format )) { | ||||
} | } | ||||
/* Assign interface pointers. */ | /* Assign interface pointers. */ | ||||
thiz->AddRef = IDirectFBGL_Mesa_AddRef; | |||||
thiz->Release = IDirectFBGL_Mesa_Release; | |||||
thiz->Lock = IDirectFBGL_Mesa_Lock; | |||||
thiz->Unlock = IDirectFBGL_Mesa_Unlock; | |||||
thiz->GetAttributes = IDirectFBGL_Mesa_GetAttributes; | |||||
thiz->AddRef = IDirectFBGL_Mesa_AddRef; | |||||
thiz->Release = IDirectFBGL_Mesa_Release; | |||||
thiz->Lock = IDirectFBGL_Mesa_Lock; | |||||
thiz->Unlock = IDirectFBGL_Mesa_Unlock; | |||||
thiz->GetAttributes = IDirectFBGL_Mesa_GetAttributes; | |||||
#if DIRECTFBGL_INTERFACE_VERSION >= 1 | |||||
thiz->GetProcAddress = IDirectFBGL_Mesa_GetProcAddress; | |||||
#endif | |||||
return DFB_OK; | return DFB_OK; | ||||
} | } | ||||
static void | static void | ||||
dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) | dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) | ||||
{ | { | ||||
GLuint newWidth, newHeight; | |||||
GLframebuffer *buffer = ctx->WinSysDrawBuffer; | |||||
dfbGetBufferSize( buffer, &newWidth, &newHeight ); | |||||
if (buffer->Width != newWidth || buffer->Height != newHeight) { | |||||
_mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); | |||||
} | |||||
/* Nothing to do (the surface can't be resized while it's locked). */ | |||||
return; | |||||
} | } | ||||
static void | static void | ||||
dfbClear( GLcontext *ctx, GLbitfield mask ) | dfbClear( GLcontext *ctx, GLbitfield mask ) | ||||
{ | { | ||||
IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; | IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; | ||||
int x = ctx->DrawBuffer->_Xmin; | |||||
int y = ctx->DrawBuffer->_Ymin; | |||||
int width = ctx->DrawBuffer->_Xmax - x; | |||||
int height = ctx->DrawBuffer->_Ymax - y; | |||||
GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) | |||||
if (mask & BUFFER_BIT_FRONT_LEFT && | |||||
ctx->Color.ColorMask[0] && | |||||
ctx->Color.ColorMask[1] && | |||||
ctx->Color.ColorMask[2] && | |||||
#define BUFFER_BIT_MASK (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT | \ | |||||
BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT ) | |||||
if (mask & BUFFER_BIT_MASK && | |||||
ctx->Color.ColorMask[0] && | |||||
ctx->Color.ColorMask[1] && | |||||
ctx->Color.ColorMask[2] && | |||||
ctx->Color.ColorMask[3]) | ctx->Color.ColorMask[3]) | ||||
{ | { | ||||
DFBRegion clip; | DFBRegion clip; | ||||
__u8 a, r, g, b; | |||||
GLubyte a, r, g, b; | |||||
UNCLAMPED_FLOAT_TO_UBYTE( a, ctx->Color.ClearColor[ACOMP] ); | UNCLAMPED_FLOAT_TO_UBYTE( a, ctx->Color.ClearColor[ACOMP] ); | ||||
UNCLAMPED_FLOAT_TO_UBYTE( r, ctx->Color.ClearColor[RCOMP] ); | UNCLAMPED_FLOAT_TO_UBYTE( r, ctx->Color.ClearColor[RCOMP] ); | ||||
UNCLAMPED_FLOAT_TO_UBYTE( g, ctx->Color.ClearColor[GCOMP] ); | UNCLAMPED_FLOAT_TO_UBYTE( g, ctx->Color.ClearColor[GCOMP] ); | ||||
UNCLAMPED_FLOAT_TO_UBYTE( b, ctx->Color.ClearColor[BCOMP] ); | UNCLAMPED_FLOAT_TO_UBYTE( b, ctx->Color.ClearColor[BCOMP] ); | ||||
data->surface->Unlock( data->surface ); | |||||
#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,25) | |||||
data->surface->GetClip( data->surface, &clip ); | |||||
#else | |||||
(void)clip; | |||||
#endif | |||||
clip.x1 = ctx->DrawBuffer->_Xmin; | |||||
clip.y1 = ctx->DrawBuffer->_Ymin; | |||||
clip.x2 = ctx->DrawBuffer->_Xmax - 1; | |||||
clip.y2 = ctx->DrawBuffer->_Ymax - 1; | |||||
data->surface->SetClip( data->surface, &clip ); | |||||
if (all) { | |||||
data->surface->SetClip( data->surface, NULL ); | |||||
} | |||||
else { | |||||
DFBRegion reg = { x1:x, y1:y, x2:x+width-1, y2:y+height-1 }; | |||||
data->surface->SetClip( data->surface, ® ); | |||||
} | |||||
data->surface->Unlock( data->surface ); | |||||
data->surface->Clear( data->surface, r, g, b, a ); | data->surface->Clear( data->surface, r, g, b, a ); | ||||
#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,25) | |||||
data->surface->SetClip( data->surface, &clip ); | |||||
#endif | |||||
data->surface->Lock( data->surface, DSLF_READ | DSLF_WRITE, | data->surface->Lock( data->surface, DSLF_READ | DSLF_WRITE, | ||||
(void*)&data->video.start, &data->video.pitch ); | (void*)&data->video.start, &data->video.pitch ); | ||||
data->video.end = data->video.start + (data->height-1) * data->video.pitch; | |||||
data->render.Data = data->video.start; | |||||
mask &= ~BUFFER_BIT_FRONT_LEFT; | |||||
mask &= ~BUFFER_BIT_MASK; | |||||
} | } | ||||
#undef BUFFER_BIT_MASK | |||||
if (mask) | if (mask) | ||||
_swrast_Clear( ctx, mask ); | _swrast_Clear( ctx, mask ); | ||||
} | |||||
} | |||||
/************************ RenderBuffer functions *****************************/ | /************************ RenderBuffer functions *****************************/ | ||||
data->render.GetRow = get_row_RGB332; | data->render.GetRow = get_row_RGB332; | ||||
data->render.GetValues = get_values_RGB332; | data->render.GetValues = get_values_RGB332; | ||||
data->render.PutRow = put_row_RGB332; | data->render.PutRow = put_row_RGB332; | ||||
data->render.PutRowRGB = put_row_rgb_RGB332; | |||||
data->render.PutMonoRow = put_mono_row_RGB332; | data->render.PutMonoRow = put_mono_row_RGB332; | ||||
data->render.PutValues = put_values_RGB332; | data->render.PutValues = put_values_RGB332; | ||||
data->render.PutMonoValues = put_mono_values_RGB332; | data->render.PutMonoValues = put_mono_values_RGB332; | ||||
data->render.GetRow = get_row_ARGB4444; | data->render.GetRow = get_row_ARGB4444; | ||||
data->render.GetValues = get_values_ARGB4444; | data->render.GetValues = get_values_ARGB4444; | ||||
data->render.PutRow = put_row_ARGB4444; | data->render.PutRow = put_row_ARGB4444; | ||||
data->render.PutRowRGB = put_row_rgb_ARGB4444; | |||||
data->render.PutMonoRow = put_mono_row_ARGB4444; | data->render.PutMonoRow = put_mono_row_ARGB4444; | ||||
data->render.PutValues = put_values_ARGB4444; | data->render.PutValues = put_values_ARGB4444; | ||||
data->render.PutMonoValues = put_mono_values_ARGB4444; | data->render.PutMonoValues = put_mono_values_ARGB4444; | ||||
data->render.GetRow = get_row_ARGB2554; | data->render.GetRow = get_row_ARGB2554; | ||||
data->render.GetValues = get_values_ARGB2554; | data->render.GetValues = get_values_ARGB2554; | ||||
data->render.PutRow = put_row_ARGB2554; | data->render.PutRow = put_row_ARGB2554; | ||||
data->render.PutRowRGB = put_row_rgb_ARGB2554; | |||||
data->render.PutMonoRow = put_mono_row_ARGB2554; | data->render.PutMonoRow = put_mono_row_ARGB2554; | ||||
data->render.PutValues = put_values_ARGB2554; | data->render.PutValues = put_values_ARGB2554; | ||||
data->render.PutMonoValues = put_mono_values_ARGB2554; | data->render.PutMonoValues = put_mono_values_ARGB2554; | ||||
data->render.GetRow = get_row_ARGB1555; | data->render.GetRow = get_row_ARGB1555; | ||||
data->render.GetValues = get_values_ARGB1555; | data->render.GetValues = get_values_ARGB1555; | ||||
data->render.PutRow = put_row_ARGB1555; | data->render.PutRow = put_row_ARGB1555; | ||||
data->render.PutRowRGB = put_row_rgb_ARGB1555; | |||||
data->render.PutMonoRow = put_mono_row_ARGB1555; | data->render.PutMonoRow = put_mono_row_ARGB1555; | ||||
data->render.PutValues = put_values_ARGB1555; | data->render.PutValues = put_values_ARGB1555; | ||||
data->render.PutMonoValues = put_mono_values_ARGB1555; | data->render.PutMonoValues = put_mono_values_ARGB1555; | ||||
data->render.GetRow = get_row_RGB16; | data->render.GetRow = get_row_RGB16; | ||||
data->render.GetValues = get_values_RGB16; | data->render.GetValues = get_values_RGB16; | ||||
data->render.PutRow = put_row_RGB16; | data->render.PutRow = put_row_RGB16; | ||||
data->render.PutRowRGB = put_row_rgb_RGB16; | |||||
data->render.PutMonoRow = put_mono_row_RGB16; | data->render.PutMonoRow = put_mono_row_RGB16; | ||||
data->render.PutValues = put_values_RGB16; | data->render.PutValues = put_values_RGB16; | ||||
data->render.PutMonoValues = put_mono_values_RGB16; | data->render.PutMonoValues = put_mono_values_RGB16; | ||||
data->render.GetRow = get_row_RGB24; | data->render.GetRow = get_row_RGB24; | ||||
data->render.GetValues = get_values_RGB24; | data->render.GetValues = get_values_RGB24; | ||||
data->render.PutRow = put_row_RGB24; | data->render.PutRow = put_row_RGB24; | ||||
data->render.PutRowRGB = put_row_rgb_RGB24; | |||||
data->render.PutMonoRow = put_mono_row_RGB24; | data->render.PutMonoRow = put_mono_row_RGB24; | ||||
data->render.PutValues = put_values_RGB24; | data->render.PutValues = put_values_RGB24; | ||||
data->render.PutMonoValues = put_mono_values_RGB24; | data->render.PutMonoValues = put_mono_values_RGB24; | ||||
data->render.GetRow = get_row_RGB32; | data->render.GetRow = get_row_RGB32; | ||||
data->render.GetValues = get_values_RGB32; | data->render.GetValues = get_values_RGB32; | ||||
data->render.PutRow = put_row_RGB32; | data->render.PutRow = put_row_RGB32; | ||||
data->render.PutRowRGB = put_row_rgb_RGB32; | |||||
data->render.PutMonoRow = put_mono_row_RGB32; | data->render.PutMonoRow = put_mono_row_RGB32; | ||||
data->render.PutValues = put_values_RGB32; | data->render.PutValues = put_values_RGB32; | ||||
data->render.PutMonoValues = put_mono_values_RGB32; | data->render.PutMonoValues = put_mono_values_RGB32; | ||||
data->render.GetRow = get_row_ARGB; | data->render.GetRow = get_row_ARGB; | ||||
data->render.GetValues = get_values_ARGB; | data->render.GetValues = get_values_ARGB; | ||||
data->render.PutRow = put_row_ARGB; | data->render.PutRow = put_row_ARGB; | ||||
data->render.PutRowRGB = put_row_rgb_ARGB; | |||||
data->render.PutMonoRow = put_mono_row_ARGB; | data->render.PutMonoRow = put_mono_row_ARGB; | ||||
data->render.PutValues = put_values_ARGB; | data->render.PutValues = put_values_ARGB; | ||||
data->render.PutMonoValues = put_mono_values_ARGB; | data->render.PutMonoValues = put_mono_values_ARGB; | ||||
data->render.GetRow = get_row_AiRGB; | data->render.GetRow = get_row_AiRGB; | ||||
data->render.GetValues = get_values_AiRGB; | data->render.GetValues = get_values_AiRGB; | ||||
data->render.PutRow = put_row_AiRGB; | data->render.PutRow = put_row_AiRGB; | ||||
data->render.PutRowRGB = put_row_rgb_AiRGB; | |||||
data->render.PutMonoRow = put_mono_row_AiRGB; | data->render.PutMonoRow = put_mono_row_AiRGB; | ||||
data->render.PutValues = put_values_AiRGB; | data->render.PutValues = put_values_AiRGB; | ||||
data->render.PutMonoValues = put_mono_values_AiRGB; | data->render.PutMonoValues = put_mono_values_AiRGB; |
if (!pcp | if (!pcp | ||||
|| ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) { | || ((pdp != pcp->driDrawablePriv) && (pdp != pcp->driReadablePriv))) { | ||||
/* ERROR!!! */ | |||||
return; | |||||
/* ERROR!!! | |||||
* ...but we must ignore it. There can be many contexts bound to a | |||||
* drawable. | |||||
*/ | |||||
} | } | ||||
psp = pdp->driScreenPriv; | psp = pdp->driScreenPriv; | ||||
if (!psp) { | if (!psp) { | ||||
/* ERROR!!! */ | /* ERROR!!! */ | ||||
_mesa_problem("Warning! Possible infinite loop due to bug " | |||||
"in file %s, line %d\n", | |||||
__FILE__, __LINE__); | |||||
return; | return; | ||||
} | } | ||||
static void driSwapBuffers( __DRInativeDisplay *dpy, void *drawablePrivate ) | static void driSwapBuffers( __DRInativeDisplay *dpy, void *drawablePrivate ) | ||||
{ | { | ||||
__DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; | __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; | ||||
drm_clip_rect_t rect; | |||||
dPriv->swapBuffers(dPriv); | dPriv->swapBuffers(dPriv); | ||||
(void) dpy; | |||||
/* Check that we actually have the new damage report method */ | |||||
if (api_ver < 20070105 || dri_interface->reportDamage == NULL) | |||||
return; | |||||
/* Assume it's affecting the whole drawable for now */ | |||||
rect.x1 = 0; | |||||
rect.y1 = 0; | |||||
rect.x2 = rect.x1 + dPriv->w; | |||||
rect.y2 = rect.y1 + dPriv->h; | |||||
/* Report the damage. Currently, all our drivers draw directly to the | |||||
* front buffer, so we report the damage there rather than to the backing | |||||
* store (if any). | |||||
*/ | |||||
(*dri_interface->reportDamage)(dpy, dPriv->screen, dPriv->draw, | |||||
dPriv->x, dPriv->y, | |||||
&rect, 1, GL_TRUE); | |||||
} | } | ||||
/** | /** |
*/ | */ | ||||
GLboolean depthHasSurface; | GLboolean depthHasSurface; | ||||
/* XXX this is for s3v only. A handy flag to know if this is the back | |||||
* color buffer. | |||||
/** | |||||
* A handy flag to know if this is the back color buffer. | |||||
* | |||||
* \note | |||||
* This is currently only used by s3v and tdfx. | |||||
*/ | */ | ||||
GLboolean backBuffer; | GLboolean backBuffer; | ||||
} driRenderbuffer; | } driRenderbuffer; |
de | |||||
es | |||||
fr | |||||
nl | |||||
sv |
# - info gettext | # - info gettext | ||||
# The set of supported languages. Add languages as needed. | # The set of supported languages. Add languages as needed. | ||||
POS=de.po es.po nl.po fr.po | |||||
POS=de.po es.po nl.po fr.po sv.po | |||||
# | # | ||||
# Don't change anything below, unless you know what you're doing. | # Don't change anything below, unless you know what you're doing. |
DRI_CONF_DESC(de,"Fehlersuche") \ | DRI_CONF_DESC(de,"Fehlersuche") \ | ||||
DRI_CONF_DESC(es,"Depurando") \ | DRI_CONF_DESC(es,"Depurando") \ | ||||
DRI_CONF_DESC(nl,"Debuggen") \ | DRI_CONF_DESC(nl,"Debuggen") \ | ||||
DRI_CONF_DESC(fr,"Debogage") | |||||
DRI_CONF_DESC(fr,"Debogage") \ | |||||
DRI_CONF_DESC(sv,"Felsökning") | |||||
#define DRI_CONF_NO_RAST(def) \ | #define DRI_CONF_NO_RAST(def) \ | ||||
DRI_CONF_OPT_BEGIN(no_rast,bool,def) \ | DRI_CONF_OPT_BEGIN(no_rast,bool,def) \ | ||||
DRI_CONF_DESC(es,"Desactivar aceleración 3D") \ | DRI_CONF_DESC(es,"Desactivar aceleración 3D") \ | ||||
DRI_CONF_DESC(nl,"3D versnelling uitschakelen") \ | DRI_CONF_DESC(nl,"3D versnelling uitschakelen") \ | ||||
DRI_CONF_DESC(fr,"Désactiver l'accélération 3D") \ | DRI_CONF_DESC(fr,"Désactiver l'accélération 3D") \ | ||||
DRI_CONF_DESC(sv,"Inaktivera 3D-accelerering") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_PERFORMANCE_BOXES(def) \ | #define DRI_CONF_PERFORMANCE_BOXES(def) \ | ||||
DRI_CONF_DESC(es,"Mostrar cajas de rendimiento") \ | DRI_CONF_DESC(es,"Mostrar cajas de rendimiento") \ | ||||
DRI_CONF_DESC(nl,"Laat prestatie boxjes zien") \ | DRI_CONF_DESC(nl,"Laat prestatie boxjes zien") \ | ||||
DRI_CONF_DESC(fr,"Afficher les boîtes de performance") \ | DRI_CONF_DESC(fr,"Afficher les boîtes de performance") \ | ||||
DRI_CONF_DESC(sv,"Visa prestandarutor") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
DRI_CONF_DESC(de,"Bildqualität") \ | DRI_CONF_DESC(de,"Bildqualität") \ | ||||
DRI_CONF_DESC(es,"Calidad de imagen") \ | DRI_CONF_DESC(es,"Calidad de imagen") \ | ||||
DRI_CONF_DESC(nl,"Beeldkwaliteit") \ | DRI_CONF_DESC(nl,"Beeldkwaliteit") \ | ||||
DRI_CONF_DESC(fr,"Qualité d'image") | |||||
DRI_CONF_DESC(fr,"Qualité d'image") \ | |||||
DRI_CONF_DESC(sv,"Bildkvalitet") | |||||
#define DRI_CONF_EXCESS_MIPMAP(def) \ | #define DRI_CONF_EXCESS_MIPMAP(def) \ | ||||
DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \ | DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \ | ||||
DRI_CONF_ENUM(2,"Prérérer 16 bits par texel") \ | DRI_CONF_ENUM(2,"Prérérer 16 bits par texel") \ | ||||
DRI_CONF_ENUM(3,"Forcer 16 bits par texel") \ | DRI_CONF_ENUM(3,"Forcer 16 bits par texel") \ | ||||
DRI_CONF_DESC_END \ | DRI_CONF_DESC_END \ | ||||
DRI_CONF_DESC_BEGIN(sv,"Färgdjup för texturer") \ | |||||
DRI_CONF_ENUM(0,"Föredra färgdjupet för framebuffer") \ | |||||
DRI_CONF_ENUM(1,"Föredra 32 bitar per texel") \ | |||||
DRI_CONF_ENUM(2,"Föredra 16 bitar per texel") \ | |||||
DRI_CONF_ENUM(3,"Tvinga 16 bitar per texel") \ | |||||
DRI_CONF_DESC_END \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_DEF_MAX_ANISOTROPY(def,range) \ | #define DRI_CONF_DEF_MAX_ANISOTROPY(def,range) \ | ||||
DRI_CONF_DESC(es,"Valor máximo inicial para filtrado anisotrópico de textura") \ | DRI_CONF_DESC(es,"Valor máximo inicial para filtrado anisotrópico de textura") \ | ||||
DRI_CONF_DESC(nl,"Initïele maximum waarde voor anisotrophische textuur filtering") \ | DRI_CONF_DESC(nl,"Initïele maximum waarde voor anisotrophische textuur filtering") \ | ||||
DRI_CONF_DESC(fr,"Valeur maximale initiale pour le filtrage anisotropique de texture") \ | DRI_CONF_DESC(fr,"Valeur maximale initiale pour le filtrage anisotropique de texture") \ | ||||
DRI_CONF_DESC(sv,"Initialt maximalt värde för anisotropisk texturfiltrering") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_NO_NEG_LOD_BIAS(def) \ | #define DRI_CONF_NO_NEG_LOD_BIAS(def) \ | ||||
DRI_CONF_DESC(es,"Prohibir valores negativos de Nivel De Detalle (LOD) de texturas") \ | DRI_CONF_DESC(es,"Prohibir valores negativos de Nivel De Detalle (LOD) de texturas") \ | ||||
DRI_CONF_DESC(nl,"Verbied negatief niveau detailonderscheid (LOD) van texturen") \ | DRI_CONF_DESC(nl,"Verbied negatief niveau detailonderscheid (LOD) van texturen") \ | ||||
DRI_CONF_DESC(fr,"Interdire le LOD bias negatif") \ | DRI_CONF_DESC(fr,"Interdire le LOD bias negatif") \ | ||||
DRI_CONF_DESC(sv,"Förbjud negativ LOD-kompensation för texturer") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_FORCE_S3TC_ENABLE(def) \ | #define DRI_CONF_FORCE_S3TC_ENABLE(def) \ | ||||
DRI_CONF_DESC(es,"Activar la compresión de texturas S3TC incluso si el soporte por software no está disponible") \ | DRI_CONF_DESC(es,"Activar la compresión de texturas S3TC incluso si el soporte por software no está disponible") \ | ||||
DRI_CONF_DESC(nl,"Schakel S3TC textuurcompressie in, zelfs als softwareondersteuning niet aanwezig is") \ | DRI_CONF_DESC(nl,"Schakel S3TC textuurcompressie in, zelfs als softwareondersteuning niet aanwezig is") \ | ||||
DRI_CONF_DESC(fr,"Activer la compression de texture S3TC même si le support logiciel est absent") \ | DRI_CONF_DESC(fr,"Activer la compression de texture S3TC même si le support logiciel est absent") \ | ||||
DRI_CONF_DESC(sv,"Aktivera S3TC-texturkomprimering även om programvarustöd saknas") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_COLOR_REDUCTION_ROUND 0 | #define DRI_CONF_COLOR_REDUCTION_ROUND 0 | ||||
DRI_CONF_ENUM(0,"Arrondir les valeurs de couleur") \ | DRI_CONF_ENUM(0,"Arrondir les valeurs de couleur") \ | ||||
DRI_CONF_ENUM(1,"Tramer les couleurs") \ | DRI_CONF_ENUM(1,"Tramer les couleurs") \ | ||||
DRI_CONF_DESC_END \ | DRI_CONF_DESC_END \ | ||||
DRI_CONF_DESC_BEGIN(sv,"Initial färgminskningsmetod") \ | |||||
DRI_CONF_ENUM(0,"Avrunda färger") \ | |||||
DRI_CONF_ENUM(1,"Utjämna färger") \ | |||||
DRI_CONF_DESC_END \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_ROUND_TRUNC 0 | #define DRI_CONF_ROUND_TRUNC 0 | ||||
DRI_CONF_ENUM(0,"Arrondi à l'inférieur") \ | DRI_CONF_ENUM(0,"Arrondi à l'inférieur") \ | ||||
DRI_CONF_ENUM(1,"Arrondi au plus proche") \ | DRI_CONF_ENUM(1,"Arrondi au plus proche") \ | ||||
DRI_CONF_DESC_END \ | DRI_CONF_DESC_END \ | ||||
DRI_CONF_DESC_BEGIN(sv,"Färgavrundningsmetod") \ | |||||
DRI_CONF_ENUM(0,"Avrunda färdkomponenter nedåt") \ | |||||
DRI_CONF_ENUM(1,"Avrunda till närmsta färg") \ | |||||
DRI_CONF_DESC_END \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_DITHER_XERRORDIFF 0 | #define DRI_CONF_DITHER_XERRORDIFF 0 | ||||
DRI_CONF_ENUM(1,"Diffusion d'erreur horizontale, réinitialisé pour chaque ligne") \ | DRI_CONF_ENUM(1,"Diffusion d'erreur horizontale, réinitialisé pour chaque ligne") \ | ||||
DRI_CONF_ENUM(2,"Tramage ordonné des couleurs") \ | DRI_CONF_ENUM(2,"Tramage ordonné des couleurs") \ | ||||
DRI_CONF_DESC_END \ | DRI_CONF_DESC_END \ | ||||
DRI_CONF_DESC_BEGIN(sv,"Färgutjämningsmetod") \ | |||||
DRI_CONF_ENUM(0,"Horisontell felspridning") \ | |||||
DRI_CONF_ENUM(1,"Horisontell felspridning, återställ fel vid radbörjan") \ | |||||
DRI_CONF_ENUM(2,"Ordnad 2D-färgutjämning") \ | |||||
DRI_CONF_DESC_END \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_FLOAT_DEPTH(def) \ | #define DRI_CONF_FLOAT_DEPTH(def) \ | ||||
DRI_CONF_DESC(es,"Búfer de profundidad en coma flotante") \ | DRI_CONF_DESC(es,"Búfer de profundidad en coma flotante") \ | ||||
DRI_CONF_DESC(nl,"Dieptebuffer als commagetal") \ | DRI_CONF_DESC(nl,"Dieptebuffer als commagetal") \ | ||||
DRI_CONF_DESC(fr,"Z-buffer en virgule flottante") \ | DRI_CONF_DESC(fr,"Z-buffer en virgule flottante") \ | ||||
DRI_CONF_DESC(sv,"Buffert för flytande punktdjup") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
/** \brief Performance-related options */ | /** \brief Performance-related options */ | ||||
DRI_CONF_DESC(de,"Leistung") \ | DRI_CONF_DESC(de,"Leistung") \ | ||||
DRI_CONF_DESC(es,"Rendimiento") \ | DRI_CONF_DESC(es,"Rendimiento") \ | ||||
DRI_CONF_DESC(nl,"Prestatie") \ | DRI_CONF_DESC(nl,"Prestatie") \ | ||||
DRI_CONF_DESC(fr,"Performance") | |||||
DRI_CONF_DESC(fr,"Performance") \ | |||||
DRI_CONF_DESC(sv,"Prestanda") | |||||
#define DRI_CONF_TCL_SW 0 | #define DRI_CONF_TCL_SW 0 | ||||
#define DRI_CONF_TCL_PIPELINED 1 | #define DRI_CONF_TCL_PIPELINED 1 | ||||
DRI_CONF_ENUM(2,"Court-circuiter le pipeline TCL") \ | DRI_CONF_ENUM(2,"Court-circuiter le pipeline TCL") \ | ||||
DRI_CONF_ENUM(3,"Court-circuiter le pipeline TCL par une machine à états qui génère le codede TCL à la volée") \ | DRI_CONF_ENUM(3,"Court-circuiter le pipeline TCL par une machine à états qui génère le codede TCL à la volée") \ | ||||
DRI_CONF_DESC_END \ | DRI_CONF_DESC_END \ | ||||
DRI_CONF_DESC_BEGIN(sv,"TCL-läge (Transformation, Clipping, Lighting)") \ | |||||
DRI_CONF_ENUM(0,"Använd programvaru-TCL-rörledning") \ | |||||
DRI_CONF_ENUM(1,"Använd maskinvaru-TCL som första TCL-rörledningssteg") \ | |||||
DRI_CONF_ENUM(2,"Kringgå TCL-rörledningen") \ | |||||
DRI_CONF_ENUM(3,"Kringgå TCL-rörledningen med tillståndsbaserad maskinkod som direktgenereras") \ | |||||
DRI_CONF_DESC_END \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_FTHROTTLE_BUSY 0 | #define DRI_CONF_FTHROTTLE_BUSY 0 | ||||
DRI_CONF_ENUM(1,"Attente utilisant usleep()") \ | DRI_CONF_ENUM(1,"Attente utilisant usleep()") \ | ||||
DRI_CONF_ENUM(2,"Utiliser les interruptions") \ | DRI_CONF_ENUM(2,"Utiliser les interruptions") \ | ||||
DRI_CONF_DESC_END \ | DRI_CONF_DESC_END \ | ||||
DRI_CONF_DESC_BEGIN(sv,"Metod för att begränsa renderingslatens") \ | |||||
DRI_CONF_ENUM(0,"Upptagen med att vänta på grafikhårdvaran") \ | |||||
DRI_CONF_ENUM(1,"Sov i korta intervall under väntan på grafikhårdvaran") \ | |||||
DRI_CONF_ENUM(2,"Låt grafikhårdvaran sända ut ett programvaruavbrott och sov") \ | |||||
DRI_CONF_DESC_END \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_VBLANK_NEVER 0 | #define DRI_CONF_VBLANK_NEVER 0 | ||||
DRI_CONF_ENUM(2,"Synchroniser avec le balayage vertical par défaut, mais obéir au choix de l'application") \ | DRI_CONF_ENUM(2,"Synchroniser avec le balayage vertical par défaut, mais obéir au choix de l'application") \ | ||||
DRI_CONF_ENUM(3,"Toujours synchroniser avec le balayage vertical, l'application choisit l'intervalle minimal") \ | DRI_CONF_ENUM(3,"Toujours synchroniser avec le balayage vertical, l'application choisit l'intervalle minimal") \ | ||||
DRI_CONF_DESC_END \ | DRI_CONF_DESC_END \ | ||||
DRI_CONF_DESC_BEGIN(sv,"Synkronisering med vertikal uppdatering (växlingsintervall)") \ | |||||
DRI_CONF_ENUM(0,"Synkronisera aldrig med vertikal uppdatering, ignorera programmets val") \ | |||||
DRI_CONF_ENUM(1,"Initialt växlingsintervall 0, följ programmets val") \ | |||||
DRI_CONF_ENUM(2,"Initialt växlingsintervall 1, följ programmets val") \ | |||||
DRI_CONF_ENUM(3,"Synkronisera alltid med vertikal uppdatering, programmet väljer den minsta växlingsintervallen") \ | |||||
DRI_CONF_DESC_END \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_HYPERZ_DISABLED 0 | #define DRI_CONF_HYPERZ_DISABLED 0 | ||||
DRI_CONF_DESC(es,"Usar HyperZ para potenciar rendimiento") \ | DRI_CONF_DESC(es,"Usar HyperZ para potenciar rendimiento") \ | ||||
DRI_CONF_DESC(nl,"Gebruik HyperZ om de prestaties te verbeteren") \ | DRI_CONF_DESC(nl,"Gebruik HyperZ om de prestaties te verbeteren") \ | ||||
DRI_CONF_DESC(fr,"Utiliser le HyperZ pour améliorer les performances") \ | DRI_CONF_DESC(fr,"Utiliser le HyperZ pour améliorer les performances") \ | ||||
DRI_CONF_DESC(sv,"Använd HyperZ för att maximera prestandan") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \ | #define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \ | ||||
DRI_CONF_DESC(es,"Número de unidades de textura usadas") \ | DRI_CONF_DESC(es,"Número de unidades de textura usadas") \ | ||||
DRI_CONF_DESC(nl,"Aantal textuureenheden in gebruik") \ | DRI_CONF_DESC(nl,"Aantal textuureenheden in gebruik") \ | ||||
DRI_CONF_DESC(fr,"Nombre d'unités de texture") \ | DRI_CONF_DESC(fr,"Nombre d'unités de texture") \ | ||||
DRI_CONF_DESC(sv,"Antal använda texturenheter") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_ALLOW_LARGE_TEXTURES(def) \ | #define DRI_CONF_ALLOW_LARGE_TEXTURES(def) \ | ||||
DRI_CONF_ENUM(1,"At least 1 texture must fit under worst-case assumptions") \ | DRI_CONF_ENUM(1,"At least 1 texture must fit under worst-case assumptions") \ | ||||
DRI_CONF_ENUM(2,"Announce hardware limits") \ | DRI_CONF_ENUM(2,"Announce hardware limits") \ | ||||
DRI_CONF_DESC_END \ | DRI_CONF_DESC_END \ | ||||
DRI_CONF_DESC_BEGIN(sv,"Stöd för större texturer är inte garanterat att passa i grafikminnet") \ | |||||
DRI_CONF_ENUM(0,"Nej") \ | |||||
DRI_CONF_ENUM(1,"Åtminstone en textur måste passa för antaget sämsta förhållande") \ | |||||
DRI_CONF_ENUM(2,"Annonsera hårdvarubegränsningar") \ | |||||
DRI_CONF_DESC_END \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \ | #define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \ | ||||
DRI_CONF_DESC(es,"Calidad de filtrado de textura vs. velocidad, alias filtrado ”brilinear“ de textura") \ | DRI_CONF_DESC(es,"Calidad de filtrado de textura vs. velocidad, alias filtrado ”brilinear“ de textura") \ | ||||
DRI_CONF_DESC(nl,"Textuurfilterkwaliteit versus -snelheid, ookwel bekend als “brilineaire” textuurfiltering") \ | DRI_CONF_DESC(nl,"Textuurfilterkwaliteit versus -snelheid, ookwel bekend als “brilineaire” textuurfiltering") \ | ||||
DRI_CONF_DESC(fr,"Qualité/performance du filtrage trilinéaire de texture (filtrage brilinéaire)") \ | DRI_CONF_DESC(fr,"Qualité/performance du filtrage trilinéaire de texture (filtrage brilinéaire)") \ | ||||
DRI_CONF_DESC(sv,"Texturfiltreringskvalitet mot hastighet, även kallad ”brilinear”-texturfiltrering") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_TEXTURE_HEAPS_ALL 0 | #define DRI_CONF_TEXTURE_HEAPS_ALL 0 | ||||
DRI_CONF_ENUM(1,"Utiliser uniquement la mémoire graphique (si disponible)") \ | DRI_CONF_ENUM(1,"Utiliser uniquement la mémoire graphique (si disponible)") \ | ||||
DRI_CONF_ENUM(2,"Utiliser uniquement la mémoire GART (AGP/PCIE) (si disponible)") \ | DRI_CONF_ENUM(2,"Utiliser uniquement la mémoire GART (AGP/PCIE) (si disponible)") \ | ||||
DRI_CONF_DESC_END \ | DRI_CONF_DESC_END \ | ||||
DRI_CONF_DESC_BEGIN(sv,"Använda typer av texturminne") \ | |||||
DRI_CONF_ENUM(0,"Allt tillgängligt minne") \ | |||||
DRI_CONF_ENUM(1,"Endast kortminne (om tillgängligt)") \ | |||||
DRI_CONF_ENUM(2,"Endast GART-minne (AGP/PCIE) (om tillgängligt)") \ | |||||
DRI_CONF_DESC_END \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
/* Options for features that are not done in hardware by the driver (like GL_ARB_vertex_program | /* Options for features that are not done in hardware by the driver (like GL_ARB_vertex_program | ||||
DRI_CONF_DESC(de,"Funktionalität, die nicht hardwarebeschleunigt ist") \ | DRI_CONF_DESC(de,"Funktionalität, die nicht hardwarebeschleunigt ist") \ | ||||
DRI_CONF_DESC(es,"Características no aceleradas por hardware") \ | DRI_CONF_DESC(es,"Características no aceleradas por hardware") \ | ||||
DRI_CONF_DESC(nl,"Eigenschappen die niet hardwareversneld zijn") \ | DRI_CONF_DESC(nl,"Eigenschappen die niet hardwareversneld zijn") \ | ||||
DRI_CONF_DESC(fr,"Fonctionnalités ne bénéficiant pas d'une accélération matérielle") | |||||
DRI_CONF_DESC(fr,"Fonctionnalités ne bénéficiant pas d'une accélération matérielle") \ | |||||
DRI_CONF_DESC(sv,"Funktioner som inte är hårdvaruaccelererade") | |||||
#define DRI_CONF_ARB_VERTEX_PROGRAM(def) \ | #define DRI_CONF_ARB_VERTEX_PROGRAM(def) \ | ||||
DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \ | DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \ | ||||
DRI_CONF_DESC(es,"Activar la extensión GL_ARB_vertex_program") \ | DRI_CONF_DESC(es,"Activar la extensión GL_ARB_vertex_program") \ | ||||
DRI_CONF_DESC(nl,"Zet uitbreiding GL_ARB_vertex_program aan") \ | DRI_CONF_DESC(nl,"Zet uitbreiding GL_ARB_vertex_program aan") \ | ||||
DRI_CONF_DESC(fr,"Activer l'extension GL_ARB_vertex_program") \ | DRI_CONF_DESC(fr,"Activer l'extension GL_ARB_vertex_program") \ | ||||
DRI_CONF_DESC(sv,"Aktivera tillägget GL_ARB_vertex_program") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END | ||||
#define DRI_CONF_NV_VERTEX_PROGRAM(def) \ | #define DRI_CONF_NV_VERTEX_PROGRAM(def) \ | ||||
DRI_CONF_DESC(es,"Activar extensión GL_NV_vertex_program") \ | DRI_CONF_DESC(es,"Activar extensión GL_NV_vertex_program") \ | ||||
DRI_CONF_DESC(nl,"Zet uitbreiding GL_NV_vertex_program aan") \ | DRI_CONF_DESC(nl,"Zet uitbreiding GL_NV_vertex_program aan") \ | ||||
DRI_CONF_DESC(fr,"Activer l'extension GL_NV_vertex_program") \ | DRI_CONF_DESC(fr,"Activer l'extension GL_NV_vertex_program") \ | ||||
DRI_CONF_DESC(sv,"Aktivera tillägget GL_NV_vertex_program") \ | |||||
DRI_CONF_OPT_END | DRI_CONF_OPT_END |
# Swedish translation of DRI driver options. | |||||
# Copyright (C) Free Software Foundation, Inc. | |||||
# This file is distributed under the same license as the Mesa package. | |||||
# Daniel Nylander <po@danielnylander.se>, 2006. | |||||
# | |||||
msgid "" | |||||
msgstr "" | |||||
"Project-Id-Version: Mesa DRI\n" | |||||
"Report-Msgid-Bugs-To: \n" | |||||
"POT-Creation-Date: 2005-04-11 23:19+0200\n" | |||||
"PO-Revision-Date: 2006-09-18 10:56+0100\n" | |||||
"Last-Translator: Daniel Nylander <po@danielnylander.se>\n" | |||||
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" | |||||
"MIME-Version: 1.0\n" | |||||
"Content-Type: text/plain; charset=UTF-8\n" | |||||
"Content-Transfer-Encoding: 8bit\n" | |||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | |||||
#: t_options.h:53 | |||||
msgid "Debugging" | |||||
msgstr "Felsökning" | |||||
#: t_options.h:57 | |||||
msgid "Disable 3D acceleration" | |||||
msgstr "Inaktivera 3D-accelerering" | |||||
#: t_options.h:62 | |||||
msgid "Show performance boxes" | |||||
msgstr "Visa prestandarutor" | |||||
#: t_options.h:69 | |||||
msgid "Image Quality" | |||||
msgstr "Bildkvalitet" | |||||
#: t_options.h:77 | |||||
msgid "Texture color depth" | |||||
msgstr "Färgdjup för texturer" | |||||
#: t_options.h:78 | |||||
msgid "Prefer frame buffer color depth" | |||||
msgstr "Föredra färgdjupet för framebuffer" | |||||
#: t_options.h:79 | |||||
msgid "Prefer 32 bits per texel" | |||||
msgstr "Föredra 32 bitar per texel" | |||||
#: t_options.h:80 | |||||
msgid "Prefer 16 bits per texel" | |||||
msgstr "Föredra 16 bitar per texel" | |||||
#: t_options.h:81 | |||||
msgid "Force 16 bits per texel" | |||||
msgstr "Tvinga 16 bitar per texel" | |||||
#: t_options.h:87 | |||||
msgid "Initial maximum value for anisotropic texture filtering" | |||||
msgstr "Initialt maximalt värde för anisotropisk texturfiltrering" | |||||
#: t_options.h:92 | |||||
msgid "Forbid negative texture LOD bias" | |||||
msgstr "Förbjud negativ LOD-kompensation för texturer" | |||||
#: t_options.h:97 | |||||
msgid "Enable S3TC texture compression even if software support is not available" | |||||
msgstr "Aktivera S3TC-texturkomprimering även om programvarustöd saknas" | |||||
#: t_options.h:104 | |||||
msgid "Initial color reduction method" | |||||
msgstr "Initial färgminskningsmetod" | |||||
#: t_options.h:105 | |||||
msgid "Round colors" | |||||
msgstr "Avrunda färger" | |||||
#: t_options.h:106 | |||||
msgid "Dither colors" | |||||
msgstr "Utjämna färger" | |||||
#: t_options.h:114 | |||||
msgid "Color rounding method" | |||||
msgstr "Färgavrundningsmetod" | |||||
#: t_options.h:115 | |||||
msgid "Round color components downward" | |||||
msgstr "Avrunda färdkomponenter nedåt" | |||||
#: t_options.h:116 | |||||
msgid "Round to nearest color" | |||||
msgstr "Avrunda till närmsta färg" | |||||
#: t_options.h:125 | |||||
msgid "Color dithering method" | |||||
msgstr "Färgutjämningsmetod" | |||||
#: t_options.h:126 | |||||
msgid "Horizontal error diffusion" | |||||
msgstr "Horisontell felspridning" | |||||
#: t_options.h:127 | |||||
msgid "Horizontal error diffusion, reset error at line start" | |||||
msgstr "Horisontell felspridning, återställ fel vid radbörjan" | |||||
#: t_options.h:128 | |||||
msgid "Ordered 2D color dithering" | |||||
msgstr "Ordnad 2D-färgutjämning" | |||||
#: t_options.h:134 | |||||
msgid "Floating point depth buffer" | |||||
msgstr "Buffert för flytande punktdjup" | |||||
#: t_options.h:140 | |||||
msgid "Performance" | |||||
msgstr "Prestanda" | |||||
#: t_options.h:148 | |||||
msgid "TCL mode (Transformation, Clipping, Lighting)" | |||||
msgstr "TCL-läge (Transformation, Clipping, Lighting)" | |||||
#: t_options.h:149 | |||||
msgid "Use software TCL pipeline" | |||||
msgstr "Använd programvaru-TCL-rörledning" | |||||
#: t_options.h:150 | |||||
msgid "Use hardware TCL as first TCL pipeline stage" | |||||
msgstr "Använd maskinvaru-TCL som första TCL-rörledningssteg" | |||||
#: t_options.h:151 | |||||
msgid "Bypass the TCL pipeline" | |||||
msgstr "Kringgå TCL-rörledningen" | |||||
#: t_options.h:152 | |||||
msgid "Bypass the TCL pipeline with state-based machine code generated on-the-fly" | |||||
msgstr "Kringgå TCL-rörledningen med tillståndsbaserad maskinkod som direktgenereras" | |||||
#: t_options.h:161 | |||||
msgid "Method to limit rendering latency" | |||||
msgstr "Metod för att begränsa renderingslatens" | |||||
#: t_options.h:162 | |||||
msgid "Busy waiting for the graphics hardware" | |||||
msgstr "Upptagen med att vänta på grafikhårdvaran" | |||||
#: t_options.h:163 | |||||
msgid "Sleep for brief intervals while waiting for the graphics hardware" | |||||
msgstr "Sov i korta intervall under väntan på grafikhårdvaran" | |||||
#: t_options.h:164 | |||||
msgid "Let the graphics hardware emit a software interrupt and sleep" | |||||
msgstr "Låt grafikhårdvaran sända ut ett programvaruavbrott och sov" | |||||
#: t_options.h:174 | |||||
msgid "Synchronization with vertical refresh (swap intervals)" | |||||
msgstr "Synkronisering med vertikal uppdatering (växlingsintervall)" | |||||
#: t_options.h:175 | |||||
msgid "Never synchronize with vertical refresh, ignore application's choice" | |||||
msgstr "Synkronisera aldrig med vertikal uppdatering, ignorera programmets val" | |||||
#: t_options.h:176 | |||||
msgid "Initial swap interval 0, obey application's choice" | |||||
msgstr "Initialt växlingsintervall 0, följ programmets val" | |||||
#: t_options.h:177 | |||||
msgid "Initial swap interval 1, obey application's choice" | |||||
msgstr "Initialt växlingsintervall 1, följ programmets val" | |||||
#: t_options.h:178 | |||||
msgid "Always synchronize with vertical refresh, application chooses the minimum swap interval" | |||||
msgstr "Synkronisera alltid med vertikal uppdatering, programmet väljer den minsta växlingsintervallen" | |||||
#: t_options.h:186 | |||||
msgid "Use HyperZ to boost performance" | |||||
msgstr "Använd HyperZ för att maximera prestandan" | |||||
#: t_options.h:191 | |||||
msgid "Number of texture units used" | |||||
msgstr "Antal använda texturenheter" | |||||
#: t_options.h:196 | |||||
msgid "Support larger textures not guaranteed to fit into graphics memory" | |||||
msgstr "Stöd för större texturer är inte garanterat att passa i grafikminnet" | |||||
#: t_options.h:197 | |||||
msgid "No" | |||||
msgstr "Nej" | |||||
#: t_options.h:198 | |||||
msgid "At least 1 texture must fit under worst-case assumptions" | |||||
msgstr "Åtminstone en textur måste passa för antaget sämsta förhållande" | |||||
#: t_options.h:199 | |||||
msgid "Announce hardware limits" | |||||
msgstr "Annonsera hårdvarubegränsningar" | |||||
#: t_options.h:205 | |||||
msgid "Texture filtering quality vs. speed, AKA “brilinear” texture filtering" | |||||
msgstr "Texturfiltreringskvalitet mot hastighet, även kallad \"brilinear\"-texturfiltrering" | |||||
#: t_options.h:213 | |||||
msgid "Used types of texture memory" | |||||
msgstr "Använda typer av texturminne" | |||||
#: t_options.h:214 | |||||
msgid "All available memory" | |||||
msgstr "Allt tillgängligt minne" | |||||
#: t_options.h:215 | |||||
msgid "Only card memory (if available)" | |||||
msgstr "Endast kortminne (om tillgängligt)" | |||||
#: t_options.h:216 | |||||
msgid "Only GART (AGP/PCIE) memory (if available)" | |||||
msgstr "Endast GART-minne (AGP/PCIE) (om tillgängligt)" | |||||
#: t_options.h:224 | |||||
msgid "Features that are not hardware-accelerated" | |||||
msgstr "Funktioner som inte är hårdvaruaccelererade" | |||||
#: t_options.h:228 | |||||
msgid "Enable extension GL_ARB_vertex_program" | |||||
msgstr "Aktivera tillägget GL_ARB_vertex_program" | |||||
#: t_options.h:233 | |||||
msgid "Enable extension GL_NV_vertex_program" | |||||
msgstr "Aktivera tillägget GL_NV_vertex_program" | |||||
#define SET_STATE( i830, STATE ) \ | #define SET_STATE( i830, STATE ) \ | ||||
do { \ | do { \ | ||||
assert(!i830->intel.prim.flush); \ | |||||
i830->current->emitted = 0; \ | i830->current->emitted = 0; \ | ||||
i830->current = &i830->STATE; \ | i830->current = &i830->STATE; \ | ||||
i830->current->emitted = 0; \ | i830->current->emitted = 0; \ | ||||
} /* cliprect loop */ | } /* cliprect loop */ | ||||
assert(!intel->prim.flush); | |||||
intelFlushBatchLocked( intel, GL_FALSE, GL_FALSE, GL_FALSE ); | intelFlushBatchLocked( intel, GL_FALSE, GL_FALSE, GL_FALSE ); | ||||
done: | done: |
I830_STATECHANGE(i830, I830_UPLOAD_CTX); | I830_STATECHANGE(i830, I830_UPLOAD_CTX); | ||||
if (ctx->Color._LogicOpEnabled) { | |||||
if (RGBA_LOGICOP_ENABLED(ctx)) { | |||||
i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND | | i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND | | ||||
ENABLE_LOGIC_OP_MASK); | ENABLE_LOGIC_OP_MASK); | ||||
i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND | | i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND | |
#include "program_instruction.h" | #include "program_instruction.h" | ||||
#include "program.h" | #include "program.h" | ||||
#include "programopt.h" | |||||
p, p->ctx->FragmentProgram.Parameters[source->Index]); | p, p->ctx->FragmentProgram.Parameters[source->Index]); | ||||
break; | break; | ||||
case PROGRAM_CONSTANT: | |||||
case PROGRAM_STATE_VAR: | case PROGRAM_STATE_VAR: | ||||
case PROGRAM_NAMED_PARAM: | case PROGRAM_NAMED_PARAM: | ||||
src = i915_emit_param4fv( | src = i915_emit_param4fv( | ||||
*/ | */ | ||||
ctx->Driver.Enable( ctx, GL_FRAGMENT_PROGRAM_ARB, | ctx->Driver.Enable( ctx, GL_FRAGMENT_PROGRAM_ARB, | ||||
ctx->FragmentProgram.Enabled ); | ctx->FragmentProgram.Enabled ); | ||||
if (p->FragProg.FogOption) { | |||||
/* add extra instructions to do fog, then turn off FogOption field */ | |||||
_mesa_append_fog_code(ctx, &p->FragProg); | |||||
p->FragProg.FogOption = GL_NONE; | |||||
} | |||||
} | } | ||||
_tnl_program_string(ctx, target, prog); | _tnl_program_string(ctx, target, prog); | ||||
EMIT_PAD( 1 ); | EMIT_PAD( 1 ); | ||||
} | } | ||||
#if 0 | |||||
/* XXX this was disabled, but enabling this code helped fix the Glean | |||||
* tfragprog1 fog tests. | |||||
*/ | |||||
#if 1 | |||||
if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) { | if ((inputsRead & FRAG_BIT_FOGC) || i915->vertex_fog != I915_FOG_NONE) { | ||||
EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4 ); | EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4 ); | ||||
} | } |
void i915_program_error( struct i915_fragment_program *p, const char *msg ) | void i915_program_error( struct i915_fragment_program *p, const char *msg ) | ||||
{ | { | ||||
/* XXX we shouldn't print anything to stdout, record GL error or | |||||
* call _mesa_problem() | |||||
*/ | |||||
fprintf(stderr, "%s\n", msg); | |||||
_mesa_problem(NULL, "i915_program_error: %s", msg); | |||||
p->error = 1; | p->error = 1; | ||||
} | } | ||||
I915_STATECHANGE(i915, I915_UPLOAD_CTX); | I915_STATECHANGE(i915, I915_UPLOAD_CTX); | ||||
if (ctx->Color._LogicOpEnabled) { | |||||
if (RGBA_LOGICOP_ENABLED(ctx)) { | |||||
i915->state.Ctx[I915_CTXREG_LIS5] |= S5_LOGICOP_ENABLE; | i915->state.Ctx[I915_CTXREG_LIS5] |= S5_LOGICOP_ENABLE; | ||||
i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE; | i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_CBUF_BLEND_ENABLE; | ||||
} else { | } else { |
functions->Clear = intelClear; | functions->Clear = intelClear; | ||||
functions->Flush = intelglFlush; | functions->Flush = intelglFlush; | ||||
functions->Finish = intelFinish; | functions->Finish = intelFinish; | ||||
functions->GetBufferSize = NULL; /* OBSOLETE */ | |||||
functions->GetString = intelGetString; | functions->GetString = intelGetString; | ||||
functions->UpdateState = intelInvalidateState; | functions->UpdateState = intelInvalidateState; | ||||
intel_batchbuffer.c \ | intel_batchbuffer.c \ | ||||
intel_mipmap_tree.c \ | intel_mipmap_tree.c \ | ||||
i915_tex_layout.c \ | i915_tex_layout.c \ | ||||
intel_tex_layout.c \ | |||||
intel_tex_image.c \ | intel_tex_image.c \ | ||||
intel_tex_subimage.c \ | intel_tex_subimage.c \ | ||||
intel_tex_copy.c \ | intel_tex_copy.c \ | ||||
ASM_SOURCES = | ASM_SOURCES = | ||||
DRIVER_DEFINES = -I../intel | |||||
include ../Makefile.template | include ../Makefile.template | ||||
intel_tex_layout.o: ../intel/intel_tex_layout.c | |||||
symlinks: | symlinks: |
*/ | */ | ||||
extern void i830InitVtbl(struct i830_context *i830); | extern void i830InitVtbl(struct i830_context *i830); | ||||
extern void | |||||
i830_state_draw_region(struct intel_context *intel, | |||||
struct i830_hw_state *state, | |||||
struct intel_region *color_region, | |||||
struct intel_region *depth_region); | |||||
/* i830_context.c | /* i830_context.c | ||||
*/ | */ | ||||
extern GLboolean | extern GLboolean |
*/ | */ | ||||
static void | static void | ||||
meta_draw_region(struct intel_context *intel, | meta_draw_region(struct intel_context *intel, | ||||
struct intel_region *draw_region, | |||||
struct intel_region *color_region, | |||||
struct intel_region *depth_region) | struct intel_region *depth_region) | ||||
{ | { | ||||
struct i830_context *i830 = i830_context(&intel->ctx); | struct i830_context *i830 = i830_context(&intel->ctx); | ||||
GLuint format; | |||||
GLuint depth_format = DEPTH_FRMT_16_FIXED; | |||||
intel_region_release(&i830->meta.draw_region); | |||||
intel_region_reference(&i830->meta.draw_region, draw_region); | |||||
intel_region_release(&i830->meta.depth_region); | |||||
intel_region_reference(&i830->meta.depth_region, depth_region); | |||||
/* XXX FBO: grab code from i915 meta_draw_region */ | |||||
/* XXX: 555 support? | |||||
*/ | |||||
if (draw_region->cpp == 2) | |||||
format = DV_PF_565; | |||||
else | |||||
format = DV_PF_8888; | |||||
if (depth_region) { | |||||
if (depth_region->cpp == 2) | |||||
depth_format = DEPTH_FRMT_16_FIXED; | |||||
else | |||||
depth_format = DEPTH_FRMT_24_FIXED_8_OTHER; | |||||
} | |||||
i830->meta.Buffer[I830_DESTREG_DV1] = (DSTORG_HORT_BIAS(0x8) | /* .5 */ | |||||
DSTORG_VERT_BIAS(0x8) | /* .5 */ | |||||
format | DEPTH_IS_Z | depth_format); | |||||
i830->meta.emitted &= ~I830_UPLOAD_BUFFERS; | |||||
i830_state_draw_region(intel, &i830->meta, color_region, depth_region); | |||||
} | } | ||||