diff options
Diffstat (limited to 'progs')
224 files changed, 0 insertions, 37112 deletions
diff --git a/progs/demos/.cvsignore b/progs/demos/.cvsignore deleted file mode 100644 index f764b3d117e..00000000000 --- a/progs/demos/.cvsignore +++ /dev/null @@ -1,48 +0,0 @@ -.cvsignore -arbfplight -arbocclude -bounce -clearspd -cubemap -drawpix -fire -fplight -gamma -gears -geartrain -glinfo -gloss -gltestperf -glutfx -ipers -isosurf -lodbias -morph3d -multiarb -occlude -osdemo -paltex -pixeltex -pointblast -ray -readpix -readtex.c -readtex.h -reflect -renormal -shadowtex -showbuffer.c -showbuffer.h -spectex -stex3d -teapot -terrain -tessdemo -texcyl -texdown -texenv -texobj -trispd -tunnel -tunnel2 -winpos diff --git a/progs/demos/Windows/all.dsp b/progs/demos/Windows/all.dsp deleted file mode 100644 index b47283c5882..00000000000 --- a/progs/demos/Windows/all.dsp +++ /dev/null @@ -1,101 +0,0 @@ -# Microsoft Developer Studio Project File - Name="all" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=all - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "all.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "all.mak" CFG="all - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "all - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "all - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "all - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-
-!ELSEIF "$(CFG)" == "all - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "all - Win32 Release"
-# Name "all - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/bounce.dsp b/progs/demos/Windows/bounce.dsp deleted file mode 100644 index 0510e77d994..00000000000 --- a/progs/demos/Windows/bounce.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="bounce" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=bounce - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "bounce.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "bounce.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "bounce - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "bounce - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "bounce - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../bounce.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "bounce - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../bounce.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "bounce - Win32 Release"
-# Name "bounce - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\bounce.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/clearspd.dsp b/progs/demos/Windows/clearspd.dsp deleted file mode 100644 index 440c7ae64e9..00000000000 --- a/progs/demos/Windows/clearspd.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="clearspd" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=clearspd - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "clearspd.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "clearspd.mak" CFG="clearspd - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "clearspd - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "clearspd - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "clearspd - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../clearspd.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "clearspd - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../clearspd.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "clearspd - Win32 Release"
-# Name "clearspd - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\clearspd.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/cubemap.dsp b/progs/demos/Windows/cubemap.dsp deleted file mode 100644 index 220a3a0df61..00000000000 --- a/progs/demos/Windows/cubemap.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="cubemap" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=cubemap - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "cubemap.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "cubemap.mak" CFG="cubemap - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "cubemap - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "cubemap - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "cubemap - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../cubemap.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "cubemap - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../cubemap.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "cubemap - Win32 Release"
-# Name "cubemap - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\cubemap.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/demos.dsw b/progs/demos/Windows/demos.dsw deleted file mode 100644 index 2d6f629e07a..00000000000 --- a/progs/demos/Windows/demos.dsw +++ /dev/null @@ -1,782 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "all"=".\all.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name bounce
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name clearspd
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name cubemap
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name drawpix
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name fire
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name gears
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name geartrain
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name glinfo
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name gloss
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name gltestperf
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name glutfx
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name ipers
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name isosurf
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name lodbias
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name morph3d
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name multiarb
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name occlude
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name osdemo
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name paltex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name pixeltex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name pointblast
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name rain
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name ray
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name readpix
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name reflect
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name renormal
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name shadowtex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name spectex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name stex3d
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name teapot
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name terrain
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name tessdemo
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texcyl
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texdown
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texenv
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texobj
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name trispd
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name tunnel
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name tunnel2
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name winpos
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name spriteblast
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "bounce"=".\bounce.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "clearspd"=".\clearspd.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "cubemap"=".\cubemap.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "drawpix"=".\drawpix.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "fire"=".\fire.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "gears"=".\gears.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "geartrain"=".\geartrain.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "glinfo"=".\glinfo.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "gloss"=".\gloss.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "gltestperf"=".\gltestperf.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "glut"="..\..\..\src\glut\glx\glut.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "glutfx"=".\glutfx.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "ipers"=".\ipers.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "isosurf"=".\isosurf.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "lodbias"=".\loadbias.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "morph3d"=".\morph3d.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "multiarb"=".\multiarb.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "occlude"=".\occlude.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "osdemo"=".\osdemo.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "paltex"=".\paltex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "pixeltex"=".\pixeltex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "pointblast"=".\pointblast.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "rain"=".\rain.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "ray"=".\ray.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "readpix"=".\readpix.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "reflect"=".\reflect.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "renormal"=".\renormal.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "shadowtex"=".\shadowtex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "spectex"=".\spectex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "spriteblast"=".\spriteblast.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "stex3d"=".\stex3d.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "teapot"=".\teapot.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terrain"=".\terrain.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tessdemo"=".\tessdemo.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texcyl"=".\texcyl.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texdown"=".\texdown.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texenv"=".\texenv.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texobj"=".\texobj.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "trispd"=".\trispd.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tunnel"=".\tunnel.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tunnel2"=".\tunnel2.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "winpos"=".\winpos.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/progs/demos/Windows/drawpix.dsp b/progs/demos/Windows/drawpix.dsp deleted file mode 100644 index 57003e616b4..00000000000 --- a/progs/demos/Windows/drawpix.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="drawpix" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=drawpix - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "drawpix.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "drawpix.mak" CFG="drawpix - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "drawpix - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "drawpix - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "drawpix - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../../../include" /I "../../util" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../drawpix.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "drawpix - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../drawpix.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "drawpix - Win32 Release"
-# Name "drawpix - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\drawpix.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/fire.dsp b/progs/demos/Windows/fire.dsp deleted file mode 100644 index f8a536d3349..00000000000 --- a/progs/demos/Windows/fire.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="fire" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=fire - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "fire.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "fire.mak" CFG="fire - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "fire - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "fire - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "fire - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../fire.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "fire - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../fire.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "fire - Win32 Release"
-# Name "fire - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\fire.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/gears.dsp b/progs/demos/Windows/gears.dsp deleted file mode 100644 index 43a588dc68d..00000000000 --- a/progs/demos/Windows/gears.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gears" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=gears - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gears.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gears.mak" CFG="gears - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gears - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "gears - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gears - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gears.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "gears - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gears.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "gears - Win32 Release"
-# Name "gears - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\gears.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/geartrain.dsp b/progs/demos/Windows/geartrain.dsp deleted file mode 100644 index 8dee77de4d5..00000000000 --- a/progs/demos/Windows/geartrain.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="geartrain" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=geartrain - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "geartrain.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "geartrain.mak" CFG="geartrain - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "geartrain - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "geartrain - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "geartrain - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../geartrain.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "geartrain - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../geartrain.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "geartrain - Win32 Release"
-# Name "geartrain - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\geartrain.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/glinfo.dsp b/progs/demos/Windows/glinfo.dsp deleted file mode 100644 index d9d61eb424d..00000000000 --- a/progs/demos/Windows/glinfo.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="glinfo" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=glinfo - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "glinfo.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "glinfo.mak" CFG="glinfo - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glinfo - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "glinfo - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "glinfo - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../glinfo.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glinfo - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../glinfo.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glinfo - Win32 Release"
-# Name "glinfo - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\glinfo.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/gloss.dsp b/progs/demos/Windows/gloss.dsp deleted file mode 100644 index 402d291f4dc..00000000000 --- a/progs/demos/Windows/gloss.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gloss" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=gloss - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gloss.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gloss.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gloss - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "gloss - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gloss - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gloss.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "gloss - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gloss.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "gloss - Win32 Release"
-# Name "gloss - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\gloss.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/gltestperf.dsp b/progs/demos/Windows/gltestperf.dsp deleted file mode 100644 index e5066201522..00000000000 --- a/progs/demos/Windows/gltestperf.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gltestperf" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=gltestperf - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gltestperf.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gltestperf.mak" CFG="gltestperf - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gltestperf - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "gltestperf - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gltestperf - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gltestperf.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "gltestperf - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gltestperf.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "gltestperf - Win32 Release"
-# Name "gltestperf - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\gltestperf.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/glutfx.dsp b/progs/demos/Windows/glutfx.dsp deleted file mode 100644 index 90eca930d22..00000000000 --- a/progs/demos/Windows/glutfx.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="glutfx" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=glutfx - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "glutfx.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "glutfx.mak" CFG="glutfx - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glutfx - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "glutfx - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "glutfx - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../glutfx.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glutfx - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../glutfx.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glutfx - Win32 Release"
-# Name "glutfx - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\glutfx.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/ipers.dsp b/progs/demos/Windows/ipers.dsp deleted file mode 100644 index 430f1b6258d..00000000000 --- a/progs/demos/Windows/ipers.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ipers" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=ipers - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "ipers.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "ipers.mak" CFG="ipers - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ipers - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "ipers - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ipers - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../ipers.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "ipers - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../ipers.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "ipers - Win32 Release"
-# Name "ipers - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\ipers.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/isosurf.dsp b/progs/demos/Windows/isosurf.dsp deleted file mode 100644 index 1c59d40081e..00000000000 --- a/progs/demos/Windows/isosurf.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="isosurf" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=isosurf - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "isosurf.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "isosurf.mak" CFG="isosurf - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "isosurf - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "isosurf - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "isosurf - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../isosurf.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "isosurf - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../isosurf.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "isosurf - Win32 Release"
-# Name "isosurf - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\isosurf.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/loadbias.dsp b/progs/demos/Windows/loadbias.dsp deleted file mode 100644 index ed51960e493..00000000000 --- a/progs/demos/Windows/loadbias.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="lodbias" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=lodbias - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "lodbias.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "lodbias.mak" CFG="lodbias - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "lodbias - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "lodbias - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "lodbias - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../lodbias.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "lodbias - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../lodbias.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "lodbias - Win32 Release"
-# Name "lodbias - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\lodbias.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/morph3d.dsp b/progs/demos/Windows/morph3d.dsp deleted file mode 100644 index 247dbf03d7a..00000000000 --- a/progs/demos/Windows/morph3d.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="morph3d" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=morph3d - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "morph3d.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "morph3d.mak" CFG="morph3d - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "morph3d - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "morph3d - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "morph3d - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../morph3d.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "morph3d - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../morph3d.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "morph3d - Win32 Release"
-# Name "morph3d - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\morph3d.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/multiarb.dsp b/progs/demos/Windows/multiarb.dsp deleted file mode 100644 index 57c32deb294..00000000000 --- a/progs/demos/Windows/multiarb.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="multiarb" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=multiarb - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "multiarb.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "multiarb.mak" CFG="multiarb - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "multiarb - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "multiarb - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "multiarb - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../multiarb.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "multiarb - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../multiarb.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "multiarb - Win32 Release"
-# Name "multiarb - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\multiarb.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/occlude.dsp b/progs/demos/Windows/occlude.dsp deleted file mode 100644 index ca4afa579e1..00000000000 --- a/progs/demos/Windows/occlude.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="occlude" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=occlude - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "occlude.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "occlude.mak" CFG="occlude - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "occlude - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "occlude - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "occlude - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../occlude.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "occlude - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../occlude.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "occlude - Win32 Release"
-# Name "occlude - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\occlude.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/osdemo.dsp b/progs/demos/Windows/osdemo.dsp deleted file mode 100644 index ccaa6d2b42a..00000000000 --- a/progs/demos/Windows/osdemo.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="osdemo" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=osdemo - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "osdemo.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "osdemo.mak" CFG="osdemo - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "osdemo - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "osdemo - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "osdemo - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB ../../../lib/OSMESA32.LIB /nologo /subsystem:console /machine:I386 /out:"../osdemo.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "osdemo - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB ../../../lib/OSMESA32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../osdemo.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "osdemo - Win32 Release"
-# Name "osdemo - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\osdemo.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/paltex.dsp b/progs/demos/Windows/paltex.dsp deleted file mode 100644 index efc63842115..00000000000 --- a/progs/demos/Windows/paltex.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="paltex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=paltex - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "paltex.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "paltex.mak" CFG="paltex - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "paltex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "paltex - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "paltex - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../paltex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "paltex - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../paltex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "paltex - Win32 Release"
-# Name "paltex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\paltex.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/pixeltex.dsp b/progs/demos/Windows/pixeltex.dsp deleted file mode 100644 index d09f9f312cb..00000000000 --- a/progs/demos/Windows/pixeltex.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pixeltex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=pixeltex - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "pixeltex.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "pixeltex.mak" CFG="pixeltex - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pixeltex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "pixeltex - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "pixeltex - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../pixeltex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "pixeltex - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../pixeltex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "pixeltex - Win32 Release"
-# Name "pixeltex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\pixeltex.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/pointblast.dsp b/progs/demos/Windows/pointblast.dsp deleted file mode 100644 index 7be695839fa..00000000000 --- a/progs/demos/Windows/pointblast.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pointblast" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=pointblast - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "pointblast.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "pointblast.mak" CFG="pointblast - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pointblast - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "pointblast - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "pointblast - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../pointblast.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "pointblast - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../pointblast.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "pointblast - Win32 Release"
-# Name "pointblast - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\pointblast.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/rain.dsp b/progs/demos/Windows/rain.dsp deleted file mode 100644 index 7e380e66aaf..00000000000 --- a/progs/demos/Windows/rain.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="rain" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=rain - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "rain.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "rain.mak" CFG="rain - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "rain - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "rain - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "rain - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../rain.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "rain - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../rain.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "rain - Win32 Release"
-# Name "rain - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\rain.cxx
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/ray.dsp b/progs/demos/Windows/ray.dsp deleted file mode 100644 index dfa26e7755c..00000000000 --- a/progs/demos/Windows/ray.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ray" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=ray - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "ray.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "ray.mak" CFG="ray - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ray - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "ray - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ray - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../ray.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "ray - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../ray.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "ray - Win32 Release"
-# Name "ray - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\ray.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/readpix.dsp b/progs/demos/Windows/readpix.dsp deleted file mode 100644 index 8097d10625b..00000000000 --- a/progs/demos/Windows/readpix.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="readpix" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=readpix - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "readpix.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "readpix.mak" CFG="readpix - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "readpix - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "readpix - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "readpix - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../readpix.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "readpix - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../readpix.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "readpix - Win32 Release"
-# Name "readpix - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\readpix.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/reflect.dsp b/progs/demos/Windows/reflect.dsp deleted file mode 100644 index fa09700afe2..00000000000 --- a/progs/demos/Windows/reflect.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="reflect" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=reflect - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "reflect.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "reflect.mak" CFG="reflect - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "reflect - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "reflect - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "reflect - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../reflect.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "reflect - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../reflect.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "reflect - Win32 Release"
-# Name "reflect - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\reflect.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/renormal.dsp b/progs/demos/Windows/renormal.dsp deleted file mode 100644 index 4d72e88d8ed..00000000000 --- a/progs/demos/Windows/renormal.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="renormal" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=renormal - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "renormal.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "renormal.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "renormal - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "renormal - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "renormal - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../renormal.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "renormal - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../renormal.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "renormal - Win32 Release"
-# Name "renormal - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\renormal.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/shadowtex.dsp b/progs/demos/Windows/shadowtex.dsp deleted file mode 100644 index 419ec241386..00000000000 --- a/progs/demos/Windows/shadowtex.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="shadowtex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=shadowtex - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "shadowtex.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "shadowtex.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "shadowtex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "shadowtex - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "shadowtex - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../shadowtex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "shadowtex - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../shadowtex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "shadowtex - Win32 Release"
-# Name "shadowtex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\shadowtex.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/spectex.dsp b/progs/demos/Windows/spectex.dsp deleted file mode 100644 index d1960b3d139..00000000000 --- a/progs/demos/Windows/spectex.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="spectex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=spectex - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "spectex.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "spectex.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "spectex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "spectex - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "spectex - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../spectex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "spectex - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../spectex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "spectex - Win32 Release"
-# Name "spectex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\spectex.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/spriteblast.dsp b/progs/demos/Windows/spriteblast.dsp deleted file mode 100644 index 8a02ed50d30..00000000000 --- a/progs/demos/Windows/spriteblast.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="spriteblast" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=spriteblast - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "spriteblast.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "spriteblast.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "spriteblast - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "spriteblast - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "spriteblast - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../spriteblast.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "spriteblast - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../spriteblast.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "spriteblast - Win32 Release"
-# Name "spriteblast - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\spriteblast.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/stex3d.dsp b/progs/demos/Windows/stex3d.dsp deleted file mode 100644 index 7c112d62ca8..00000000000 --- a/progs/demos/Windows/stex3d.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="stex3d" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=stex3d - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "stex3d.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "stex3d.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "stex3d - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "stex3d - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "stex3d - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../stex3d.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "stex3d - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../stex3d.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "stex3d - Win32 Release"
-# Name "stex3d - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\stex3d.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/teapot.dsp b/progs/demos/Windows/teapot.dsp deleted file mode 100644 index 3260e635a4b..00000000000 --- a/progs/demos/Windows/teapot.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="teapot" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=teapot - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "teapot.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "teapot.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "teapot - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "teapot - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "teapot - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../teapot.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "teapot - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../teapot.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "teapot - Win32 Release"
-# Name "teapot - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\teapot.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/terrain.dsp b/progs/demos/Windows/terrain.dsp deleted file mode 100644 index 9fe490db81e..00000000000 --- a/progs/demos/Windows/terrain.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="terrain" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=terrain - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "terrain.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "terrain.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "terrain - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "terrain - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "terrain - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../terrain.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "terrain - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../terrain.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "terrain - Win32 Release"
-# Name "terrain - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\terrain.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/tessdemo.dsp b/progs/demos/Windows/tessdemo.dsp deleted file mode 100644 index 61345c79e6a..00000000000 --- a/progs/demos/Windows/tessdemo.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tessdemo" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=tessdemo - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tessdemo.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tessdemo.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tessdemo - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "tessdemo - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tessdemo - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tessdemo.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "tessdemo - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tessdemo.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "tessdemo - Win32 Release"
-# Name "tessdemo - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\tessdemo.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/texcyl.dsp b/progs/demos/Windows/texcyl.dsp deleted file mode 100644 index b227e02c297..00000000000 --- a/progs/demos/Windows/texcyl.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="texcyl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texcyl - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "texcyl.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "texcyl.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texcyl - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texcyl - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "texcyl - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texcyl.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texcyl - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texcyl.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texcyl - Win32 Release"
-# Name "texcyl - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texcyl.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/texdown.dsp b/progs/demos/Windows/texdown.dsp deleted file mode 100644 index acea7666afc..00000000000 --- a/progs/demos/Windows/texdown.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="texdown" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texdown - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "texdown.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "texdown.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texdown - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texdown - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "texdown - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texdown.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texdown - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texdown.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texdown - Win32 Release"
-# Name "texdown - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texdown.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/texenv.dsp b/progs/demos/Windows/texenv.dsp deleted file mode 100644 index 3eb7eecdb71..00000000000 --- a/progs/demos/Windows/texenv.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="texenv" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texenv - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "texenv.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "texenv.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texenv - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texenv - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "texenv - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texenv.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texenv - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texenv.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texenv - Win32 Release"
-# Name "texenv - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texenv.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/texobj.dsp b/progs/demos/Windows/texobj.dsp deleted file mode 100644 index 5db5f2ee798..00000000000 --- a/progs/demos/Windows/texobj.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="texobj" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texobj - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "texobj.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "texobj.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texobj - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texobj - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "texobj - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texobj.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texobj - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texobj.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texobj - Win32 Release"
-# Name "texobj - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texobj.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/trispd.dsp b/progs/demos/Windows/trispd.dsp deleted file mode 100644 index 7e27cf3d04b..00000000000 --- a/progs/demos/Windows/trispd.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="trispd" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=trispd - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "trispd.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "trispd.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "trispd - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "trispd - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "trispd - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../trispd.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "trispd - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../trispd.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "trispd - Win32 Release"
-# Name "trispd - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\trispd.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/tunnel.dsp b/progs/demos/Windows/tunnel.dsp deleted file mode 100644 index 965f109c33e..00000000000 --- a/progs/demos/Windows/tunnel.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tunnel" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=tunnel - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tunnel.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tunnel.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tunnel - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "tunnel - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tunnel - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tunnel.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "tunnel - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tunnel.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "tunnel - Win32 Release"
-# Name "tunnel - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\tunnel.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/tunnel2.dsp b/progs/demos/Windows/tunnel2.dsp deleted file mode 100644 index 3ae2800a04d..00000000000 --- a/progs/demos/Windows/tunnel2.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tunnel2" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=tunnel2 - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tunnel2.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tunnel2.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tunnel2 - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "tunnel2 - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tunnel2 - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tunnel2.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "tunnel2 - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tunnel2.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "tunnel2 - Win32 Release"
-# Name "tunnel2 - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\tunnel2.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/Windows/winpos.dsp b/progs/demos/Windows/winpos.dsp deleted file mode 100644 index b7b569e6402..00000000000 --- a/progs/demos/Windows/winpos.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="winpos" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=winpos - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "winpos.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "winpos.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "winpos - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "winpos - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "winpos - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../winpos.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "winpos - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../winpos.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "winpos - Win32 Release"
-# Name "winpos - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\winpos.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/demos/occlude.c b/progs/demos/occlude.c deleted file mode 100644 index 8f7b90984e0..00000000000 --- a/progs/demos/occlude.c +++ /dev/null @@ -1,234 +0,0 @@ -/* - * GL_HP_occlustion_test demo - * - * Brian Paul - * 31 March 2000 - * - * Copyright (C) 2000 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. - */ - - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> -#include <GL/glut.h> -#include <GL/glext.h> - - -static GLfloat Xpos = 0; -static GLboolean Anim = GL_TRUE; - - -static void -PrintString(const char *s) -{ - while (*s) { - glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); - s++; - } -} - - - -static void Idle(void) -{ - static int lastTime = 0; - static int sign = +1; - int time = glutGet(GLUT_ELAPSED_TIME); - float step; - - if (lastTime == 0) - lastTime = time; - else if (time - lastTime < 20) /* 50Hz update */ - return; - - step = (time - lastTime) / 1000.0 * sign; - lastTime = time; - - Xpos += step; - - if (Xpos > 2.5) { - Xpos = 2.5; - sign = -1; - } - else if (Xpos < -2.5) { - Xpos = -2.5; - sign = +1; - } - glutPostRedisplay(); -} - - -static void Display( void ) -{ - GLboolean result; - - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); - - /* draw the occluding polygons */ - glColor3f(0, 0.6, 0.8); - glBegin(GL_QUADS); - glVertex2f(-1.6, -1.5); - glVertex2f(-0.4, -1.5); - glVertex2f(-0.4, 1.5); - glVertex2f(-1.6, 1.5); - - glVertex2f( 0.4, -1.5); - glVertex2f( 1.6, -1.5); - glVertex2f( 1.6, 1.5); - glVertex2f( 0.4, 1.5); - glEnd(); - - /* draw the test polygon with occlusion testing */ - glPushMatrix(); - glTranslatef(Xpos, 0, -0.5); - glScalef(0.3, 0.3, 1.0); - glRotatef(-90.0 * Xpos, 0, 0, 1); - - glEnable(GL_OCCLUSION_TEST_HP); /* NOTE: enabling the occlusion test */ - /* doesn't clear the result flag! */ - glColorMask(0, 0, 0, 0); - glDepthMask(GL_FALSE); - /* this call clear's the result flag. Not really needed for this demo. */ - glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP, &result); - - glBegin(GL_POLYGON); - glVertex3f(-1, -1, 0); - glVertex3f( 1, -1, 0); - glVertex3f( 1, 1, 0); - glVertex3f(-1, 1, 0); - glEnd(); - - glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP, &result); - /* turn off occlusion testing */ - glDisable(GL_OCCLUSION_TEST_HP); - glColorMask(1, 1, 1, 1); - glDepthMask(GL_TRUE); - - /* draw the green rect, so we can see what's going on */ - glColor3f(0.8, 0.5, 0); - glBegin(GL_POLYGON); - glVertex3f(-1, -1, 0); - glVertex3f( 1, -1, 0); - glVertex3f( 1, 1, 0); - glVertex3f(-1, 1, 0); - glEnd(); - - glPopMatrix(); - - - /* Print result message */ - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho( -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - - glColor3f(1, 1, 1); - glRasterPos3f(-0.25, -0.7, 0); - - if (result) - PrintString(" Visible"); - else - PrintString("Fully Occluded"); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc( Idle ); - else - glutIdleFunc( NULL ); - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - const GLfloat step = 0.1; - (void) x; - (void) y; - switch (key) { - case GLUT_KEY_LEFT: - Xpos -= step; - break; - case GLUT_KEY_RIGHT: - Xpos += step; - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - const char *ext = (const char *) glGetString(GL_EXTENSIONS); - if (!strstr(ext, "GL_HP_occlusion_test")) { - printf("Sorry, this demo requires the GL_HP_occlusion_test extension\n"); - exit(-1); - } - - glEnable(GL_DEPTH_TEST); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 400, 400 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutIdleFunc( Idle ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/egl/Makefile b/progs/egl/Makefile deleted file mode 100644 index 41cadf97d2c..00000000000 --- a/progs/egl/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -# progs/egl/Makefile - -TOP = ../.. -include $(TOP)/configs/current - - -INCLUDE_DIRS = -I$(TOP)/include - -HEADERS = $(TOP)/include/GLES/egl.h - -PROGRAMS = \ - demo1 \ - demo2 \ - demo3 \ - eglinfo \ - eglgears - - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@ - - - -default: $(PROGRAMS) - - -demo1: demo1.o $(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) demo1.o -L$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@ - -demo1.o: demo1.c $(HEADERS) - $(CC) -c $(CFLAGS) -I$(TOP)/include demo1.c - - -demo2: demo2.o $(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) demo2.o -L$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ - -demo2.o: demo2.c $(HEADERS) - $(CC) -c $(CFLAGS) -I$(TOP)/include demo2.c - - -demo3: demo3.o $(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) demo3.o -L$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ - -demo3.o: demo3.c $(HEADERS) - $(CC) -c $(CFLAGS) -I$(TOP)/include demo3.c - - -eglinfo: eglinfo.o $(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) eglinfo.o -L$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@ - -eglinfo.o: eglinfo.c $(HEADERS) - $(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c - - -eglgears: eglgears.o $(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) eglgears.o -L$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ - -eglgears.o: eglgears.c $(HEADERS) - $(CC) -c $(CFLAGS) -I$(TOP)/include eglgears.c - - -clean: - rm -f *.o *~ - rm -f *.so - rm -f $(PROGRAMS) diff --git a/progs/egl/demo1.c b/progs/egl/demo1.c deleted file mode 100644 index 9ef17e38b7d..00000000000 --- a/progs/egl/demo1.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Exercise EGL API functions - */ - -#include <GLES/egl.h> -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - - -/** - * Test EGL_MESA_screen_surface functions - */ -static void -TestScreens(EGLDisplay dpy) -{ -#define MAX 8 - EGLScreenMESA screens[MAX]; - EGLint numScreens; - EGLint i; - - eglGetScreensMESA(dpy, screens, MAX, &numScreens); - printf("Found %d screens\n", numScreens); - for (i = 0; i < numScreens; i++) { - printf(" Screen %d handle: %d\n", i, (int) screens[i]); - } -} - -/** - * Print table of all available configurations. - */ -static void -PrintConfigs(EGLDisplay d) -{ - EGLConfig *configs; - EGLint numConfigs, i; - - eglGetConfigs(d, NULL, 0, &numConfigs); - configs = malloc(sizeof(*configs) *numConfigs); - eglGetConfigs(d, configs, numConfigs, &numConfigs); - - printf("Configurations:\n"); - printf(" bf lv d st colorbuffer dp st supported \n"); - printf(" id sz l b ro r g b a th cl surfaces \n"); - printf("----------------------------------------------\n"); - for (i = 0; i < numConfigs; i++) { - EGLint id, size, level; - EGLint red, green, blue, alpha; - EGLint depth, stencil; - EGLint surfaces; - EGLint doubleBuf = 1, stereo = 0; - char surfString[100] = ""; - - eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id); - eglGetConfigAttrib(d, configs[i], EGL_BUFFER_SIZE, &size); - eglGetConfigAttrib(d, configs[i], EGL_LEVEL, &level); - - eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red); - eglGetConfigAttrib(d, configs[i], EGL_GREEN_SIZE, &green); - eglGetConfigAttrib(d, configs[i], EGL_BLUE_SIZE, &blue); - eglGetConfigAttrib(d, configs[i], EGL_ALPHA_SIZE, &alpha); - eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth); - eglGetConfigAttrib(d, configs[i], EGL_STENCIL_SIZE, &stencil); - eglGetConfigAttrib(d, configs[i], EGL_SURFACE_TYPE, &surfaces); - - if (surfaces & EGL_WINDOW_BIT) - strcat(surfString, "win,"); - if (surfaces & EGL_PBUFFER_BIT) - strcat(surfString, "pb,"); - if (surfaces & EGL_PIXMAP_BIT) - strcat(surfString, "pix,"); - if (strlen(surfString) > 0) - surfString[strlen(surfString) - 1] = 0; - - printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d %-12s\n", - id, size, level, - doubleBuf ? 'y' : '.', - stereo ? 'y' : '.', - red, green, blue, alpha, - depth, stencil, surfString); - } - free(configs); -} - - - -int -main(int argc, char *argv[]) -{ - int maj, min; - EGLContext ctx; - EGLSurface pbuffer; - EGLConfig configs[10]; - EGLBoolean b; - const EGLint pbufAttribs[] = { - EGL_WIDTH, 500, - EGL_HEIGHT, 500, - EGL_NONE - }; - - /* - EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); - */ - EGLDisplay d = eglGetDisplay("!fb_dri"); - assert(d); - - if (!eglInitialize(d, &maj, &min)) { - printf("demo: eglInitialize failed\n"); - exit(1); - } - - printf("EGL version = %d.%d\n", maj, min); - printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR)); - - PrintConfigs(d); - - ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL); - if (ctx == EGL_NO_CONTEXT) { - printf("failed to create context\n"); - return 0; - } - - pbuffer = eglCreatePbufferSurface(d, configs[0], pbufAttribs); - if (pbuffer == EGL_NO_SURFACE) { - printf("failed to create pbuffer\n"); - return 0; - } - - b = eglMakeCurrent(d, pbuffer, pbuffer, ctx); - if (!b) { - printf("make current failed\n"); - return 0; - } - - b = eglMakeCurrent(d, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - - TestScreens(d); - - eglDestroySurface(d, pbuffer); - eglDestroyContext(d, ctx); - eglTerminate(d); - - return 0; -} diff --git a/progs/egl/demo2.c b/progs/egl/demo2.c deleted file mode 100644 index 17bbca61587..00000000000 --- a/progs/egl/demo2.c +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Exercise EGL API functions - */ - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> - -#include <GLES/egl.h> - -/*#define FRONTBUFFER*/ - -static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) -{ - glBegin( GL_QUADS ); - glVertex2f( x1, y1 ); - glVertex2f( x2, y1 ); - glVertex2f( x2, y2 ); - glVertex2f( x1, y2 ); - glEnd(); -} - - -static void redraw(EGLDisplay dpy, EGLSurface surf, int rot) -{ - printf("Redraw event\n"); - -#ifdef FRONTBUFFER - glDrawBuffer( GL_FRONT ); -#else - glDrawBuffer( GL_BACK ); -#endif - - glClearColor( rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX, - 1); - - glClear( GL_COLOR_BUFFER_BIT ); - - glColor3f( rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX ); - glPushMatrix(); - glRotatef(rot, 0, 0, 1); - glScalef(.5, .5, .5); - _subset_Rectf( -1, -1, 1, 1 ); - glPopMatrix(); - -#ifdef FRONTBUFFER - glFlush(); -#else - eglSwapBuffers( dpy, surf ); -#endif - glFinish(); -} - - -/** - * Test EGL_MESA_screen_surface functions - */ -static void -TestScreens(EGLDisplay dpy) -{ -#define MAX 8 - EGLScreenMESA screens[MAX]; - EGLint numScreens; - EGLint i; - - eglGetScreensMESA(dpy, screens, MAX, &numScreens); - printf("Found %d screens\n", numScreens); - for (i = 0; i < numScreens; i++) { - printf(" Screen %d handle: %d\n", i, (int) screens[i]); - } -} - - -int -main(int argc, char *argv[]) -{ - int maj, min; - EGLContext ctx; - EGLSurface pbuffer, screen_surf; - EGLConfig configs[10]; - EGLint numConfigs, i; - EGLBoolean b; - const EGLint pbufAttribs[] = { - EGL_WIDTH, 500, - EGL_HEIGHT, 500, - EGL_NONE - }; - const EGLint screenAttribs[] = { - EGL_WIDTH, 1024, - EGL_HEIGHT, 768, - EGL_NONE - }; - EGLModeMESA mode; - EGLScreenMESA screen; - EGLint count; - - /* - EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); - */ - EGLDisplay d = eglGetDisplay("!fb_dri"); - assert(d); - - if (!eglInitialize(d, &maj, &min)) { - printf("demo: eglInitialize failed\n"); - exit(1); - } - - printf("EGL version = %d.%d\n", maj, min); - printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR)); - - eglGetConfigs(d, configs, 10, &numConfigs); - printf("Got %d EGL configs:\n", numConfigs); - for (i = 0; i < numConfigs; i++) { - EGLint id, red, depth; - eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id); - eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red); - eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth); - printf("%2d: Red Size = %d Depth Size = %d\n", id, red, depth); - } - - eglGetScreensMESA(d, &screen, 1, &count); - eglGetModesMESA(d, screen, &mode, 1, &count); - - ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL); - if (ctx == EGL_NO_CONTEXT) { - printf("failed to create context\n"); - return 0; - } - - pbuffer = eglCreatePbufferSurface(d, configs[0], pbufAttribs); - if (pbuffer == EGL_NO_SURFACE) { - printf("failed to create pbuffer\n"); - return 0; - } - - b = eglMakeCurrent(d, pbuffer, pbuffer, ctx); - if (!b) { - printf("make current failed\n"); - return 0; - } - - b = eglMakeCurrent(d, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - - screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs); - if (screen_surf == EGL_NO_SURFACE) { - printf("failed to create screen surface\n"); - return 0; - } - - eglShowScreenSurfaceMESA(d, screen, screen_surf, mode); - - b = eglMakeCurrent(d, screen_surf, screen_surf, ctx); - if (!b) { - printf("make current failed\n"); - return 0; - } - - glViewport(0, 0, 1024, 768); - glDrawBuffer( GL_FRONT ); - - glClearColor( 0, - 1.0, - 0, - 1); - - glClear( GL_COLOR_BUFFER_BIT ); - - - TestScreens(d); - - glShadeModel( GL_FLAT ); - - for (i = 0; i < 6; i++) { - redraw(d, screen_surf, i*10 ); - - printf("sleep(1)\n"); - sleep(1); - } - - eglDestroySurface(d, pbuffer); - eglDestroyContext(d, ctx); - eglTerminate(d); - - return 0; -} diff --git a/progs/egl/demo3.c b/progs/egl/demo3.c deleted file mode 100644 index 9edf7c952b3..00000000000 --- a/progs/egl/demo3.c +++ /dev/null @@ -1,636 +0,0 @@ -/* - * Exercise EGL API functions - */ - -#include <GLES/egl.h> -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - - - -#define PIXEL_CENTER(x) ((long)(x) + 0.5) - -#define GAP 10 -#define ROWS 3 -#define COLS 4 - -#define OPENGL_WIDTH 48 -#define OPENGL_HEIGHT 13 - - -GLenum rgb, doubleBuffer, windType; -GLint windW, windH; - -GLenum mode1, mode2; -GLint boxW, boxH; -GLubyte OpenGL_bits[] = { - 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0xfb, 0xff, 0xff, 0xff, 0x01, - 0x7f, 0xfb, 0xff, 0xff, 0xff, 0x01, - 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, - 0x3e, 0x8f, 0xb7, 0xf9, 0xfc, 0x01, - 0x63, 0xdb, 0xb0, 0x8d, 0x0d, 0x00, - 0x63, 0xdb, 0xb7, 0x8d, 0x0d, 0x00, - 0x63, 0xdb, 0xb6, 0x8d, 0x0d, 0x00, - 0x63, 0x8f, 0xf3, 0xcc, 0x0d, 0x00, - 0x63, 0x00, 0x00, 0x0c, 0x4c, 0x0a, - 0x63, 0x00, 0x00, 0x0c, 0x4c, 0x0e, - 0x63, 0x00, 0x00, 0x8c, 0xed, 0x0e, - 0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00, -}; - - -static void Init(void) -{ - - mode1 = GL_TRUE; - mode2 = GL_TRUE; -} - -static void Reshape(int width, int height) -{ - - windW = (GLint)width; - windH = (GLint)height; -} - -#if 0 -static void RotateColorMask(void) -{ - static GLint rotation = 0; - - rotation = (rotation + 1) & 0x3; - switch (rotation) { - case 0: - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glIndexMask( 0xff ); - break; - case 1: - glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE); - glIndexMask(0xFE); - break; - case 2: - glColorMask(GL_TRUE, GL_FALSE, GL_TRUE, GL_TRUE); - glIndexMask(0xFD); - break; - case 3: - glColorMask(GL_TRUE, GL_TRUE, GL_FALSE, GL_TRUE); - glIndexMask(0xFB); - break; - } -} -#endif - -static void Viewport(GLint row, GLint column) -{ - GLint x, y; - - boxW = (windW - (COLS + 1) * GAP) / COLS; - boxH = (windH - (ROWS + 1) * GAP) / ROWS; - - x = GAP + column * (boxW + GAP); - y = GAP + row * (boxH + GAP); - - glViewport(x, y, boxW, boxH); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-boxW/2, boxW/2, -boxH/2, boxH/2, 0.0, 1.0); - glMatrixMode(GL_MODELVIEW); - - glEnable(GL_SCISSOR_TEST); - glScissor(x, y, boxW, boxH); -} - -enum { - COLOR_BLACK = 0, - COLOR_RED, - COLOR_GREEN, - COLOR_YELLOW, - COLOR_BLUE, - COLOR_MAGENTA, - COLOR_CYAN, - COLOR_WHITE -}; - -static float RGBMap[9][3] = { - {0, 0, 0}, - {1, 0, 0}, - {0, 1, 0}, - {1, 1, 0}, - {0, 0, 1}, - {1, 0, 1}, - {0, 1, 1}, - {1, 1, 1}, - {0.5, 0.5, 0.5} -}; - -static void SetColor(int c) -{ - glColor3fv(RGBMap[c]); -} - -static void Point(void) -{ - GLint i; - - glBegin(GL_POINTS); - SetColor(COLOR_WHITE); - glVertex2i(0, 0); - for (i = 1; i < 8; i++) { - GLint j = i * 2; - SetColor(COLOR_BLACK+i); - glVertex2i(-j, -j); - glVertex2i(-j, 0); - glVertex2i(-j, j); - glVertex2i(0, j); - glVertex2i(j, j); - glVertex2i(j, 0); - glVertex2i(j, -j); - glVertex2i(0, -j); - } - glEnd(); -} - -static void Lines(void) -{ - GLint i; - - glPushMatrix(); - - glTranslatef(-12, 0, 0); - for (i = 1; i < 8; i++) { - SetColor(COLOR_BLACK+i); - glBegin(GL_LINES); - glVertex2i(-boxW/4, -boxH/4); - glVertex2i(boxW/4, boxH/4); - glEnd(); - glTranslatef(4, 0, 0); - } - - glPopMatrix(); - - glBegin(GL_LINES); - glVertex2i(0, 0); - glEnd(); -} - -static void LineStrip(void) -{ - - glBegin(GL_LINE_STRIP); - SetColor(COLOR_RED); - glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(-boxH/4)); - SetColor(COLOR_GREEN); - glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(boxH/4)); - SetColor(COLOR_BLUE); - glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(boxH/4)); - SetColor(COLOR_WHITE); - glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(-boxH/4)); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex2i(0, 0); - glEnd(); -} - -static void LineLoop(void) -{ - - glBegin(GL_LINE_LOOP); - SetColor(COLOR_RED); - glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(-boxH/4)); - SetColor(COLOR_GREEN); - glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(boxH/4)); - SetColor(COLOR_BLUE); - glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(boxH/4)); - SetColor(COLOR_WHITE); - glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(-boxH/4)); - glEnd(); - - glEnable(GL_LOGIC_OP); - glLogicOp(GL_XOR); - - glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE); - - SetColor(COLOR_MAGENTA); - glBegin(GL_LINE_LOOP); - glVertex2f(PIXEL_CENTER(-boxW/8), PIXEL_CENTER(-boxH/8)); - glVertex2f(PIXEL_CENTER(-boxW/8), PIXEL_CENTER(boxH/8)); - glEnd(); - glBegin(GL_LINE_LOOP); - glVertex2f(PIXEL_CENTER(-boxW/8), PIXEL_CENTER(boxH/8+5)); - glVertex2f(PIXEL_CENTER(boxW/8), PIXEL_CENTER(boxH/8+5)); - glEnd(); - glDisable(GL_LOGIC_OP); - glDisable(GL_BLEND); - - SetColor(COLOR_GREEN); - glBegin(GL_POINTS); - glVertex2i(0, 0); - glEnd(); - - glBegin(GL_LINE_LOOP); - glVertex2i(0, 0); - glEnd(); -} - -static void Bitmap(void) -{ - - glBegin(GL_LINES); - SetColor(COLOR_GREEN); - glVertex2i(-boxW/2, 0); - glVertex2i(boxW/2, 0); - glVertex2i(0, -boxH/2); - glVertex2i(0, boxH/2); - SetColor(COLOR_RED); - glVertex2i(0, -3); - glVertex2i(0, -3+OPENGL_HEIGHT); - SetColor(COLOR_BLUE); - glVertex2i(0, -3); - glVertex2i(OPENGL_WIDTH, -3); - glEnd(); - - SetColor(COLOR_GREEN); - - glPixelStorei(GL_UNPACK_LSB_FIRST, GL_TRUE); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - glRasterPos2i(0, 0); - glBitmap(OPENGL_WIDTH, OPENGL_HEIGHT, 0, 3, 0.0, 0.0, OpenGL_bits); -} - -static void Triangles(void) -{ - - glBegin(GL_TRIANGLES); - SetColor(COLOR_GREEN); - glVertex2i(-boxW/4, -boxH/4); - SetColor(COLOR_RED); - glVertex2i(-boxW/8, -boxH/16); - SetColor(COLOR_BLUE); - glVertex2i(boxW/8, -boxH/16); - - SetColor(COLOR_GREEN); - glVertex2i(-boxW/4, boxH/4); - SetColor(COLOR_RED); - glVertex2i(-boxW/8, boxH/16); - SetColor(COLOR_BLUE); - glVertex2i(boxW/8, boxH/16); - glEnd(); - - glBegin(GL_TRIANGLES); - glVertex2i(0, 0); - glVertex2i(-100, 100); - glEnd(); -} - -static void TriangleStrip(void) -{ - - glBegin(GL_TRIANGLE_STRIP); - SetColor(COLOR_GREEN); - glVertex2i(-boxW/4, -boxH/4); - SetColor(COLOR_RED); - glVertex2i(-boxW/4, boxH/4); - SetColor(COLOR_BLUE); - glVertex2i(0, -boxH/4); - SetColor(COLOR_WHITE); - glVertex2i(0, boxH/4); - SetColor(COLOR_CYAN); - glVertex2i(boxW/4, -boxH/4); - SetColor(COLOR_YELLOW); - glVertex2i(boxW/4, boxH/4); - glEnd(); - - glBegin(GL_TRIANGLE_STRIP); - glVertex2i(0, 0); - glVertex2i(-100, 100); - glEnd(); -} - -static void TriangleFan(void) -{ - GLint vx[8][2]; - GLint x0, y0, x1, y1, x2, y2, x3, y3; - GLint i; - - y0 = -boxH/4; - y1 = y0 + boxH/2/3; - y2 = y1 + boxH/2/3; - y3 = boxH/4; - x0 = -boxW/4; - x1 = x0 + boxW/2/3; - x2 = x1 + boxW/2/3; - x3 = boxW/4; - - vx[0][0] = x0; vx[0][1] = y1; - vx[1][0] = x0; vx[1][1] = y2; - vx[2][0] = x1; vx[2][1] = y3; - vx[3][0] = x2; vx[3][1] = y3; - vx[4][0] = x3; vx[4][1] = y2; - vx[5][0] = x3; vx[5][1] = y1; - vx[6][0] = x2; vx[6][1] = y0; - vx[7][0] = x1; vx[7][1] = y0; - - glBegin(GL_TRIANGLE_FAN); - SetColor(COLOR_WHITE); - glVertex2i(0, 0); - for (i = 0; i < 8; i++) { - SetColor(COLOR_WHITE-i); - glVertex2iv(vx[i]); - } - glEnd(); - - glBegin(GL_TRIANGLE_FAN); - glVertex2i(0, 0); - glVertex2i(-100, 100); - glEnd(); -} - -static void Rect(void) -{ - - SetColor(COLOR_GREEN); - glRecti(-boxW/4, -boxH/4, boxW/4, boxH/4); -} - -static void PolygonFunc(void) -{ - GLint vx[8][2]; - GLint x0, y0, x1, y1, x2, y2, x3, y3; - GLint i; - - y0 = -boxH/4; - y1 = y0 + boxH/2/3; - y2 = y1 + boxH/2/3; - y3 = boxH/4; - x0 = -boxW/4; - x1 = x0 + boxW/2/3; - x2 = x1 + boxW/2/3; - x3 = boxW/4; - - vx[0][0] = x0; vx[0][1] = y1; - vx[1][0] = x0; vx[1][1] = y2; - vx[2][0] = x1; vx[2][1] = y3; - vx[3][0] = x2; vx[3][1] = y3; - vx[4][0] = x3; vx[4][1] = y2; - vx[5][0] = x3; vx[5][1] = y1; - vx[6][0] = x2; vx[6][1] = y0; - vx[7][0] = x1; vx[7][1] = y0; - - glBegin(GL_POLYGON); - for (i = 0; i < 8; i++) { - SetColor(COLOR_WHITE-i); - glVertex2iv(vx[i]); - } - glEnd(); - - glBegin(GL_POLYGON); - glVertex2i(0, 0); - glVertex2i(100, 100); - glEnd(); -} - -static void Quads(void) -{ - - glBegin(GL_QUADS); - SetColor(COLOR_GREEN); - glVertex2i(-boxW/4, -boxH/4); - SetColor(COLOR_RED); - glVertex2i(-boxW/8, -boxH/16); - SetColor(COLOR_BLUE); - glVertex2i(boxW/8, -boxH/16); - SetColor(COLOR_WHITE); - glVertex2i(boxW/4, -boxH/4); - - SetColor(COLOR_GREEN); - glVertex2i(-boxW/4, boxH/4); - SetColor(COLOR_RED); - glVertex2i(-boxW/8, boxH/16); - SetColor(COLOR_BLUE); - glVertex2i(boxW/8, boxH/16); - SetColor(COLOR_WHITE); - glVertex2i(boxW/4, boxH/4); - glEnd(); - - glBegin(GL_QUADS); - glVertex2i(0, 0); - glVertex2i(100, 100); - glVertex2i(-100, 100); - glEnd(); -} - -static void QuadStrip(void) -{ - - glBegin(GL_QUAD_STRIP); - SetColor(COLOR_GREEN); - glVertex2i(-boxW/4, -boxH/4); - SetColor(COLOR_RED); - glVertex2i(-boxW/4, boxH/4); - SetColor(COLOR_BLUE); - glVertex2i(0, -boxH/4); - SetColor(COLOR_WHITE); - glVertex2i(0, boxH/4); - SetColor(COLOR_CYAN); - glVertex2i(boxW/4, -boxH/4); - SetColor(COLOR_YELLOW); - glVertex2i(boxW/4, boxH/4); - glEnd(); - - glBegin(GL_QUAD_STRIP); - glVertex2i(0, 0); - glVertex2i(100, 100); - glVertex2i(-100, 100); - glEnd(); -} - -static void Draw(EGLDisplay dpy, EGLSurface surf) -{ - - glViewport(0, 0, windW, windH); - glDisable(GL_SCISSOR_TEST); - - glPushAttrib(GL_COLOR_BUFFER_BIT); - - glColorMask(1, 1, 1, 1); - glIndexMask(~0); - - glClearColor(0.0, 0.0, 0.0, 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - glPopAttrib(); - - if (mode1) { - glShadeModel(GL_SMOOTH); - } else { - glShadeModel(GL_FLAT); - } - - if (mode2) { - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } else { - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - } - - Viewport(0, 0); Point(); - Viewport(0, 1); Lines(); - Viewport(0, 2); LineStrip(); - Viewport(0, 3); LineLoop(); - - Viewport(1, 0); Bitmap(); - - Viewport(1, 1); TriangleFan(); - Viewport(1, 2); Triangles(); - Viewport(1, 3); TriangleStrip(); - - Viewport(2, 0); Rect(); - Viewport(2, 1); PolygonFunc(); - Viewport(2, 2); Quads(); - Viewport(2, 3); QuadStrip(); - - glFlush(); - - if (doubleBuffer) { - eglSwapBuffers(dpy, surf); - } -} - -static void -write_ppm(const char *filename, const GLubyte *buffer, int width, int height) -{ - const int binary = 0; - FILE *f = fopen( filename, "w" ); - if (f) { - int i, x, y; - const GLubyte *ptr = buffer; - if (binary) { - fprintf(f,"P6\n"); - fprintf(f,"# ppm-file created by osdemo.c\n"); - fprintf(f,"%i %i\n", width,height); - fprintf(f,"255\n"); - fclose(f); - f = fopen( filename, "ab" ); /* reopen in binary append mode */ - for (y=height-1; y>=0; y--) { - for (x=0; x<width; x++) { - i = (y*width + x) * 4; - fputc(ptr[i], f); /* write red */ - fputc(ptr[i+1], f); /* write green */ - fputc(ptr[i+2], f); /* write blue */ - } - } - } - else { - /*ASCII*/ - int counter = 0; - fprintf(f,"P3\n"); - fprintf(f,"# ascii ppm file created by osdemo.c\n"); - fprintf(f,"%i %i\n", width, height); - fprintf(f,"255\n"); - for (y=height-1; y>=0; y--) { - for (x=0; x<width; x++) { - i = (y*width + x) * 4; - fprintf(f, " %3d %3d %3d", ptr[i], ptr[i+1], ptr[i+2]); - counter++; - if (counter % 5 == 0) - fprintf(f, "\n"); - } - } - } - fclose(f); - } -} - -#include "../src/egl/main/egldisplay.h" - -typedef struct fb_display -{ - _EGLDisplay Base; /* base class/object */ - void *pFB; -} fbDisplay; - - -int -main(int argc, char *argv[]) -{ - int maj, min; - EGLContext ctx; - EGLSurface screen_surf; - EGLConfig configs[10]; - EGLScreenMESA screen; - EGLModeMESA mode; - EGLint numConfigs, count; - EGLBoolean b; - const EGLint screenAttribs[] = { - EGL_WIDTH, 1024, - EGL_HEIGHT, 768, - EGL_NONE - }; - - /* - EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); - */ - EGLDisplay d = eglGetDisplay(":0"); - assert(d); - - if (!eglInitialize(d, &maj, &min)) { - printf("demo: eglInitialize failed\n"); - exit(1); - } - - printf("EGL version = %d.%d\n", maj, min); - printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR)); - - eglGetConfigs(d, configs, 10, &numConfigs); - eglGetScreensMESA(d, &screen, 1, &count); - eglGetModesMESA(d, screen, &mode, 1, &count); - - ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL); - if (ctx == EGL_NO_CONTEXT) { - printf("failed to create context\n"); - return 0; - } - - screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs); - if (screen_surf == EGL_NO_SURFACE) { - printf("failed to create screen surface\n"); - return 0; - } - - eglShowScreenSurfaceMESA(d, screen, screen_surf, mode); - - b = eglMakeCurrent(d, screen_surf, screen_surf, ctx); - if (!b) { - printf("make current failed\n"); - return 0; - } - glViewport(0, 0, 1024, 768); - - - Init(); - Reshape(1024, 768); - - glDrawBuffer( GL_FRONT ); - glClearColor( 0, 1.0, 0, 1); - - glClear( GL_COLOR_BUFFER_BIT ); - - doubleBuffer = 1; - glDrawBuffer( GL_BACK ); - - Draw(d, screen_surf); - - write_ppm("dump.ppm", ((struct fb_display *)_eglLookupDisplay(d))->pFB, 1024, 768); - - eglDestroySurface(d, screen_surf); - eglDestroyContext(d, ctx); - eglTerminate(d); - - return 0; -} diff --git a/progs/egl/eglgears.c b/progs/egl/eglgears.c deleted file mode 100644 index 9feee20d889..00000000000 --- a/progs/egl/eglgears.c +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Copyright (C) 1999-2001 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. - */ - -/* - * This is a port of the infamous "glxgears" demo to straight EGL - * Port by Dane Rushton 10 July 2005 - * - * No command line options. - * Program runs for 5 seconds then exits, outputing framerate to console - */ - -#include <math.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <GL/gl.h> -#include <GLES/egl.h> -#include <assert.h> - -#define MAX_CONFIGS 10 -#define MAX_MODES 100 - -#define BENCHMARK - -#ifdef BENCHMARK - -/* XXX this probably isn't very portable */ - -#include <sys/time.h> -#include <unistd.h> - -/* return current time (in seconds) */ -static double -current_time(void) -{ - struct timeval tv; -#ifdef __VMS - (void) gettimeofday(&tv, NULL ); -#else - struct timezone tz; - (void) gettimeofday(&tv, &tz); -#endif - return (double) tv.tv_sec + tv.tv_usec / 1000000.0; -} - -#else /*BENCHMARK*/ - -/* dummy */ -static double -current_time(void) -{ - /* update this function for other platforms! */ - static double t = 0.0; - static int warn = 1; - if (warn) { - fprintf(stderr, "Warning: current_time() not implemented!!\n"); - warn = 0; - } - return t += 1.0; -} - -#endif /*BENCHMARK*/ - - -#ifndef M_PI -#define M_PI 3.14159265 -#endif - - -static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; -static GLint gear1, gear2, gear3; -static GLfloat angle = 0.0; - -#if 0 -static GLfloat eyesep = 5.0; /* Eye separation. */ -static GLfloat fix_point = 40.0; /* Fixation point distance. */ -static GLfloat left, right, asp; /* Stereo frustum params. */ -#endif - - -/* - * - * Draw a gear wheel. You'll probably want to call this function when - * building a display list since we do a lot of trig here. - * - * Input: inner_radius - radius of hole at center - * outer_radius - radius at center of teeth - * width - width of gear - * teeth - number of teeth - * tooth_depth - depth of tooth - */ -static void -gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, - GLint teeth, GLfloat tooth_depth) -{ - GLint i; - GLfloat r0, r1, r2; - GLfloat angle, da; - GLfloat u, v, len; - - r0 = inner_radius; - r1 = outer_radius - tooth_depth / 2.0; - r2 = outer_radius + tooth_depth / 2.0; - - da = 2.0 * M_PI / teeth / 4.0; - - glShadeModel(GL_FLAT); - - glNormal3f(0.0, 0.0, 1.0); - - /* draw front face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - if (i < teeth) { - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - width * 0.5); - } - } - glEnd(); - - /* draw front sides of teeth */ - glBegin(GL_QUADS); - da = 2.0 * M_PI / teeth / 4.0; - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), - width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - width * 0.5); - } - glEnd(); - - glNormal3f(0.0, 0.0, -1.0); - - /* draw back face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - if (i < teeth) { - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - } - } - glEnd(); - - /* draw back sides of teeth */ - glBegin(GL_QUADS); - da = 2.0 * M_PI / teeth / 4.0; - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - -width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), - -width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - } - glEnd(); - - /* draw outward faces of teeth */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - u = r2 * cos(angle + da) - r1 * cos(angle); - v = r2 * sin(angle + da) - r1 * sin(angle); - len = sqrt(u * u + v * v); - u /= len; - v /= len; - glNormal3f(v, -u, 0.0); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5); - glNormal3f(cos(angle), sin(angle), 0.0); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), - width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), - -width * 0.5); - u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da); - v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da); - glNormal3f(v, -u, 0.0); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - -width * 0.5); - glNormal3f(cos(angle), sin(angle), 0.0); - } - - glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5); - glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5); - - glEnd(); - - glShadeModel(GL_SMOOTH); - - /* draw inside radius cylinder */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glNormal3f(-cos(angle), -sin(angle), 0.0); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - } - glEnd(); -} - - -static void -draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - glRotatef(view_rotx, 1.0, 0.0, 0.0); - glRotatef(view_roty, 0.0, 1.0, 0.0); - glRotatef(view_rotz, 0.0, 0.0, 1.0); - - glPushMatrix(); - glTranslatef(-3.0, -2.0, 0.0); - glRotatef(angle, 0.0, 0.0, 1.0); - glCallList(gear1); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(3.1, -2.0, 0.0); - glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0); - glCallList(gear2); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(-3.1, 4.2, 0.0); - glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0); - glCallList(gear3); - glPopMatrix(); - - glPopMatrix(); -} - - -/* new window size or exposure */ -static void -reshape(int width, int height) -{ - glViewport(0, 0, (GLint) width, (GLint) height); - - GLfloat h = (GLfloat) height / (GLfloat) width; - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0, 0.0, -40.0); -} - - - -static void -init(void) -{ - static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 }; - static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 }; - static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 }; - static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 }; - - glLightfv(GL_LIGHT0, GL_POSITION, pos); - glEnable(GL_CULL_FACE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - /* make the gears */ - gear1 = glGenLists(1); - glNewList(gear1, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); - gear(1.0, 4.0, 1.0, 20, 0.7); - glEndList(); - - gear2 = glGenLists(1); - glNewList(gear2, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); - gear(0.5, 2.0, 2.0, 10, 0.7); - glEndList(); - - gear3 = glGenLists(1); - glNewList(gear3, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); - gear(1.3, 2.0, 0.5, 10, 0.7); - glEndList(); - - glEnable(GL_NORMALIZE); -} - - - - -static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr) -{ - double st = current_time(); - double ct = st; - int frames = 0; - while (ct - st < ttr) - { - double tt = current_time(); - double dt = tt - ct; - ct = tt; - - /* advance rotation for next frame */ - angle += 70.0 * dt; /* 70 degrees per second */ - if (angle > 3600.0) - angle -= 3600.0; - - draw(); - - eglSwapBuffers(dpy, surf); - - - frames++; - } - - GLfloat seconds = ct - st; - GLfloat fps = frames / seconds; - printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps); - -} - - -int -main(int argc, char *argv[]) -{ - int maj, min; - EGLContext ctx; - EGLSurface screen_surf; - EGLConfig configs[MAX_CONFIGS]; - EGLint numConfigs, i; - EGLBoolean b; - EGLDisplay d; - EGLint screenAttribs[10]; - EGLModeMESA mode[MAX_MODES]; - EGLScreenMESA screen; - EGLint count, chosenMode; - GLboolean printInfo = GL_FALSE; - EGLint width = 0, height = 0; - - /* parse cmd line args */ - for (i = 1; i < argc; i++) - { - if (strcmp(argv[i], "-info") == 0) - { - printInfo = GL_TRUE; - } - else - printf("Warning: unknown parameter: %s\n", argv[i]); - } - - /* DBR : Create EGL context/surface etc */ - d = eglGetDisplay(":0"); - assert(d); - - if (!eglInitialize(d, &maj, &min)) { - printf("eglgears: eglInitialize failed\n"); - exit(1); - } - - printf("eglgears: EGL version = %d.%d\n", maj, min); - printf("eglgears: EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR)); - - /* XXX use ChooseConfig */ - eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs); - eglGetScreensMESA(d, &screen, 1, &count); - - if (!eglGetModesMESA(d, screen, mode, MAX_MODES, &count) || count == 0) { - printf("eglgears: eglGetModesMESA failed!\n"); - return 0; - } - - /* Print list of modes, and find the one to use */ - printf("eglgears: Found %d modes:\n", count); - for (i = 0; i < count; i++) { - EGLint w, h; - eglGetModeAttribMESA(d, mode[i], EGL_WIDTH, &w); - eglGetModeAttribMESA(d, mode[i], EGL_HEIGHT, &h); - printf("%3d: %d x %d\n", i, w, h); - if (w > width && h > height && w <= 1280 && h <= 1024) { - width = w; - height = h; - chosenMode = i; - } - } - printf("eglgears: Using screen mode/size %d: %d x %d\n", chosenMode, width, height); - - ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL); - if (ctx == EGL_NO_CONTEXT) { - printf("eglgears: failed to create context\n"); - return 0; - } - - /* build up screenAttribs array */ - i = 0; - screenAttribs[i++] = EGL_WIDTH; - screenAttribs[i++] = width; - screenAttribs[i++] = EGL_HEIGHT; - screenAttribs[i++] = height; - screenAttribs[i++] = EGL_NONE; - - screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs); - if (screen_surf == EGL_NO_SURFACE) { - printf("eglgears: failed to create screen surface\n"); - return 0; - } - - b = eglShowScreenSurfaceMESA(d, screen, screen_surf, mode[chosenMode]); - if (!b) { - printf("eglgears: show surface failed\n"); - return 0; - } - - b = eglMakeCurrent(d, screen_surf, screen_surf, ctx); - if (!b) { - printf("eglgears: make current failed\n"); - return 0; - } - - if (printInfo) - { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - } - - init(); - reshape(width, height); - - glDrawBuffer( GL_BACK ); - - run_gears(d, screen_surf, 5.0); - - eglDestroySurface(d, screen_surf); - eglDestroyContext(d, ctx); - eglTerminate(d); - - return 0; -} diff --git a/progs/egl/eglinfo.c b/progs/egl/eglinfo.c deleted file mode 100644 index f9c24754457..00000000000 --- a/progs/egl/eglinfo.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * eglinfo - like glxinfo but for EGL - * - * Brian Paul - * 11 March 2005 - * - * Copyright (C) 2005 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. - */ - - -#include <GLES/egl.h> -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#define MAX_CONFIGS 1000 -#define MAX_MODES 1000 -#define MAX_SCREENS 10 - - -/** - * Print table of all available configurations. - */ -static void -PrintConfigs(EGLDisplay d) -{ - EGLConfig configs[MAX_CONFIGS]; - EGLint numConfigs, i; - - eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs); - - printf("Configurations:\n"); - printf(" bf lv d st colorbuffer dp st supported\n"); - printf(" id sz l b ro r g b a th cl surfaces \n"); - printf("---------------------------------------------------\n"); - for (i = 0; i < numConfigs; i++) { - EGLint id, size, level; - EGLint red, green, blue, alpha; - EGLint depth, stencil; - EGLint surfaces; - EGLint doubleBuf = 1, stereo = 0; - char surfString[100] = ""; - - eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id); - eglGetConfigAttrib(d, configs[i], EGL_BUFFER_SIZE, &size); - eglGetConfigAttrib(d, configs[i], EGL_LEVEL, &level); - - eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red); - eglGetConfigAttrib(d, configs[i], EGL_GREEN_SIZE, &green); - eglGetConfigAttrib(d, configs[i], EGL_BLUE_SIZE, &blue); - eglGetConfigAttrib(d, configs[i], EGL_ALPHA_SIZE, &alpha); - eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth); - eglGetConfigAttrib(d, configs[i], EGL_STENCIL_SIZE, &stencil); - eglGetConfigAttrib(d, configs[i], EGL_SURFACE_TYPE, &surfaces); - - if (surfaces & EGL_WINDOW_BIT) - strcat(surfString, "win,"); - if (surfaces & EGL_PBUFFER_BIT) - strcat(surfString, "pb,"); - if (surfaces & EGL_PIXMAP_BIT) - strcat(surfString, "pix,"); -#ifdef EGL_MESA_screen_surface - if (surfaces & EGL_SCREEN_BIT_MESA) - strcat(surfString, "scrn,"); -#endif - if (strlen(surfString) > 0) - surfString[strlen(surfString) - 1] = 0; - - printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d %-12s\n", - id, size, level, - doubleBuf ? 'y' : '.', - stereo ? 'y' : '.', - red, green, blue, alpha, - depth, stencil, surfString); - } -} - - -/** - * Print table of all available configurations. - */ -static void -PrintModes(EGLDisplay d) -{ -#ifdef EGL_MESA_screen_surface - const char *extensions = eglQueryString(d, EGL_EXTENSIONS); - if (strstr(extensions, "EGL_MESA_screen_surface")) { - EGLScreenMESA screens[MAX_SCREENS]; - EGLint numScreens = 1, scrn; - EGLModeMESA modes[MAX_MODES]; - - eglGetScreensMESA(d, screens, MAX_SCREENS, &numScreens); - printf("Number of Screens: %d\n\n", numScreens); - - for (scrn = 0; scrn < numScreens; scrn++) { - EGLint numModes, i; - - eglGetModesMESA(d, screens[scrn], modes, MAX_MODES, &numModes); - - printf("Screen %d Modes:\n", scrn); - printf(" id width height refresh name\n"); - printf("-----------------------------------------\n"); - for (i = 0; i < numModes; i++) { - EGLint id, w, h, r; - const char *str; - eglGetModeAttribMESA(d, modes[i], EGL_MODE_ID_MESA, &id); - eglGetModeAttribMESA(d, modes[i], EGL_WIDTH, &w); - eglGetModeAttribMESA(d, modes[i], EGL_HEIGHT, &h); - eglGetModeAttribMESA(d, modes[i], EGL_REFRESH_RATE_MESA, &r); - str = eglQueryModeStringMESA(d, modes[i]); - printf("0x%02x %5d %5d %.3f %s\n", id, w, h, r / 1000.0, str); - } - } - } -#endif -} - - - -int -main(int argc, char *argv[]) -{ - int maj, min; - /*EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);*/ - EGLDisplay d = eglGetDisplay(":0"); - - if (!eglInitialize(d, &maj, &min)) { - printf("eglinfo: eglInitialize failed\n"); - exit(1); - } - - printf("EGL API version: %d.%d\n", maj, min); - printf("EGL vendor string: %s\n", eglQueryString(d, EGL_VENDOR)); - printf("EGL version string: %s\n", eglQueryString(d, EGL_VERSION)); - printf("EGL extensions string:\n"); - printf(" %s\n", eglQueryString(d, EGL_EXTENSIONS)); - printf("\n"); - - PrintConfigs(d); - - printf("\n"); - - PrintModes(d); - - eglTerminate(d); - - return 0; -} diff --git a/progs/fbdev/Makefile b/progs/fbdev/Makefile deleted file mode 100644 index 0a0c77906f7..00000000000 --- a/progs/fbdev/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# Makefile for miniglx demo programs - -TOP = ../.. - -include $(TOP)/configs/current - - -SOURCES = glfbdevtest.c - -OBJECTS = $(SOURCES:.c=.o) - -PROGS = $(SOURCES:%.c=%) - -INCLUDES = \ - -I. \ - -I$(TOP)/include - - -##### RULES ##### - -.SUFFIXES: -.SUFFIXES: .c - -.c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ - - -##### TARGETS ##### - -default: depend $(PROGS) - -clean: - rm -f $(PROGS) - rm -f *.o - - -depend: $(SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -include depend diff --git a/progs/fbdev/glfbdevtest.c b/progs/fbdev/glfbdevtest.c deleted file mode 100644 index a461c55e2f8..00000000000 --- a/progs/fbdev/glfbdevtest.c +++ /dev/null @@ -1,524 +0,0 @@ -/* - * Test the GLFBDev interface. Only tested with radeonfb driver!!!! - * - * Written by Brian Paul - */ - - -#include <assert.h> -#include <errno.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <fcntl.h> -#include <unistd.h> -#include <sys/ioctl.h> -#include <sys/mman.h> -#include <sys/types.h> -#include <linux/fb.h> -#include <linux/kd.h> -#include <linux/vt.h> -#include <GL/gl.h> -#include <GL/glfbdev.h> -#include <math.h> - -#define DEFAULT_DEPTH 8 - -static struct fb_fix_screeninfo FixedInfo; -static struct fb_var_screeninfo VarInfo, OrigVarInfo; -static int DesiredDepth = 0; -static int OriginalVT = -1; -static int ConsoleFD = -1; -static int FrameBufferFD = -1; -static caddr_t FrameBuffer = (caddr_t) -1; -static caddr_t MMIOAddress = (caddr_t) -1; - - -static void -print_fixed_info(const struct fb_fix_screeninfo *fixed, const char *s) -{ - static const char *visuals[] = { - "MONO01", "MONO10", "TRUECOLOR", "PSEUDOCOLOR", - "DIRECTCOLOR", "STATIC_PSEUDOCOLOR" - }; - - printf("%s info -----------------------\n", s); - printf("id = %16s\n", fixed->id); - printf("smem_start = 0x%lx\n", fixed->smem_start); - printf("smem_len = %d (0x%x)\n", fixed->smem_len, fixed->smem_len); - printf("type = 0x%x\n", fixed->type); - printf("type_aux = 0x%x\n", fixed->type_aux); - printf("visual = 0x%x (%s)\n", fixed->visual, visuals[fixed->visual]); - printf("xpanstep = %d\n", fixed->xpanstep); - printf("ypanstep = %d\n", fixed->ypanstep); - printf("ywrapstep = %d\n", fixed->ywrapstep); - printf("line_length = %d\n", fixed->line_length); - printf("mmio_start = 0x%lx\n", fixed->mmio_start); - printf("mmio_len = %d (0x%x)\n", fixed->mmio_len, fixed->mmio_len); - printf("accel = 0x%x\n", fixed->accel); -} - - -static void -print_var_info(const struct fb_var_screeninfo *var, const char *s) -{ - printf("%s info -----------------------\n", s); - printf("xres = %d\n", var->xres); - printf("yres = %d\n", var->yres); - printf("xres_virtual = %d\n", var->xres_virtual); - printf("yres_virtual = %d\n", var->yres_virtual); - printf("xoffset = %d\n", var->xoffset); - printf("yoffset = %d\n", var->yoffset); - printf("bits_per_pixel = %d\n", var->bits_per_pixel); - printf("grayscale = %d\n", var->grayscale); - - printf("red.offset = %d length = %d msb_right = %d\n", - var->red.offset, var->red.length, var->red.msb_right); - printf("green.offset = %d length = %d msb_right = %d\n", - var->green.offset, var->green.length, var->green.msb_right); - printf("blue.offset = %d length = %d msb_right = %d\n", - var->blue.offset, var->blue.length, var->blue.msb_right); - printf("transp.offset = %d length = %d msb_right = %d\n", - var->transp.offset, var->transp.length, var->transp.msb_right); - - printf("nonstd = %d\n", var->nonstd); - printf("activate = %d\n", var->activate); - printf("height = %d mm\n", var->height); - printf("width = %d mm\n", var->width); - printf("accel_flags = 0x%x\n", var->accel_flags); - printf("pixclock = %d\n", var->pixclock); - printf("left_margin = %d\n", var->left_margin); - printf("right_margin = %d\n", var->right_margin); - printf("upper_margin = %d\n", var->upper_margin); - printf("lower_margin = %d\n", var->lower_margin); - printf("hsync_len = %d\n", var->hsync_len); - printf("vsync_len = %d\n", var->vsync_len); - printf("sync = %d\n", var->sync); - printf("vmode = %d\n", var->vmode); -} - - -static void -signal_handler(int signumber) -{ - signal(signumber, SIG_IGN); /* prevent recursion! */ - fprintf(stderr, "error: got signal %d (exiting)\n", signumber); - exit(1); -} - - -static void -initialize_fbdev( void ) -{ - char ttystr[1000]; - int fd, vtnumber, ttyfd; - int sz; - - (void) sz; - - if (geteuid()) { - fprintf(stderr, "error: you need to be root\n"); - exit(1); - } - -#if 1 - /* open the framebuffer device */ - FrameBufferFD = open("/dev/fb0", O_RDWR); - if (FrameBufferFD < 0) { - fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno)); - exit(1); - } -#endif - - /* open /dev/tty0 and get the vt number */ - if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) { - fprintf(stderr, "error opening /dev/tty0\n"); - exit(1); - } - if (ioctl(fd, VT_OPENQRY, &vtnumber) < 0 || vtnumber < 0) { - fprintf(stderr, "error: couldn't get a free vt\n"); - exit(1); - } - close(fd); - - /* open the console tty */ - sprintf(ttystr, "/dev/tty%d", vtnumber); /* /dev/tty1-64 */ - ConsoleFD = open(ttystr, O_RDWR | O_NDELAY, 0); - if (ConsoleFD < 0) { - fprintf(stderr, "error couldn't open console fd\n"); - exit(1); - } - - /* save current vt number */ - { - struct vt_stat vts; - if (ioctl(ConsoleFD, VT_GETSTATE, &vts) == 0) - OriginalVT = vts.v_active; - } - - /* disconnect from controlling tty */ - ttyfd = open("/dev/tty", O_RDWR); - if (ttyfd >= 0) { - ioctl(ttyfd, TIOCNOTTY, 0); - close(ttyfd); - } - - /* some magic to restore the vt when we exit */ - { - struct vt_mode vt; - if (ioctl(ConsoleFD, VT_ACTIVATE, vtnumber) != 0) - printf("ioctl VT_ACTIVATE: %s\n", strerror(errno)); - if (ioctl(ConsoleFD, VT_WAITACTIVE, vtnumber) != 0) - printf("ioctl VT_WAITACTIVE: %s\n", strerror(errno)); - - if (ioctl(ConsoleFD, VT_GETMODE, &vt) < 0) { - fprintf(stderr, "error: ioctl VT_GETMODE: %s\n", strerror(errno)); - exit(1); - } - - vt.mode = VT_PROCESS; - vt.relsig = SIGUSR1; - vt.acqsig = SIGUSR1; - if (ioctl(ConsoleFD, VT_SETMODE, &vt) < 0) { - fprintf(stderr, "error: ioctl(VT_SETMODE) failed: %s\n", - strerror(errno)); - exit(1); - } - } - - /* go into graphics mode */ - if (ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) { - fprintf(stderr, "error: ioctl(KDSETMODE, KD_GRAPHICS) failed: %s\n", - strerror(errno)); - exit(1); - } - - -#if 0 - /* open the framebuffer device */ - FrameBufferFD = open("/dev/fb0", O_RDWR); - if (FrameBufferFD < 0) { - fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno)); - exit(1); - } -#endif - - /* Get the fixed screen info */ - if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) { - fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", - strerror(errno)); - exit(1); - } - - print_fixed_info(&FixedInfo, "Fixed"); - - - /* get the variable screen info */ - if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) { - fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", - strerror(errno)); - exit(1); - } - - print_var_info(&OrigVarInfo, "Orig Var"); - - /* operate on a copy */ - VarInfo = OrigVarInfo; - - /* set the depth, resolution, etc */ - DesiredDepth = 32; - if (DesiredDepth) - VarInfo.bits_per_pixel = DesiredDepth; - - if (VarInfo.bits_per_pixel == 16) { - VarInfo.red.offset = 11; - VarInfo.green.offset = 5; - VarInfo.blue.offset = 0; - VarInfo.red.length = 5; - VarInfo.green.length = 6; - VarInfo.blue.length = 5; - VarInfo.transp.offset = 0; - VarInfo.transp.length = 0; - } - else if (VarInfo.bits_per_pixel == 32) { - VarInfo.red.offset = 16; - VarInfo.green.offset = 8; - VarInfo.blue.offset = 0; - VarInfo.transp.offset = 24; - VarInfo.red.length = 8; - VarInfo.green.length = 8; - VarInfo.blue.length = 8; - VarInfo.transp.length = 8; - } - /* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */ - VarInfo.xres_virtual = VarInfo.xres = 1280; - VarInfo.yres_virtual = VarInfo.yres = 1024; - VarInfo.pixclock = 7408; - VarInfo.left_margin = 248; - VarInfo.right_margin = 16; - VarInfo.upper_margin = 38; - VarInfo.lower_margin = 1; - VarInfo.hsync_len = 144; - VarInfo.vsync_len = 3; - - VarInfo.xoffset = 0; - VarInfo.yoffset = 0; - VarInfo.nonstd = 0; - VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */ - - /* set new variable screen info */ - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { - fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", - strerror(errno)); - exit(1); - } - - print_var_info(&VarInfo, "New Var"); - - if (FixedInfo.visual != FB_VISUAL_TRUECOLOR && - FixedInfo.visual != FB_VISUAL_DIRECTCOLOR) { - fprintf(stderr, "non-TRUE/DIRECT-COLOR visuals (0x%x) not supported by this demo.\n", FixedInfo.visual); - exit(1); - } - - /* initialize colormap */ - if (FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) { - struct fb_cmap cmap; - unsigned short red[256], green[256], blue[256]; - int i; - - /* we're assuming 256 entries here */ - printf("initializing directcolor colormap\n"); - cmap.start = 0; - cmap.len = 256; - cmap.red = red; - cmap.green = green; - cmap.blue = blue; - cmap.transp = NULL; - for (i = 0; i < cmap.len; i++) { - red[i] = green[i] = blue[i] = (i << 8) | i; - } - if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &cmap) < 0) { - fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i); - } - } - - /* - * fbdev says the frame buffer is at offset zero, and the mmio region - * is immediately after. - */ - - /* mmap the framebuffer into our address space */ - FrameBuffer = (caddr_t) mmap(0, /* start */ - FixedInfo.smem_len, /* bytes */ - PROT_READ | PROT_WRITE, /* prot */ - MAP_SHARED, /* flags */ - FrameBufferFD, /* fd */ - 0 /* offset */); - if (FrameBuffer == (caddr_t) - 1) { - fprintf(stderr, "error: unable to mmap framebuffer: %s\n", - strerror(errno)); - exit(1); - } - printf("FrameBuffer = %p\n", FrameBuffer); - -#if 1 - /* mmap the MMIO region into our address space */ - MMIOAddress = (caddr_t) mmap(0, /* start */ - FixedInfo.mmio_len, /* bytes */ - PROT_READ | PROT_WRITE, /* prot */ - MAP_SHARED, /* flags */ - FrameBufferFD, /* fd */ - FixedInfo.smem_len /* offset */); - if (MMIOAddress == (caddr_t) - 1) { - fprintf(stderr, "error: unable to mmap mmio region: %s\n", - strerror(errno)); - } - printf("MMIOAddress = %p\n", MMIOAddress); - - /* try out some simple MMIO register reads */ - if (1) - { - typedef unsigned int CARD32; - typedef unsigned char CARD8; -#define RADEON_CONFIG_MEMSIZE 0x00f8 -#define RADEON_MEM_SDRAM_MODE_REG 0x0158 -#define MMIO_IN32(base, offset) \ - *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) -#define INREG(addr) MMIO_IN32(MMIOAddress, addr) - int sz, type; - const char *typeStr[] = {"SDR", "DDR", "64-bit SDR"}; - sz = INREG(RADEON_CONFIG_MEMSIZE); - type = INREG(RADEON_MEM_SDRAM_MODE_REG); - printf("RADEON_CONFIG_MEMSIZE = %d (%d MB)\n", sz, sz / 1024 / 1024); - printf("RADEON_MEM_SDRAM_MODE_REG >> 30 = %d (%s)\n", - type >> 30, typeStr[type>>30]); - } -#endif - -} - - -static void -shutdown_fbdev( void ) -{ - struct vt_mode VT; - - printf("cleaning up...\n"); - /* restore original variable screen info */ - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) { - fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", - strerror(errno)); - exit(1); - } - - munmap(MMIOAddress, FixedInfo.mmio_len); - munmap(FrameBuffer, FixedInfo.smem_len); - close(FrameBufferFD); - - /* restore text mode */ - ioctl(ConsoleFD, KDSETMODE, KD_TEXT); - - /* set vt */ - if (ioctl(ConsoleFD, VT_GETMODE, &VT) != -1) { - VT.mode = VT_AUTO; - ioctl(ConsoleFD, VT_SETMODE, &VT); - } - - /* restore original vt */ - if (OriginalVT >= 0) { - ioctl(ConsoleFD, VT_ACTIVATE, OriginalVT); - OriginalVT = -1; - } - - close(ConsoleFD); -} - - -/* Borrowed from GLUT */ -static void -doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) -{ - int i, j; - GLfloat theta, phi, theta1; - GLfloat cosTheta, sinTheta; - GLfloat cosTheta1, sinTheta1; - GLfloat ringDelta, sideDelta; - - ringDelta = 2.0 * M_PI / rings; - sideDelta = 2.0 * M_PI / nsides; - - theta = 0.0; - cosTheta = 1.0; - sinTheta = 0.0; - for (i = rings - 1; i >= 0; i--) { - theta1 = theta + ringDelta; - cosTheta1 = cos(theta1); - sinTheta1 = sin(theta1); - glBegin(GL_QUAD_STRIP); - phi = 0.0; - for (j = nsides; j >= 0; j--) { - GLfloat cosPhi, sinPhi, dist; - - phi += sideDelta; - cosPhi = cos(phi); - sinPhi = sin(phi); - dist = R + r * cosPhi; - - glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); - glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); - glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); - glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); - } - glEnd(); - theta = theta1; - cosTheta = cosTheta1; - sinTheta = sinTheta1; - } -} - - -static void -gltest( void ) -{ - static const int attribs[] = { - GLFBDEV_DOUBLE_BUFFER, - GLFBDEV_DEPTH_SIZE, 16, - GLFBDEV_NONE - }; - GLFBDevContextPtr ctx; - GLFBDevBufferPtr buf; - GLFBDevVisualPtr vis; - int bytes, r, g, b, a; - float ang; - - printf("GLFBDEV_VENDOR = %s\n", glFBDevGetString(GLFBDEV_VENDOR)); - printf("GLFBDEV_VERSION = %s\n", glFBDevGetString(GLFBDEV_VERSION)); - - /* framebuffer size */ - bytes = VarInfo.xres_virtual * VarInfo.yres_virtual * VarInfo.bits_per_pixel / 8; - - vis = glFBDevCreateVisual( &FixedInfo, &VarInfo, attribs ); - assert(vis); - - buf = glFBDevCreateBuffer( &FixedInfo, &VarInfo, vis, FrameBuffer, NULL, bytes ); - assert(buf); - - ctx = glFBDevCreateContext( vis, NULL ); - assert(buf); - - b = glFBDevMakeCurrent( ctx, buf, buf ); - assert(b); - - /*printf("GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS));*/ - glGetIntegerv(GL_RED_BITS, &r); - glGetIntegerv(GL_GREEN_BITS, &g); - glGetIntegerv(GL_BLUE_BITS, &b); - glGetIntegerv(GL_ALPHA_BITS, &a); - printf("RED_BITS=%d GREEN_BITS=%d BLUE_BITS=%d ALPHA_BITS=%d\n", - r, g, b, a); - - glClearColor(0.5, 0.5, 1.0, 0); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1, 1, -1, 1, 2, 30); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0, 0, -15); - glViewport(0, 0, VarInfo.xres_virtual, VarInfo.yres_virtual); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - for (ang = 0; ang <= 180; ang += 15) { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glPushMatrix(); - glRotatef(ang, 1, 0, 0); - doughnut(1, 3, 40, 20); - glPopMatrix(); - glFBDevSwapBuffers(buf); - } - - /* clean up */ - b = glFBDevMakeCurrent( NULL, NULL, NULL); - assert(b); - - glFBDevDestroyContext(ctx); - glFBDevDestroyBuffer(buf); - glFBDevDestroyVisual(vis); -} - - -int -main( int argc, char *argv[] ) -{ - signal(SIGUSR1, signal_handler); /* exit if someone tries a vt switch */ - signal(SIGSEGV, signal_handler); /* catch segfaults */ - - initialize_fbdev(); - gltest(); - shutdown_fbdev(); - - return 0; -} diff --git a/progs/fp/Makefile b/progs/fp/Makefile deleted file mode 100644 index d461ebcc608..00000000000 --- a/progs/fp/Makefile +++ /dev/null @@ -1,127 +0,0 @@ -# progs/tests/Makefile - - -# These programs aren't intended to be included with the normal distro. -# They're not too interesting but they're good for testing. - -TOP = ../.. -include $(TOP)/configs/current - - -LIBS = $(APP_LIB_DEPS) - -SOURCES = \ - tri-abs.c \ - tri-add.c \ - tri-cmp.c \ - tri-cos.c \ - tri-dp3.c \ - tri-dp4.c \ - tri-dph.c \ - tri-dst.c \ - tri-ex2.c \ - tri-flr.c \ - tri-frc.c \ - tri-kil.c \ - tri-lg2.c \ - tri-lit.c \ - tri-lrp.c \ - tri-mad.c \ - tri-max.c \ - tri-min.c \ - tri-mov.c \ - tri-mul.c \ - tri-pow.c \ - tri-param.c \ - tri-rcp.c \ - tri-rsq.c \ - tri-scs.c \ - tri-sge.c \ - tri-sge2.c \ - tri-sin.c \ - tri-slt.c \ - tri-sub.c \ - tri-swz.c \ - tri-swz2.c \ - tri-tex.c \ - tri-xpd.c \ - tri-position.c \ - tri-depth.c \ - tri-depth2.c \ - tri-depthwrite.c \ - tri-depthwrite2.c \ - -NOTDONE=\ - tri-txb.c \ - tri-txp.c \ - tri-depthwrite.c \ - tri-fogoption.c - - -PROGS = $(SOURCES:%.c=%) - -INCLUDES = -I. -I$(TOP)/include -I../samples - -UTIL_FILES = readtex.h readtex.c - - -##### RULES ##### - -.SUFFIXES: -.SUFFIXES: .c - -.c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: $(UTIL_FILES) $(PROGS) - -clean: - rm -f $(PROGS) - rm -f *.o - rm -f getproclist.h - - -# auto code generation -getprocaddress: getprocaddress.c getproclist.h - -getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py - python getprocaddress.py > getproclist.h - - -texrect: texrect.o readtex.o - $(CC) texrect.o readtex.o $(LIBS) -o $@ - -texrect.o: texrect.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -invert: invert.o readtex.o - $(CC) invert.o readtex.o $(LIBS) -o $@ - -invert.o: invert.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -readtex.o: readtex.c - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - - -readtex.h: $(TOP)/progs/util/readtex.h - ln -s $(TOP)/progs/util/readtex.h . - -readtex.c: $(TOP)/progs/util/readtex.c - ln -s $(TOP)/progs/util/readtex.c . - - - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` diff --git a/progs/fp/tri-abs.c b/progs/fp/tri-abs.c deleted file mode 100644 index 44aa2cfa3ad..00000000000 --- a/progs/fp/tri-abs.c +++ /dev/null @@ -1,107 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "SUB R0, {0.5}.x, fragment.color; \n" - "ABS result.color, R0; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - -} - - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-add.c b/progs/fp/tri-add.c deleted file mode 100644 index b086126c867..00000000000 --- a/progs/fp/tri-add.c +++ /dev/null @@ -1,110 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "ADD R0, fragment.color, fragment.color; \n" - "ADD result.color, R0, R0; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-cmp.c b/progs/fp/tri-cmp.c deleted file mode 100644 index 968b67f3d91..00000000000 --- a/progs/fp/tri-cmp.c +++ /dev/null @@ -1,110 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "SUB R0, {0.5}.x, fragment.color; \n" - "CMP result.color, R0, fragment.color, {0.0}.x; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-cos.c b/progs/fp/tri-cos.c deleted file mode 100644 index 7ea24532189..00000000000 --- a/progs/fp/tri-cos.c +++ /dev/null @@ -1,113 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0; \n" - "MUL R0, fragment.color, {3.14}.x; \n" - "COS result.color.x, R0.x; \n" - "COS result.color.y, R0.y; \n" - "COS result.color.z, R0.z; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-depth.c b/progs/fp/tri-depth.c deleted file mode 100644 index a1f0579c8e1..00000000000 --- a/progs/fp/tri-depth.c +++ /dev/null @@ -1,111 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - /* scale of 10.0 gives me a visible result on nv hardware. - */ - static const char *modulate2D = - "!!ARBfp1.0\n" - "MUL result.color, fragment.position.z, {10.0}.x; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -40.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -40.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -25.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-depth2.c b/progs/fp/tri-depth2.c deleted file mode 100644 index f3096282833..00000000000 --- a/progs/fp/tri-depth2.c +++ /dev/null @@ -1,116 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - /* scale of 10.0 gives me a visible result on nv hardware. - */ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "MUL R0, fragment.position.z, {10.0}.x;\n" - "MOV result.color, R0; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); - glEnable(GL_DEPTH_TEST); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glVertex3f( 0.9, 0.9, -30.0); - glVertex3f(-0.9, 0.0, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, -0.9, -40.0); - glVertex3f(-0.9, 0.9, -40.0); - glVertex3f( 0.9, 0.0, -25.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB | GLUT_DEPTH; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-depthwrite.c b/progs/fp/tri-depthwrite.c deleted file mode 100644 index fedeec4577d..00000000000 --- a/progs/fp/tri-depthwrite.c +++ /dev/null @@ -1,107 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - -static void Init(void) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "MUL result.depth.z, fragment.color.z, {.1}.x; \n" - "MOV result.color.xy, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); - glEnable(GL_DEPTH_TEST); - - - glBegin(GL_TRIANGLES); - glColor4f(.8,0,.5,0); - glVertex3f( 0.9, -0.9, -30.0); - glVertex3f( 0.9, 0.9, -30.0); - glVertex3f(-0.9, 0.0, -30.0); - - glColor4f(0,.8,.7,0); - glVertex3f(-0.9, -0.9, -40.0); - glColor4f(0,.8,.7,0); - glVertex3f(-0.9, 0.9, -40.0); - glColor4f(0,.8,.3,0); - glVertex3f( 0.9, 0.0, -40.0); - glEnd(); - - glFlush(); -} - - -int main(int argc, char **argv) -{ - glutInit(&argc, argv); - - glutInitWindowPosition(0, 0); glutInitWindowSize( 300, 300); - - glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE); - - if (glutCreateWindow("Depth Test") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-depthwrite2.c b/progs/fp/tri-depthwrite2.c deleted file mode 100644 index 5547092ec9b..00000000000 --- a/progs/fp/tri-depthwrite2.c +++ /dev/null @@ -1,107 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - -static void Init(void) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "MUL result.depth.z, fragment.color.z, {.1}.x; \n" - "MOV result.color, fragment.color.z; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); - glEnable(GL_DEPTH_TEST); - - - glBegin(GL_TRIANGLES); - glColor4f(.8,0,.5,0); - glVertex3f( 0.9, -0.9, -30.0); - glVertex3f( 0.9, 0.9, -30.0); - glVertex3f(-0.9, 0.0, -30.0); - - glColor4f(0,.8,.7,0); - glVertex3f(-0.9, -0.9, -40.0); - glColor4f(0,.8,.7,0); - glVertex3f(-0.9, 0.9, -40.0); - glColor4f(0,.8,.3,0); - glVertex3f( 0.9, 0.0, -40.0); - glEnd(); - - glFlush(); -} - - -int main(int argc, char **argv) -{ - glutInit(&argc, argv); - - glutInitWindowPosition(0, 0); glutInitWindowSize( 300, 300); - - glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE); - - if (glutCreateWindow("Depth Test") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-dp3.c b/progs/fp/tri-dp3.c deleted file mode 100644 index 0e18de2dc46..00000000000 --- a/progs/fp/tri-dp3.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "DP3 result.color, fragment.color, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-dp4.c b/progs/fp/tri-dp4.c deleted file mode 100644 index 400bbf4da2d..00000000000 --- a/progs/fp/tri-dp4.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "DP4 result.color, fragment.color.xxxx, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-dph.c b/progs/fp/tri-dph.c deleted file mode 100644 index 958073c4131..00000000000 --- a/progs/fp/tri-dph.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "DPH result.color, fragment.color, fragment.color.xyzx; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-dst.c b/progs/fp/tri-dst.c deleted file mode 100644 index 3d85e85643c..00000000000 --- a/progs/fp/tri-dst.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "DST result.color, fragment.color, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-ex2.c b/progs/fp/tri-ex2.c deleted file mode 100644 index f09b1d78469..00000000000 --- a/progs/fp/tri-ex2.c +++ /dev/null @@ -1,110 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "EX2 R0, fragment.color.x; \n" - "SUB result.color, R0, {1.0}.x; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-flr.c b/progs/fp/tri-flr.c deleted file mode 100644 index 059f6b67541..00000000000 --- a/progs/fp/tri-flr.c +++ /dev/null @@ -1,110 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "ADD R0, fragment.color, {0.5}.x; \n" - "FLR result.color, R0; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-fp.c b/progs/fp/tri-fp.c deleted file mode 100644 index 4148a8def34..00000000000 --- a/progs/fp/tri-fp.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "SLT result.color, {0.5}.x, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-frc.c b/progs/fp/tri-frc.c deleted file mode 100644 index 8d60c9dc201..00000000000 --- a/progs/fp/tri-frc.c +++ /dev/null @@ -1,111 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0; \n" - "MUL R0, fragment.color, {3.0}.x; \n" - "FRC result.color, R0; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-inv.c b/progs/fp/tri-inv.c deleted file mode 100644 index e9023323862..00000000000 --- a/progs/fp/tri-inv.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "INV result.color, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-kil.c b/progs/fp/tri-kil.c deleted file mode 100644 index 47dbd049644..00000000000 --- a/progs/fp/tri-kil.c +++ /dev/null @@ -1,111 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "SUB R0, fragment.color, {0.5,0,0,0}; \n" - "KIL R0;" - "MOV result.color, R0;" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-lg2.c b/progs/fp/tri-lg2.c deleted file mode 100644 index c7eec469741..00000000000 --- a/progs/fp/tri-lg2.c +++ /dev/null @@ -1,110 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "MUL R0, fragment.color, {4.0}.x; \n" - "LG2 result.color, R0.x; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-lit.c b/progs/fp/tri-lit.c deleted file mode 100644 index 21e3b6f2169..00000000000 --- a/progs/fp/tri-lit.c +++ /dev/null @@ -1,111 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "SUB R0, {0.5}.x, fragment.color; \n" - "LIT result.color, R0; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-lrp.c b/progs/fp/tri-lrp.c deleted file mode 100644 index a5659eed60d..00000000000 --- a/progs/fp/tri-lrp.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0, R1;\n" - "LRP result.color, fragment.color.z, {1,0,0,1}, {0,1,0,1}; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-mad.c b/progs/fp/tri-mad.c deleted file mode 100644 index b46d139fb3c..00000000000 --- a/progs/fp/tri-mad.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0, R1;\n" - "MAD result.color, fragment.color.z, {1,0,0,1}, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-max.c b/progs/fp/tri-max.c deleted file mode 100644 index 481a0679165..00000000000 --- a/progs/fp/tri-max.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "MAX result.color, {0.5}.x, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-min.c b/progs/fp/tri-min.c deleted file mode 100644 index 7bb722f85ff..00000000000 --- a/progs/fp/tri-min.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "MIN result.color, {0.5}.x, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-mov.c b/progs/fp/tri-mov.c deleted file mode 100644 index 40b5b66f5cc..00000000000 --- a/progs/fp/tri-mov.c +++ /dev/null @@ -1,102 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "MOV result.color, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB | GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-mul.c b/progs/fp/tri-mul.c deleted file mode 100644 index 61dd3e0458c..00000000000 --- a/progs/fp/tri-mul.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "MUL result.color, fragment.color, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-param.c b/progs/fp/tri-param.c deleted file mode 100644 index f3e55af3f1b..00000000000 --- a/progs/fp/tri-param.c +++ /dev/null @@ -1,114 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "MOV result.color, program.local[32]; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 32, 0.25, .5, 0.25, 1); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.0, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 32, 0.25, 0, 0.25, 1); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, 0.0, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB | GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-position.c b/progs/fp/tri-position.c deleted file mode 100644 index 18e8182a684..00000000000 --- a/progs/fp/tri-position.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "MUL result.color, fragment.position, {.005}.x; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-pow.c b/progs/fp/tri-pow.c deleted file mode 100644 index ef91e43e997..00000000000 --- a/progs/fp/tri-pow.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "POW result.color, fragment.color.x, fragment.color.y; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-rcp.c b/progs/fp/tri-rcp.c deleted file mode 100644 index e2a27049343..00000000000 --- a/progs/fp/tri-rcp.c +++ /dev/null @@ -1,110 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "ADD R0, fragment.color.x, fragment.color.x; \n" - "RCP result.color, R0.x; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-rsq.c b/progs/fp/tri-rsq.c deleted file mode 100644 index c5b2c1b32e8..00000000000 --- a/progs/fp/tri-rsq.c +++ /dev/null @@ -1,110 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "MUL R0, fragment.color, {3.0}.x; \n" - "RSQ result.color, R0.x; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-scs.c b/progs/fp/tri-scs.c deleted file mode 100644 index ce7c0062c33..00000000000 --- a/progs/fp/tri-scs.c +++ /dev/null @@ -1,111 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0; \n" - "MUL R0, fragment.color, {3.14}.x; \n" - "SCS result.color, R0.x; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-sge.c b/progs/fp/tri-sge.c deleted file mode 100644 index 6a360ca9328..00000000000 --- a/progs/fp/tri-sge.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "SGE result.color, {0.5}.x, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-sge2.c b/progs/fp/tri-sge2.c deleted file mode 100644 index c4330098ed4..00000000000 --- a/progs/fp/tri-sge2.c +++ /dev/null @@ -1,114 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "TEMP R1;\n" - "SGE R0, fragment.color, fragment.color.yzxw; \n" - "SGE R1, fragment.color, fragment.color.zxyw; \n" - "MUL R0, R0, R1; \n" - "MUL result.color, R0, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-sin.c b/progs/fp/tri-sin.c deleted file mode 100644 index 772903e4b23..00000000000 --- a/progs/fp/tri-sin.c +++ /dev/null @@ -1,114 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0; \n" - "MUL R0, fragment.color, {3.14}.x; \n" - "MOV result.color, {0.0}.x; \n" - "SIN result.color.x, R0.x; \n" - "SIN result.color.y, R0.y; \n" - "SIN result.color.z, R0.z; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-slt.c b/progs/fp/tri-slt.c deleted file mode 100644 index 4148a8def34..00000000000 --- a/progs/fp/tri-slt.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "SLT result.color, {0.5}.x, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-sub.c b/progs/fp/tri-sub.c deleted file mode 100644 index 6faa4145501..00000000000 --- a/progs/fp/tri-sub.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "SUB result.color, fragment.color.yzxw, fragment.color; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-swz.c b/progs/fp/tri-swz.c deleted file mode 100644 index 5f34f7a3222..00000000000 --- a/progs/fp/tri-swz.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "SWZ result.color, fragment.color, 1,x,y,z; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-swz2.c b/progs/fp/tri-swz2.c deleted file mode 100644 index fd76b58f539..00000000000 --- a/progs/fp/tri-swz2.c +++ /dev/null @@ -1,109 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0, R1;\n" - "SWZ result.color, fragment.color, 1, 0, 0, 1; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-tex.c b/progs/fp/tri-tex.c deleted file mode 100644 index 87f63894ce9..00000000000 --- a/progs/fp/tri-tex.c +++ /dev/null @@ -1,130 +0,0 @@ - -#include <assert.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -#include "readtex.c" - - -#define TEXTURE_FILE "../images/girl.rgb" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEX result.color, fragment.color, texture[0], 2D; \n" - "END" - ; - GLuint modulateProg; - GLuint Texture; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - assert(glIsProgramARB(modulateProg)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - /* Load texture */ - glGenTextures(1, &Texture); - glBindTexture(GL_TEXTURE_2D, Texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) { - printf("Error: couldn't load texture image file %s\n", TEXTURE_FILE); - exit(1); - } - /* XXX this enable shouldn't really be needed!!! */ - glEnable(GL_TEXTURE_2D); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); -/* glTexCoord2f(1, 0); */ - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); -/* glTexCoord2f(1, 1); */ - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); -/* glTexCoord2f(0, .5); */ - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/fp/tri-xpd.c b/progs/fp/tri-xpd.c deleted file mode 100644 index 9aca46b2faa..00000000000 --- a/progs/fp/tri-xpd.c +++ /dev/null @@ -1,108 +0,0 @@ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include "GL/gl.h" - - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "XPD result.color, fragment.color, {2,2,2,0}; \n" - "END" - ; - GLuint modulateProg; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - glClearColor(.3, .3, .3, 0); -} - -static void Reshape(int width, int height) -{ - - glViewport(0, 0, (GLint)width, (GLint)height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode(GL_MODELVIEW); -} - -static void Key(unsigned char key, int x, int y) -{ - - switch (key) { - case 27: - exit(1); - default: - return; - } - - glutPostRedisplay(); -} - -static void Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glColor3f(0,0,1); - glVertex3f( 0.9, -0.9, -30.0); - glColor3f(1,0,0); - glVertex3f( 0.9, 0.9, -30.0); - glColor3f(0,1,0); - glVertex3f(-0.9, 0.0, -30.0); - glEnd(); - - glFlush(); - - -} - - -int main(int argc, char **argv) -{ - GLenum type; - - glutInit(&argc, argv); - - - glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250); - - type = GLUT_RGB; - type |= GLUT_SINGLE; - glutInitDisplayMode(type); - - if (glutCreateWindow("First Tri") == GL_FALSE) { - exit(1); - } - - Init(); - - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - glutMainLoop(); - return 0; -} diff --git a/progs/ggi/blah b/progs/ggi/blah deleted file mode 100644 index 2c1664d7d05..00000000000 --- a/progs/ggi/blah +++ /dev/null @@ -1,2 +0,0 @@ -Terminating on signal 11 - diff --git a/progs/ggi/blat b/progs/ggi/blat deleted file mode 100644 index 7ff64a9d10d..00000000000 --- a/progs/ggi/blat +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -function foobar() { - echo "foo!" -} - -foobar diff --git a/progs/ggi/box.asc b/progs/ggi/box.asc deleted file mode 100644 index f8b23fd85af..00000000000 --- a/progs/ggi/box.asc +++ /dev/null @@ -1,66 +0,0 @@ -Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216 - -Named object: "Object01" -Tri-mesh, Vertices: 8 Faces: 12 -Vertex list: -Vertex 0: X: -20 Y: -19.999998 Z: 20.000002 -Vertex 1: X: 20 Y: -19.999998 Z: 20.000002 -Vertex 2: X: 20 Y: 20.000002 Z: 19.999998 -Vertex 3: X: -20 Y: 20.000002 Z: 19.999998 -Vertex 4: X: -20 Y: -20.000002 Z: -19.999998 -Vertex 5: X: 20 Y: -20.000002 Z: -19.999998 -Vertex 6: X: 20 Y: 19.999998 Z: -20.000002 -Vertex 7: X: -20 Y: 19.999998 Z: -20.000002 -Face list: -Face 0: A:0 B:1 C:2 AB:1 BC:1 CA:0 -Smoothing: 1 -Face 1: A:0 B:2 C:3 AB:0 BC:1 CA:1 -Smoothing: 1 -Face 2: A:0 B:4 C:5 AB:1 BC:1 CA:0 -Smoothing: 2 -Face 3: A:0 B:5 C:1 AB:0 BC:1 CA:1 -Smoothing: 2 -Face 4: A:1 B:5 C:6 AB:1 BC:1 CA:0 -Smoothing: 3 -Face 5: A:1 B:6 C:2 AB:0 BC:1 CA:1 -Smoothing: 3 -Face 6: A:2 B:6 C:7 AB:1 BC:1 CA:0 -Smoothing: 4 -Face 7: A:2 B:7 C:3 AB:0 BC:1 CA:1 -Smoothing: 4 -Face 8: A:3 B:7 C:4 AB:1 BC:1 CA:0 -Smoothing: 5 -Face 9: A:3 B:4 C:0 AB:0 BC:1 CA:1 -Smoothing: 5 -Face 10: A:4 B:7 C:6 AB:1 BC:1 CA:0 -Smoothing: 6 -Face 11: A:4 B:6 C:5 AB:0 BC:1 CA:1 -Smoothing: 6 - - - - - - - - - - - - - - - - - - - - - - - - - Page 1 - - - diff --git a/progs/ggi/cone.asc b/progs/ggi/cone.asc deleted file mode 100644 index 5c522859963..00000000000 --- a/progs/ggi/cone.asc +++ /dev/null @@ -1,198 +0,0 @@ -Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216 - -Named object: "Object01" -Tri-mesh, Vertices: 34 Faces: 64 -Vertex list: -Vertex 0: X: 60.167416 Y: -87.419525 Z: -53.3088 -Vertex 1: X: 76.70787 Y: -87.419518 Z: -29.84565 -Vertex 2: X: 83.0103 Y: -87.419518 Z: -1.838764 -Vertex 3: X: 78.115204 Y: -87.419518 Z: 26.448057 -Vertex 4: X: 62.767834 Y: -87.41951 Z: 50.708401 -Vertex 5: X: 39.304672 Y: -87.41951 Z: 67.248848 -Vertex 6: X: 11.297782 Y: -87.41951 Z: 73.551254 -Vertex 7: X: -16.989004 Y: -87.41951 Z: 68.656158 -Vertex 8: X: -41.249344 Y: -87.41951 Z: 53.308777 -Vertex 9: X: -57.789783 Y: -87.419518 Z: 29.845612 -Vertex 10: X: -64.092194 Y: -87.419518 Z: 1.838721 -Vertex 11: X: -59.197079 Y: -87.419518 Z: -26.448097 -Vertex 12: X: -43.849678 Y: -87.419525 Z: -50.708427 -Vertex 13: X: -20.386503 Y: -87.419525 Z: -67.248856 -Vertex 14: X: 7.62039 Y: -87.419525 Z: -73.551239 -Vertex 15: X: 35.907204 Y: -87.419525 Z: -68.656105 -Vertex 16: X: 101.684875 Y: 94.590591 Z: -96.955391 -Vertex 17: X: 131.767838 Y: 94.590591 Z: -54.281792 -Vertex 18: X: 143.230377 Y: 94.590599 Z: -3.344275 -Vertex 19: X: 134.327423 Y: 94.590607 Z: 48.102379 -Vertex 20: X: 106.414383 Y: 94.590607 Z: 92.225876 -Vertex 21: X: 63.740765 Y: 94.590607 Z: 122.3088 -Vertex 22: X: 12.803238 Y: 94.590614 Z: 133.771301 -Vertex 23: X: -38.643349 Y: 94.590607 Z: 124.868355 -Vertex 24: X: -82.766846 Y: 94.590607 Z: 96.955307 -Vertex 25: X: -112.849762 Y: 94.590607 Z: 54.281677 -Vertex 26: X: -124.312256 Y: 94.590599 Z: 3.344152 -Vertex 27: X: -115.409271 Y: 94.590591 Z: -48.102493 -Vertex 28: X: -87.496201 Y: 94.590591 Z: -92.225967 -Vertex 29: X: -44.822552 Y: 94.590591 Z: -122.308861 -Vertex 30: X: 6.114983 Y: 94.590584 Z: -133.771332 -Vertex 31: X: 57.561623 Y: 94.590591 Z: -124.868301 -Vertex 32: X: 9.459057 Y: -87.419518 Z: 0.000008 -Vertex 33: X: 9.459057 Y: 94.590599 Z: -0.000008 -Face list: -Face 0: A:0 B:1 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 1: A:1 B:2 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 2: A:2 B:3 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 3: A:3 B:4 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 4: A:4 B:5 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 5: A:5 B:6 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 6: A:6 B:7 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 7: A:7 B:8 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 8: A:8 B:9 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 9: A:9 B:10 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 10: A:10 B:11 C:32 AB:1 BC:0 CA:0 - - Page 1 - - - -Smoothing: 1 -Face 11: A:11 B:12 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 12: A:12 B:13 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 13: A:13 B:14 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 14: A:14 B:15 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 15: A:15 B:0 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 16: A:0 B:16 C:17 AB:1 BC:1 CA:0 -Smoothing: 2 -Face 17: A:0 B:17 C:1 AB:0 BC:1 CA:1 -Smoothing: 2 -Face 18: A:1 B:17 C:18 AB:1 BC:1 CA:0 -Smoothing: 3 -Face 19: A:1 B:18 C:2 AB:0 BC:1 CA:1 -Smoothing: 3 -Face 20: A:2 B:18 C:19 AB:1 BC:1 CA:0 -Smoothing: 4 -Face 21: A:2 B:19 C:3 AB:0 BC:1 CA:1 -Smoothing: 4 -Face 22: A:3 B:19 C:20 AB:1 BC:1 CA:0 -Smoothing: 5 -Face 23: A:3 B:20 C:4 AB:0 BC:1 CA:1 -Smoothing: 5 -Face 24: A:4 B:20 C:21 AB:1 BC:1 CA:0 -Smoothing: 6 -Face 25: A:4 B:21 C:5 AB:0 BC:1 CA:1 -Smoothing: 6 -Face 26: A:5 B:21 C:22 AB:1 BC:1 CA:0 -Smoothing: 7 -Face 27: A:5 B:22 C:6 AB:0 BC:1 CA:1 -Smoothing: 7 -Face 28: A:6 B:22 C:23 AB:1 BC:1 CA:0 -Smoothing: 8 -Face 29: A:6 B:23 C:7 AB:0 BC:1 CA:1 -Smoothing: 8 -Face 30: A:7 B:23 C:24 AB:1 BC:1 CA:0 -Smoothing: 9 -Face 31: A:7 B:24 C:8 AB:0 BC:1 CA:1 -Smoothing: 9 -Face 32: A:8 B:24 C:25 AB:1 BC:1 CA:0 -Smoothing: 10 -Face 33: A:8 B:25 C:9 AB:0 BC:1 CA:1 -Smoothing: 10 -Face 34: A:9 B:25 C:26 AB:1 BC:1 CA:0 -Smoothing: 11 -Face 35: A:9 B:26 C:10 AB:0 BC:1 CA:1 -Smoothing: 11 -Face 36: A:10 B:26 C:27 AB:1 BC:1 CA:0 -Smoothing: 12 -Face 37: A:10 B:27 C:11 AB:0 BC:1 CA:1 -Smoothing: 12 -Face 38: A:11 B:27 C:28 AB:1 BC:1 CA:0 -Smoothing: 13 -Face 39: A:11 B:28 C:12 AB:0 BC:1 CA:1 -Smoothing: 13 -Face 40: A:12 B:28 C:29 AB:1 BC:1 CA:0 -Smoothing: 14 - - Page 2 - - - -Face 41: A:12 B:29 C:13 AB:0 BC:1 CA:1 -Smoothing: 14 -Face 42: A:13 B:29 C:30 AB:1 BC:1 CA:0 -Smoothing: 15 -Face 43: A:13 B:30 C:14 AB:0 BC:1 CA:1 -Smoothing: 15 -Face 44: A:14 B:30 C:31 AB:1 BC:1 CA:0 -Smoothing: 16 -Face 45: A:14 B:31 C:15 AB:0 BC:1 CA:1 -Smoothing: 16 -Face 46: A:15 B:31 C:16 AB:1 BC:1 CA:0 -Smoothing: 17 -Face 47: A:15 B:16 C:0 AB:0 BC:1 CA:1 -Smoothing: 17 -Face 48: A:16 B:33 C:17 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 49: A:17 B:33 C:18 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 50: A:18 B:33 C:19 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 51: A:19 B:33 C:20 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 52: A:20 B:33 C:21 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 53: A:21 B:33 C:22 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 54: A:22 B:33 C:23 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 55: A:23 B:33 C:24 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 56: A:24 B:33 C:25 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 57: A:25 B:33 C:26 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 58: A:26 B:33 C:27 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 59: A:27 B:33 C:28 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 60: A:28 B:33 C:29 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 61: A:29 B:33 C:30 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 62: A:30 B:33 C:31 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 63: A:31 B:33 C:16 AB:0 BC:0 CA:1 -Smoothing: 18 - - - - - - - - - - - - - - - - - Page 3 - - - diff --git a/progs/ggi/sphere.asc b/progs/ggi/sphere.asc deleted file mode 100644 index 1424a740d7b..00000000000 --- a/progs/ggi/sphere.asc +++ /dev/null @@ -1,132 +0,0 @@ -Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216
-
-Named object: "Object01"
-Tri-mesh, Vertices: 20 Faces: 36
-Vertex list:
-Vertex 0: X: -210 Y: -432.781738 Z: 180.000031
-Vertex 1: X: -610.810303 Y: 144.260559 Z: 103.580154
-Vertex 2: X: 56.586655 Y: 144.260544 Z: -128.902023
-Vertex 3: X: -75.776352 Y: 144.260605 Z: 565.321838
-Vertex 4: X: -462.815979 Y: -347.937683 Z: 131.797302
-Vertex 5: X: -616.506042 Y: -126.67173 Z: 102.494209
-Vertex 6: X: -41.847229 Y: -347.937683 Z: -14.843644
-Vertex 7: X: 60.375015 Y: -126.671753 Z: -133.291641
-Vertex 8: X: -125.336807 Y: -347.937653 Z: 423.046448
-Vertex 9: X: -73.868958 Y: -126.671692 Z: 570.797424
-Vertex 10: X: -448.353271 Y: 237.304672 Z: -92.34951
-Vertex 11: X: -192.440964 Y: 237.304672 Z: -181.494431
-Vertex 12: X: 145.038193 Y: 237.304672 Z: 109.754745
-Vertex 13: X: 94.283768 Y: 237.304688 Z: 375.953766
-Vertex 14: X: -326.684937 Y: 237.304733 Z: 522.594727
-Vertex 15: X: -531.842834 Y: 237.304718 Z: 345.540588
-Vertex 16: X: -331.419525 Y: -225.964966 Z: -168.564438
-Vertex 17: X: 152.575485 Y: -225.964935 Z: 249.129868
-Vertex 18: X: -451.155914 Y: -225.964905 Z: 459.434662
-Vertex 19: X: -298.413483 Y: 423.31897 Z: 163.142761
-Face list:
-Face 0: A:0 B:4 C:6 AB:1 BC:1 CA:1
-Face 1: A:4 B:5 C:16 AB:1 BC:1 CA:1
-Face 2: A:4 B:16 C:6 AB:1 BC:1 CA:1
-Face 3: A:6 B:16 C:7 AB:1 BC:1 CA:1
-Face 4: A:5 B:1 C:10 AB:1 BC:1 CA:1
-Face 5: A:5 B:10 C:16 AB:1 BC:1 CA:1
-Face 6: A:16 B:10 C:11 AB:1 BC:1 CA:1
-Face 7: A:16 B:11 C:7 AB:1 BC:1 CA:1
-Face 8: A:7 B:11 C:2 AB:1 BC:1 CA:1
-Face 9: A:0 B:6 C:8 AB:1 BC:1 CA:1
-Face 10: A:6 B:7 C:17 AB:1 BC:1 CA:1
-Face 11: A:6 B:17 C:8 AB:1 BC:1 CA:1
-Face 12: A:8 B:17 C:9 AB:1 BC:1 CA:1
-Face 13: A:7 B:2 C:12 AB:1 BC:1 CA:1
-Face 14: A:7 B:12 C:17 AB:1 BC:1 CA:1
-Face 15: A:17 B:12 C:13 AB:1 BC:1 CA:1
-Face 16: A:17 B:13 C:9 AB:1 BC:1 CA:1
-Face 17: A:9 B:13 C:3 AB:1 BC:1 CA:1
-Face 18: A:0 B:8 C:4 AB:1 BC:1 CA:1
-Face 19: A:8 B:9 C:18 AB:1 BC:1 CA:1
-Face 20: A:8 B:18 C:4 AB:1 BC:1 CA:1
-Face 21: A:4 B:18 C:5 AB:1 BC:1 CA:1
-Face 22: A:9 B:3 C:14 AB:1 BC:1 CA:1
-Face 23: A:9 B:14 C:18 AB:1 BC:1 CA:1
-Face 24: A:18 B:14 C:15 AB:1 BC:1 CA:1
-Face 25: A:18 B:15 C:5 AB:1 BC:1 CA:1
-Face 26: A:5 B:15 C:1 AB:1 BC:1 CA:1
-Face 27: A:1 B:15 C:10 AB:1 BC:1 CA:1
-Face 28: A:15 B:14 C:19 AB:1 BC:1 CA:1
-Face 29: A:15 B:19 C:10 AB:1 BC:1 CA:1
-Face 30: A:10 B:19 C:11 AB:1 BC:1 CA:1
-Face 31: A:14 B:3 C:13 AB:1 BC:1 CA:1
-Face 32: A:14 B:13 C:19 AB:1 BC:1 CA:1
-Face 33: A:19 B:13 C:12 AB:1 BC:1 CA:1
-Face 34: A:19 B:12 C:11 AB:1 BC:1 CA:1
-
- Page 1
-
-
-
-Face 35: A:11 B:12 C:2 AB:1 BC:1 CA:1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 2
-
-
-
diff --git a/progs/ggi/torus.asc b/progs/ggi/torus.asc deleted file mode 100644 index 6bd41f40337..00000000000 --- a/progs/ggi/torus.asc +++ /dev/null @@ -1,264 +0,0 @@ -Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216
-
-Named object: "Object01"
-Tri-mesh, Vertices: 40 Faces: 80
-Vertex list:
-Vertex 0: X: -50.170624 Y: -0.000026 Z: -240.147842
-Vertex 1: X: -80.584503 Y: -63.958851 Z: -205.014572
-Vertex 2: X: -129.795166 Y: -39.528744 Z: -148.16774
-Vertex 3: X: -129.795166 Y: 39.528721 Z: -148.16774
-Vertex 4: X: -80.584503 Y: 63.958797 Z: -205.014572
-Vertex 5: X: 85.963654 Y: -0.000002 Z: 31.490465
-Vertex 6: X: 39.614838 Y: -63.958828 Z: 34.827602
-Vertex 7: X: -35.37915 Y: -39.528728 Z: 40.227196
-Vertex 8: X: -35.37912 Y: 39.528736 Z: 40.227188
-Vertex 9: X: 39.614838 Y: 63.95882 Z: 34.827595
-Vertex 10: X: -9.852051 Y: 0.000023 Z: 319.829254
-Vertex 11: X: -44.985352 Y: -63.958805 Z: 289.415405
-Vertex 12: X: -101.832199 Y: -39.528709 Z: 240.204758
-Vertex 13: X: -101.832184 Y: 39.528755 Z: 240.204773
-Vertex 14: X: -44.985352 Y: 63.958843 Z: 289.415405
-Vertex 15: X: -281.490326 Y: 0.000035 Z: 455.963654
-Vertex 16: X: -284.827484 Y: -63.958794 Z: 409.614868
-Vertex 17: X: -290.227112 Y: -39.528702 Z: 334.62085
-Vertex 18: X: -290.227112 Y: 39.528763 Z: 334.62088
-Vertex 19: X: -284.827484 Y: 63.958855 Z: 409.614838
-Vertex 20: X: -569.829163 Y: 0.000026 Z: 360.14798
-Vertex 21: X: -539.415344 Y: -63.958801 Z: 325.014709
-Vertex 22: X: -490.204712 Y: -39.528709 Z: 268.167847
-Vertex 23: X: -490.204712 Y: 39.528755 Z: 268.167847
-Vertex 24: X: -539.415344 Y: 63.958847 Z: 325.014679
-Vertex 25: X: -705.963684 Y: 0.000002 Z: 88.509598
-Vertex 26: X: -659.614807 Y: -63.958824 Z: 85.172462
-Vertex 27: X: -584.62085 Y: -39.528725 Z: 79.77285
-Vertex 28: X: -584.62085 Y: 39.52874 Z: 79.77285
-Vertex 29: X: -659.614868 Y: 63.958824 Z: 85.172447
-Vertex 30: X: -610.147827 Y: -0.000023 Z: -199.829361
-Vertex 31: X: -575.014587 Y: -63.958847 Z: -169.415497
-Vertex 32: X: -518.167725 Y: -39.528744 Z: -120.204819
-Vertex 33: X: -518.167725 Y: 39.528721 Z: -120.204834
-Vertex 34: X: -575.014587 Y: 63.958801 Z: -169.415497
-Vertex 35: X: -338.509338 Y: -0.000035 Z: -335.963745
-Vertex 36: X: -335.172241 Y: -63.958858 Z: -289.614868
-Vertex 37: X: -329.772675 Y: -39.528751 Z: -214.620865
-Vertex 38: X: -329.772675 Y: 39.528713 Z: -214.620865
-Vertex 39: X: -335.172241 Y: 63.95879 Z: -289.614899
-Face list:
-Face 0: A:0 B:6 C:1 AB:0 BC:1 CA:1
-Smoothing: 1
-Face 1: A:0 B:5 C:6 AB:1 BC:1 CA:0
-Smoothing: 1
-Face 2: A:1 B:7 C:2 AB:0 BC:1 CA:1
-Smoothing: 2
-Face 3: A:1 B:6 C:7 AB:1 BC:1 CA:0
-Smoothing: 2
-Face 4: A:2 B:8 C:3 AB:0 BC:1 CA:1
-Smoothing: 3
-Face 5: A:2 B:7 C:8 AB:1 BC:1 CA:0
-Smoothing: 3
-Face 6: A:3 B:9 C:4 AB:0 BC:1 CA:1
-Smoothing: 4
-Face 7: A:3 B:8 C:9 AB:1 BC:1 CA:0
-
- Page 1
-
-
-
-Smoothing: 4
-Face 8: A:4 B:5 C:0 AB:0 BC:1 CA:1
-Smoothing: 5
-Face 9: A:4 B:9 C:5 AB:1 BC:1 CA:0
-Smoothing: 5
-Face 10: A:5 B:11 C:6 AB:0 BC:1 CA:1
-Smoothing: 6
-Face 11: A:5 B:10 C:11 AB:1 BC:1 CA:0
-Smoothing: 6
-Face 12: A:6 B:12 C:7 AB:0 BC:1 CA:1
-Smoothing: 7
-Face 13: A:6 B:11 C:12 AB:1 BC:1 CA:0
-Smoothing: 7
-Face 14: A:7 B:13 C:8 AB:0 BC:1 CA:1
-Smoothing: 8
-Face 15: A:7 B:12 C:13 AB:1 BC:1 CA:0
-Smoothing: 8
-Face 16: A:8 B:14 C:9 AB:0 BC:1 CA:1
-Smoothing: 9
-Face 17: A:8 B:13 C:14 AB:1 BC:1 CA:0
-Smoothing: 9
-Face 18: A:9 B:10 C:5 AB:0 BC:1 CA:1
-Smoothing: 10
-Face 19: A:9 B:14 C:10 AB:1 BC:1 CA:0
-Smoothing: 10
-Face 20: A:10 B:16 C:11 AB:0 BC:1 CA:1
-Smoothing: 11
-Face 21: A:10 B:15 C:16 AB:1 BC:1 CA:0
-Smoothing: 11
-Face 22: A:11 B:17 C:12 AB:0 BC:1 CA:1
-Smoothing: 12
-Face 23: A:11 B:16 C:17 AB:1 BC:1 CA:0
-Smoothing: 12
-Face 24: A:12 B:18 C:13 AB:0 BC:1 CA:1
-Smoothing: 13
-Face 25: A:12 B:17 C:18 AB:1 BC:1 CA:0
-Smoothing: 13
-Face 26: A:13 B:19 C:14 AB:0 BC:1 CA:1
-Smoothing: 14
-Face 27: A:13 B:18 C:19 AB:1 BC:1 CA:0
-Smoothing: 14
-Face 28: A:14 B:15 C:10 AB:0 BC:1 CA:1
-Smoothing: 15
-Face 29: A:14 B:19 C:15 AB:1 BC:1 CA:0
-Smoothing: 15
-Face 30: A:15 B:21 C:16 AB:0 BC:1 CA:1
-Smoothing: 16
-Face 31: A:15 B:20 C:21 AB:1 BC:1 CA:0
-Smoothing: 16
-Face 32: A:16 B:22 C:17 AB:0 BC:1 CA:1
-Smoothing: 17
-Face 33: A:16 B:21 C:22 AB:1 BC:1 CA:0
-Smoothing: 17
-Face 34: A:17 B:23 C:18 AB:0 BC:1 CA:1
-Smoothing: 18
-Face 35: A:17 B:22 C:23 AB:1 BC:1 CA:0
-Smoothing: 18
-Face 36: A:18 B:24 C:19 AB:0 BC:1 CA:1
-Smoothing: 19
-Face 37: A:18 B:23 C:24 AB:1 BC:1 CA:0
-Smoothing: 19
-
- Page 2
-
-
-
-Face 38: A:19 B:20 C:15 AB:0 BC:1 CA:1
-Smoothing: 20
-Face 39: A:19 B:24 C:20 AB:1 BC:1 CA:0
-Smoothing: 20
-Face 40: A:20 B:26 C:21 AB:0 BC:1 CA:1
-Smoothing: 21
-Face 41: A:20 B:25 C:26 AB:1 BC:1 CA:0
-Smoothing: 21
-Face 42: A:21 B:27 C:22 AB:0 BC:1 CA:1
-Smoothing: 22
-Face 43: A:21 B:26 C:27 AB:1 BC:1 CA:0
-Smoothing: 22
-Face 44: A:22 B:28 C:23 AB:0 BC:1 CA:1
-Smoothing: 23
-Face 45: A:22 B:27 C:28 AB:1 BC:1 CA:0
-Smoothing: 23
-Face 46: A:23 B:29 C:24 AB:0 BC:1 CA:1
-Smoothing: 24
-Face 47: A:23 B:28 C:29 AB:1 BC:1 CA:0
-Smoothing: 24
-Face 48: A:24 B:25 C:20 AB:0 BC:1 CA:1
-Smoothing: 25
-Face 49: A:24 B:29 C:25 AB:1 BC:1 CA:0
-Smoothing: 25
-Face 50: A:25 B:31 C:26 AB:0 BC:1 CA:1
-Smoothing: 26
-Face 51: A:25 B:30 C:31 AB:1 BC:1 CA:0
-Smoothing: 26
-Face 52: A:26 B:32 C:27 AB:0 BC:1 CA:1
-Smoothing: 27
-Face 53: A:26 B:31 C:32 AB:1 BC:1 CA:0
-Smoothing: 27
-Face 54: A:27 B:33 C:28 AB:0 BC:1 CA:1
-Smoothing: 28
-Face 55: A:27 B:32 C:33 AB:1 BC:1 CA:0
-Smoothing: 28
-Face 56: A:28 B:34 C:29 AB:0 BC:1 CA:1
-Smoothing: 29
-Face 57: A:28 B:33 C:34 AB:1 BC:1 CA:0
-Smoothing: 29
-Face 58: A:29 B:30 C:25 AB:0 BC:1 CA:1
-Smoothing: 30
-Face 59: A:29 B:34 C:30 AB:1 BC:1 CA:0
-Smoothing: 30
-Face 60: A:30 B:36 C:31 AB:0 BC:1 CA:1
-Smoothing: 31
-Face 61: A:30 B:35 C:36 AB:1 BC:1 CA:0
-Smoothing: 31
-Face 62: A:31 B:37 C:32 AB:0 BC:1 CA:1
-Smoothing: 32
-Face 63: A:31 B:36 C:37 AB:1 BC:1 CA:0
-Smoothing: 32
-Face 64: A:32 B:38 C:33 AB:0 BC:1 CA:1
-Smoothing: 1
-Face 65: A:32 B:37 C:38 AB:1 BC:1 CA:0
-Smoothing: 1
-Face 66: A:33 B:39 C:34 AB:0 BC:1 CA:1
-Smoothing: 2
-Face 67: A:33 B:38 C:39 AB:1 BC:1 CA:0
-Smoothing: 2
-Face 68: A:34 B:35 C:30 AB:0 BC:1 CA:1
-
- Page 3
-
-
-
-Smoothing: 3
-Face 69: A:34 B:39 C:35 AB:1 BC:1 CA:0
-Smoothing: 3
-Face 70: A:35 B:1 C:36 AB:0 BC:1 CA:1
-Smoothing: 4
-Face 71: A:35 B:0 C:1 AB:1 BC:1 CA:0
-Smoothing: 4
-Face 72: A:36 B:2 C:37 AB:0 BC:1 CA:1
-Smoothing: 5
-Face 73: A:36 B:1 C:2 AB:1 BC:1 CA:0
-Smoothing: 5
-Face 74: A:37 B:3 C:38 AB:0 BC:1 CA:1
-Smoothing: 6
-Face 75: A:37 B:2 C:3 AB:1 BC:1 CA:0
-Smoothing: 6
-Face 76: A:38 B:4 C:39 AB:0 BC:1 CA:1
-Smoothing: 7
-Face 77: A:38 B:3 C:4 AB:1 BC:1 CA:0
-Smoothing: 7
-Face 78: A:39 B:0 C:35 AB:0 BC:1 CA:1
-Smoothing: 8
-Face 79: A:39 B:4 C:0 AB:1 BC:1 CA:0
-Smoothing: 8
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 4
-
-
-
diff --git a/progs/ggi/tube.asc b/progs/ggi/tube.asc deleted file mode 100644 index 0b5dd0d810b..00000000000 --- a/progs/ggi/tube.asc +++ /dev/null @@ -1,396 +0,0 @@ -Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216 - -Named object: "Object01" -Tri-mesh, Vertices: 64 Faces: 128 -Vertex list: -Vertex 0: X: 61.483898 Y: 37.836231 Z: -70.94294 -Vertex 1: X: 82.867447 Y: 37.836235 Z: -41.288902 -Vertex 2: X: 91.275154 Y: 37.836239 Z: -5.70901 -Vertex 3: X: 85.427025 Y: 37.836243 Z: 30.380013 -Vertex 4: X: 66.213379 Y: 37.836243 Z: 61.483936 -Vertex 5: X: 36.559322 Y: 37.836246 Z: 82.86747 -Vertex 6: X: 0.979424 Y: 37.836246 Z: 91.275154 -Vertex 7: X: -35.109554 Y: 37.836246 Z: 85.42701 -Vertex 8: X: -66.213478 Y: 37.836246 Z: 66.213356 -Vertex 9: X: -87.597 Y: 37.836243 Z: 36.559303 -Vertex 10: X: -96.004677 Y: 37.836239 Z: 0.979406 -Vertex 11: X: -90.156517 Y: 37.836235 Z: -35.109615 -Vertex 12: X: -70.942848 Y: 37.836235 Z: -66.213516 -Vertex 13: X: -41.288776 Y: 37.836231 Z: -87.597023 -Vertex 14: X: -5.708872 Y: 37.836231 Z: -96.004692 -Vertex 15: X: 30.380142 Y: 37.836231 Z: -90.156502 -Vertex 16: X: 61.483898 Y: -38.14529 Z: -70.942932 -Vertex 17: X: 82.867447 Y: -38.145287 Z: -41.288895 -Vertex 18: X: 91.275154 Y: -38.145283 Z: -5.709003 -Vertex 19: X: 85.427025 Y: -38.145279 Z: 30.38002 -Vertex 20: X: 66.213379 Y: -38.145279 Z: 61.483944 -Vertex 21: X: 36.559322 Y: -38.145275 Z: 82.867477 -Vertex 22: X: 0.979424 Y: -38.145275 Z: 91.275162 -Vertex 23: X: -35.109554 Y: -38.145275 Z: 85.427017 -Vertex 24: X: -66.213478 Y: -38.145275 Z: 66.213364 -Vertex 25: X: -87.597 Y: -38.145279 Z: 36.559311 -Vertex 26: X: -96.004677 Y: -38.145283 Z: 0.979412 -Vertex 27: X: -90.156517 Y: -38.145287 Z: -35.109608 -Vertex 28: X: -70.942848 Y: -38.145287 Z: -66.213516 -Vertex 29: X: -41.288776 Y: -38.14529 Z: -87.597015 -Vertex 30: X: -5.708872 Y: -38.14529 Z: -96.004684 -Vertex 31: X: 30.380142 Y: -38.14529 Z: -90.156494 -Vertex 32: X: 29.53923 Y: 37.836235 Z: -36.632011 -Vertex 33: X: 40.224194 Y: 37.836239 Z: -21.814436 -Vertex 34: X: 44.425369 Y: 37.836239 Z: -4.035822 -Vertex 35: X: 41.503166 Y: 37.836239 Z: 13.997195 -Vertex 36: X: 31.902466 Y: 37.836243 Z: 29.539249 -Vertex 37: X: 17.084883 Y: 37.836243 Z: 40.224201 -Vertex 38: X: -0.693734 Y: 37.836243 Z: 44.425365 -Vertex 39: X: -18.726728 Y: 37.836243 Z: 41.503159 -Vertex 40: X: -34.26878 Y: 37.836243 Z: 31.902454 -Vertex 41: X: -44.953732 Y: 37.836239 Z: 17.084871 -Vertex 42: X: -49.154892 Y: 37.836239 Z: -0.693745 -Vertex 43: X: -46.232677 Y: 37.836239 Z: -18.726759 -Vertex 44: X: -36.631962 Y: 37.836235 Z: -34.268806 -Vertex 45: X: -21.814371 Y: 37.836235 Z: -44.953747 -Vertex 46: X: -4.035751 Y: 37.836235 Z: -49.1549 -Vertex 47: X: 13.997261 Y: 37.836235 Z: -46.23267 -Vertex 48: X: 29.53923 Y: -38.145287 Z: -36.632004 -Vertex 49: X: 40.224194 Y: -38.145283 Z: -21.814428 -Vertex 50: X: 44.425369 Y: -38.145283 Z: -4.035816 -Vertex 51: X: 41.503166 Y: -38.145283 Z: 13.997201 -Vertex 52: X: 31.902466 Y: -38.145279 Z: 29.539257 -Vertex 53: X: 17.084883 Y: -38.145279 Z: 40.224209 -Vertex 54: X: -0.693734 Y: -38.145279 Z: 44.425373 -Vertex 55: X: -18.726728 Y: -38.145279 Z: 41.503166 - - Page 1 - - - -Vertex 56: X: -34.26878 Y: -38.145279 Z: 31.902462 -Vertex 57: X: -44.953732 Y: -38.145283 Z: 17.084879 -Vertex 58: X: -49.154892 Y: -38.145283 Z: -0.693738 -Vertex 59: X: -46.232677 Y: -38.145283 Z: -18.726751 -Vertex 60: X: -36.631962 Y: -38.145287 Z: -34.268799 -Vertex 61: X: -21.814371 Y: -38.145287 Z: -44.953739 -Vertex 62: X: -4.035751 Y: -38.145287 Z: -49.154892 -Vertex 63: X: 13.997261 Y: -38.145287 Z: -46.232662 -Face list: -Face 0: A:0 B:1 C:17 AB:1 BC:1 CA:0 -Smoothing: 1 -Face 1: A:0 B:17 C:16 AB:0 BC:1 CA:1 -Smoothing: 1 -Face 2: A:1 B:2 C:18 AB:1 BC:1 CA:0 -Smoothing: 2 -Face 3: A:1 B:18 C:17 AB:0 BC:1 CA:1 -Smoothing: 2 -Face 4: A:2 B:3 C:19 AB:1 BC:1 CA:0 -Smoothing: 3 -Face 5: A:2 B:19 C:18 AB:0 BC:1 CA:1 -Smoothing: 3 -Face 6: A:3 B:4 C:20 AB:1 BC:1 CA:0 -Smoothing: 4 -Face 7: A:3 B:20 C:19 AB:0 BC:1 CA:1 -Smoothing: 4 -Face 8: A:4 B:5 C:21 AB:1 BC:1 CA:0 -Smoothing: 5 -Face 9: A:4 B:21 C:20 AB:0 BC:1 CA:1 -Smoothing: 5 -Face 10: A:5 B:6 C:22 AB:1 BC:1 CA:0 -Smoothing: 6 -Face 11: A:5 B:22 C:21 AB:0 BC:1 CA:1 -Smoothing: 6 -Face 12: A:6 B:7 C:23 AB:1 BC:1 CA:0 -Smoothing: 7 -Face 13: A:6 B:23 C:22 AB:0 BC:1 CA:1 -Smoothing: 7 -Face 14: A:7 B:8 C:24 AB:1 BC:1 CA:0 -Smoothing: 8 -Face 15: A:7 B:24 C:23 AB:0 BC:1 CA:1 -Smoothing: 8 -Face 16: A:8 B:9 C:25 AB:1 BC:1 CA:0 -Smoothing: 9 -Face 17: A:8 B:25 C:24 AB:0 BC:1 CA:1 -Smoothing: 9 -Face 18: A:9 B:10 C:26 AB:1 BC:1 CA:0 -Smoothing: 10 -Face 19: A:9 B:26 C:25 AB:0 BC:1 CA:1 -Smoothing: 10 -Face 20: A:10 B:11 C:27 AB:1 BC:1 CA:0 -Smoothing: 11 -Face 21: A:10 B:27 C:26 AB:0 BC:1 CA:1 -Smoothing: 11 -Face 22: A:11 B:12 C:28 AB:1 BC:1 CA:0 -Smoothing: 12 -Face 23: A:11 B:28 C:27 AB:0 BC:1 CA:1 -Smoothing: 12 -Face 24: A:12 B:13 C:29 AB:1 BC:1 CA:0 -Smoothing: 13 -Face 25: A:12 B:29 C:28 AB:0 BC:1 CA:1 -Smoothing: 13 - - Page 2 - - - -Face 26: A:13 B:14 C:30 AB:1 BC:1 CA:0 -Smoothing: 14 -Face 27: A:13 B:30 C:29 AB:0 BC:1 CA:1 -Smoothing: 14 -Face 28: A:14 B:15 C:31 AB:1 BC:1 CA:0 -Smoothing: 15 -Face 29: A:14 B:31 C:30 AB:0 BC:1 CA:1 -Smoothing: 15 -Face 30: A:15 B:0 C:16 AB:1 BC:1 CA:0 -Smoothing: 16 -Face 31: A:15 B:16 C:31 AB:0 BC:1 CA:1 -Smoothing: 16 -Face 32: A:32 B:49 C:33 AB:0 BC:1 CA:1 -Smoothing: 17 -Face 33: A:32 B:48 C:49 AB:1 BC:1 CA:0 -Smoothing: 17 -Face 34: A:33 B:50 C:34 AB:0 BC:1 CA:1 -Smoothing: 18 -Face 35: A:33 B:49 C:50 AB:1 BC:1 CA:0 -Smoothing: 18 -Face 36: A:34 B:51 C:35 AB:0 BC:1 CA:1 -Smoothing: 19 -Face 37: A:34 B:50 C:51 AB:1 BC:1 CA:0 -Smoothing: 19 -Face 38: A:35 B:52 C:36 AB:0 BC:1 CA:1 -Smoothing: 20 -Face 39: A:35 B:51 C:52 AB:1 BC:1 CA:0 -Smoothing: 20 -Face 40: A:36 B:53 C:37 AB:0 BC:1 CA:1 -Smoothing: 21 -Face 41: A:36 B:52 C:53 AB:1 BC:1 CA:0 -Smoothing: 21 -Face 42: A:37 B:54 C:38 AB:0 BC:1 CA:1 -Smoothing: 22 -Face 43: A:37 B:53 C:54 AB:1 BC:1 CA:0 -Smoothing: 22 -Face 44: A:38 B:55 C:39 AB:0 BC:1 CA:1 -Smoothing: 23 -Face 45: A:38 B:54 C:55 AB:1 BC:1 CA:0 -Smoothing: 23 -Face 46: A:39 B:56 C:40 AB:0 BC:1 CA:1 -Smoothing: 24 -Face 47: A:39 B:55 C:56 AB:1 BC:1 CA:0 -Smoothing: 24 -Face 48: A:40 B:57 C:41 AB:0 BC:1 CA:1 -Smoothing: 25 -Face 49: A:40 B:56 C:57 AB:1 BC:1 CA:0 -Smoothing: 25 -Face 50: A:41 B:58 C:42 AB:0 BC:1 CA:1 -Smoothing: 26 -Face 51: A:41 B:57 C:58 AB:1 BC:1 CA:0 -Smoothing: 26 -Face 52: A:42 B:59 C:43 AB:0 BC:1 CA:1 -Smoothing: 27 -Face 53: A:42 B:58 C:59 AB:1 BC:1 CA:0 -Smoothing: 27 -Face 54: A:43 B:60 C:44 AB:0 BC:1 CA:1 -Smoothing: 28 -Face 55: A:43 B:59 C:60 AB:1 BC:1 CA:0 -Smoothing: 28 -Face 56: A:44 B:61 C:45 AB:0 BC:1 CA:1 - - Page 3 - - - -Smoothing: 29 -Face 57: A:44 B:60 C:61 AB:1 BC:1 CA:0 -Smoothing: 29 -Face 58: A:45 B:62 C:46 AB:0 BC:1 CA:1 -Smoothing: 30 -Face 59: A:45 B:61 C:62 AB:1 BC:1 CA:0 -Smoothing: 30 -Face 60: A:46 B:63 C:47 AB:0 BC:1 CA:1 -Smoothing: 31 -Face 61: A:46 B:62 C:63 AB:1 BC:1 CA:0 -Smoothing: 31 -Face 62: A:47 B:48 C:32 AB:0 BC:1 CA:1 -Smoothing: 32 -Face 63: A:47 B:63 C:48 AB:1 BC:1 CA:0 -Smoothing: 32 -Face 64: A:0 B:32 C:33 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 65: A:0 B:33 C:1 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 66: A:1 B:33 C:34 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 67: A:1 B:34 C:2 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 68: A:2 B:34 C:35 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 69: A:2 B:35 C:3 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 70: A:3 B:35 C:36 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 71: A:3 B:36 C:4 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 72: A:4 B:36 C:37 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 73: A:4 B:37 C:5 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 74: A:5 B:37 C:38 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 75: A:5 B:38 C:6 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 76: A:6 B:38 C:39 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 77: A:6 B:39 C:7 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 78: A:7 B:39 C:40 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 79: A:7 B:40 C:8 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 80: A:8 B:40 C:41 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 81: A:8 B:41 C:9 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 82: A:9 B:41 C:42 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 83: A:9 B:42 C:10 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 84: A:10 B:42 C:43 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 85: A:10 B:43 C:11 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 86: A:11 B:43 C:44 AB:0 BC:1 CA:0 -Smoothing: 1 - - Page 4 - - - -Face 87: A:11 B:44 C:12 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 88: A:12 B:44 C:45 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 89: A:12 B:45 C:13 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 90: A:13 B:45 C:46 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 91: A:13 B:46 C:14 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 92: A:14 B:46 C:47 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 93: A:14 B:47 C:15 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 94: A:15 B:47 C:32 AB:0 BC:1 CA:0 -Smoothing: 1 -Face 95: A:15 B:32 C:0 AB:0 BC:0 CA:1 -Smoothing: 1 -Face 96: A:16 B:17 C:49 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 97: A:16 B:49 C:48 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 98: A:17 B:18 C:50 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 99: A:17 B:50 C:49 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 100: A:18 B:19 C:51 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 101: A:18 B:51 C:50 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 102: A:19 B:20 C:52 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 103: A:19 B:52 C:51 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 104: A:20 B:21 C:53 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 105: A:20 B:53 C:52 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 106: A:21 B:22 C:54 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 107: A:21 B:54 C:53 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 108: A:22 B:23 C:55 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 109: A:22 B:55 C:54 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 110: A:23 B:24 C:56 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 111: A:23 B:56 C:55 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 112: A:24 B:25 C:57 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 113: A:24 B:57 C:56 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 114: A:25 B:26 C:58 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 115: A:25 B:58 C:57 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 116: A:26 B:27 C:59 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 117: A:26 B:59 C:58 AB:0 BC:1 CA:0 - - Page 5 - - - -Smoothing: 2 -Face 118: A:27 B:28 C:60 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 119: A:27 B:60 C:59 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 120: A:28 B:29 C:61 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 121: A:28 B:61 C:60 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 122: A:29 B:30 C:62 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 123: A:29 B:62 C:61 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 124: A:30 B:31 C:63 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 125: A:30 B:63 C:62 AB:0 BC:1 CA:0 -Smoothing: 2 -Face 126: A:31 B:16 C:48 AB:1 BC:0 CA:0 -Smoothing: 2 -Face 127: A:31 B:48 C:63 AB:0 BC:1 CA:0 -Smoothing: 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 6 - - - diff --git a/progs/miniglx/Makefile b/progs/miniglx/Makefile deleted file mode 100644 index 7f1e162186f..00000000000 --- a/progs/miniglx/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -# Makefile for miniglx demo programs - -TOP = ../.. - -include $(TOP)/configs/current - - -SOURCES = miniglxtest.c \ - miniglxsample.c \ - sample_server.c \ - sample_server2.c \ - manytex.c \ - texline.c - -OBJECTS = $(SOURCES:.c=.o) - -PROGS = $(SOURCES:%.c=%) - -INCLUDES = \ - -I. \ - -I$(TOP)/include - - -##### RULES ##### - -.SUFFIXES: -.SUFFIXES: .c - -.c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ - - -##### TARGETS ##### - -default: depend $(PROGS) - -clean: - rm -f $(PROGS) - rm -f *.o - - -depend: $(SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -include depend diff --git a/progs/miniglx/glfbdevtest.c b/progs/miniglx/glfbdevtest.c deleted file mode 100644 index 8dbf0df461b..00000000000 --- a/progs/miniglx/glfbdevtest.c +++ /dev/null @@ -1,478 +0,0 @@ -/* $Id: glfbdevtest.c,v 1.1 2003-08-06 17:47:15 keithw Exp $ */ - -/* - * Test the GLFBDev interface. Only tested with radeonfb driver!!!! - */ - - -#include <assert.h> -#include <errno.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <fcntl.h> -#include <unistd.h> -#include <sys/ioctl.h> -#include <sys/mman.h> -#include <sys/types.h> -#include <linux/fb.h> -#include <linux/kd.h> -#include <linux/vt.h> -#include <GL/glut.h> -#include "GL/glfbdev.h" - -#define DEFAULT_DEPTH 8 - -static struct fb_fix_screeninfo FixedInfo; -static struct fb_var_screeninfo VarInfo, OrigVarInfo; -static int DesiredDepth = 0; -static int OriginalVT = -1; -static int ConsoleFD = -1; -static int FrameBufferFD = -1; -static caddr_t FrameBuffer = (caddr_t) -1; -static caddr_t MMIOAddress = (caddr_t) -1; - - -static void -print_fixed_info(const struct fb_fix_screeninfo *fixed, const char *s) -{ - static const char *visuals[] = { - "MONO01", "MONO10", "TRUECOLOR", "PSEUDOCOLOR", - "DIRECTCOLOR", "STATIC_PSEUDOCOLOR" - }; - - printf("%s info -----------------------\n", s); - printf("id = %16s\n", fixed->id); - printf("smem_start = 0x%x\n", fixed->smem_start); - printf("smem_len = %d (0x%x)\n", fixed->smem_len, fixed->smem_len); - printf("type = 0x%x\n", fixed->type); - printf("type_aux = 0x%x\n", fixed->type_aux); - printf("visual = 0x%x (%s)\n", fixed->visual, visuals[fixed->visual]); - printf("xpanstep = %d\n", fixed->xpanstep); - printf("ypanstep = %d\n", fixed->ypanstep); - printf("ywrapstep = %d\n", fixed->ywrapstep); - printf("line_length = %d\n", fixed->line_length); - printf("mmio_start = 0x%x\n", fixed->mmio_start); - printf("mmio_len = %d (0x%x)\n", fixed->mmio_len, fixed->mmio_len); - printf("accel = 0x%x\n", fixed->accel); -} - - -static void -print_var_info(const struct fb_var_screeninfo *var, const char *s) -{ - printf("%s info -----------------------\n", s); - printf("xres = %d\n", var->xres); - printf("yres = %d\n", var->yres); - printf("xres_virtual = %d\n", var->xres_virtual); - printf("yres_virtual = %d\n", var->yres_virtual); - printf("xoffset = %d\n", var->xoffset); - printf("yoffset = %d\n", var->yoffset); - printf("bits_per_pixel = %d\n", var->bits_per_pixel); - printf("grayscale = %d\n", var->grayscale); - - printf("red.offset = %d length = %d msb_right = %d\n", - var->red.offset, var->red.length, var->red.msb_right); - printf("green.offset = %d length = %d msb_right = %d\n", - var->green.offset, var->green.length, var->green.msb_right); - printf("blue.offset = %d length = %d msb_right = %d\n", - var->blue.offset, var->blue.length, var->blue.msb_right); - printf("transp.offset = %d length = %d msb_right = %d\n", - var->transp.offset, var->transp.length, var->transp.msb_right); - - printf("nonstd = %d\n", var->nonstd); - printf("activate = %d\n", var->activate); - printf("height = %d mm\n", var->height); - printf("width = %d mm\n", var->width); - printf("accel_flags = 0x%x\n", var->accel_flags); - printf("pixclock = %d\n", var->pixclock); - printf("left_margin = %d\n", var->left_margin); - printf("right_margin = %d\n", var->right_margin); - printf("upper_margin = %d\n", var->upper_margin); - printf("lower_margin = %d\n", var->lower_margin); - printf("hsync_len = %d\n", var->hsync_len); - printf("vsync_len = %d\n", var->vsync_len); - printf("sync = %d\n", var->sync); - printf("vmode = %d\n", var->vmode); -} - - -static void -signal_handler(int signumber) -{ - signal(signumber, SIG_IGN); /* prevent recursion! */ - fprintf(stderr, "error: got signal %d (exiting)\n", signumber); - exit(1); -} - - -static void -initialize_fbdev( void ) -{ - char ttystr[1000]; - int fd, vtnumber, ttyfd; - int sz; - - if (geteuid()) { - fprintf(stderr, "error: you need to be root\n"); - exit(1); - } - -#if 1 - /* open the framebuffer device */ - FrameBufferFD = open("/dev/fb0", O_RDWR); - if (FrameBufferFD < 0) { - fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno)); - exit(1); - } -#endif - - /* open /dev/tty0 and get the vt number */ - if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) { - fprintf(stderr, "error opening /dev/tty0\n"); - exit(1); - } - if (ioctl(fd, VT_OPENQRY, &vtnumber) < 0 || vtnumber < 0) { - fprintf(stderr, "error: couldn't get a free vt\n"); - exit(1); - } - close(fd); - - /* open the console tty */ - sprintf(ttystr, "/dev/tty%d", vtnumber); /* /dev/tty1-64 */ - ConsoleFD = open(ttystr, O_RDWR | O_NDELAY, 0); - if (ConsoleFD < 0) { - fprintf(stderr, "error couldn't open console fd\n"); - exit(1); - } - - /* save current vt number */ - { - struct vt_stat vts; - if (ioctl(ConsoleFD, VT_GETSTATE, &vts) == 0) - OriginalVT = vts.v_active; - } - - /* disconnect from controlling tty */ - ttyfd = open("/dev/tty", O_RDWR); - if (ttyfd >= 0) { - ioctl(ttyfd, TIOCNOTTY, 0); - close(ttyfd); - } - - /* some magic to restore the vt when we exit */ - { - struct vt_mode vt; - if (ioctl(ConsoleFD, VT_ACTIVATE, vtnumber) != 0) - printf("ioctl VT_ACTIVATE: %s\n", strerror(errno)); - if (ioctl(ConsoleFD, VT_WAITACTIVE, vtnumber) != 0) - printf("ioctl VT_WAITACTIVE: %s\n", strerror(errno)); - - if (ioctl(ConsoleFD, VT_GETMODE, &vt) < 0) { - fprintf(stderr, "error: ioctl VT_GETMODE: %s\n", strerror(errno)); - exit(1); - } - - vt.mode = VT_PROCESS; - vt.relsig = SIGUSR1; - vt.acqsig = SIGUSR1; - if (ioctl(ConsoleFD, VT_SETMODE, &vt) < 0) { - fprintf(stderr, "error: ioctl(VT_SETMODE) failed: %s\n", - strerror(errno)); - exit(1); - } - } - - /* go into graphics mode */ - if (ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) { - fprintf(stderr, "error: ioctl(KDSETMODE, KD_GRAPHICS) failed: %s\n", - strerror(errno)); - exit(1); - } - - -#if 0 - /* open the framebuffer device */ - FrameBufferFD = open("/dev/fb0", O_RDWR); - if (FrameBufferFD < 0) { - fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno)); - exit(1); - } -#endif - - /* Get the fixed screen info */ - if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) { - fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", - strerror(errno)); - exit(1); - } - - print_fixed_info(&FixedInfo, "Fixed"); - - - /* get the variable screen info */ - if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) { - fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", - strerror(errno)); - exit(1); - } - - print_var_info(&OrigVarInfo, "Orig Var"); - - /* operate on a copy */ - VarInfo = OrigVarInfo; - - /* set the depth, resolution, etc */ - DesiredDepth = 32; - if (DesiredDepth) - VarInfo.bits_per_pixel = DesiredDepth; - - if (VarInfo.bits_per_pixel == 16) { - VarInfo.red.offset = 11; - VarInfo.green.offset = 5; - VarInfo.blue.offset = 0; - VarInfo.red.length = 5; - VarInfo.green.length = 6; - VarInfo.blue.length = 5; - VarInfo.transp.offset = 0; - VarInfo.transp.length = 0; - } - else if (VarInfo.bits_per_pixel == 32) { - VarInfo.red.offset = 16; - VarInfo.green.offset = 8; - VarInfo.blue.offset = 0; - VarInfo.transp.offset = 24; - VarInfo.red.length = 8; - VarInfo.green.length = 8; - VarInfo.blue.length = 8; - VarInfo.transp.length = 8; - } - /* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */ - VarInfo.xres_virtual = VarInfo.xres = 1280; - VarInfo.yres_virtual = VarInfo.yres = 1024; - VarInfo.pixclock = 7408; - VarInfo.left_margin = 248; - VarInfo.right_margin = 16; - VarInfo.upper_margin = 38; - VarInfo.lower_margin = 1; - VarInfo.hsync_len = 144; - VarInfo.vsync_len = 3; - - VarInfo.xoffset = 0; - VarInfo.yoffset = 0; - VarInfo.nonstd = 0; - VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */ - - /* set new variable screen info */ - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { - fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", - strerror(errno)); - exit(1); - } - - print_var_info(&VarInfo, "New Var"); - - if (FixedInfo.visual != FB_VISUAL_TRUECOLOR && - FixedInfo.visual != FB_VISUAL_DIRECTCOLOR) { - fprintf(stderr, "non-TRUE/DIRECT-COLOR visuals (0x%x) not supported by this demo.\n", FixedInfo.visual); - exit(1); - } - - /* initialize colormap */ - if (FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) { - struct fb_cmap cmap; - unsigned short red[256], green[256], blue[256]; - int i; - - /* we're assuming 256 entries here */ - printf("initializing directcolor colormap\n"); - cmap.start = 0; - cmap.len = 256; - cmap.red = red; - cmap.green = green; - cmap.blue = blue; - cmap.transp = NULL; - for (i = 0; i < cmap.len; i++) { - red[i] = green[i] = blue[i] = (i << 8) | i; - } - if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &cmap) < 0) { - fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i); - } - } - - /* - * fbdev says the frame buffer is at offset zero, and the mmio region - * is immediately after. - */ - - /* mmap the framebuffer into our address space */ - FrameBuffer = (caddr_t) mmap(0, /* start */ - FixedInfo.smem_len, /* bytes */ - PROT_READ | PROT_WRITE, /* prot */ - MAP_SHARED, /* flags */ - FrameBufferFD, /* fd */ - 0 /* offset */); - if (FrameBuffer == (caddr_t) - 1) { - fprintf(stderr, "error: unable to mmap framebuffer: %s\n", - strerror(errno)); - exit(1); - } - printf("FrameBuffer = %p\n", FrameBuffer); - -#if 1 - /* mmap the MMIO region into our address space */ - MMIOAddress = (caddr_t) mmap(0, /* start */ - FixedInfo.mmio_len, /* bytes */ - PROT_READ | PROT_WRITE, /* prot */ - MAP_SHARED, /* flags */ - FrameBufferFD, /* fd */ - FixedInfo.smem_len /* offset */); - if (MMIOAddress == (caddr_t) - 1) { - fprintf(stderr, "error: unable to mmap mmio region: %s\n", - strerror(errno)); - } - printf("MMIOAddress = %p\n", MMIOAddress); - - /* try out some simple MMIO register reads */ - if (1) - { - typedef unsigned int CARD32; - typedef unsigned char CARD8; -#define RADEON_CONFIG_MEMSIZE 0x00f8 -#define RADEON_MEM_SDRAM_MODE_REG 0x0158 -#define MMIO_IN32(base, offset) \ - *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) -#define INREG(addr) MMIO_IN32(MMIOAddress, addr) - int sz, type; - const char *typeStr[] = {"SDR", "DDR", "64-bit SDR"}; - sz = INREG(RADEON_CONFIG_MEMSIZE); - type = INREG(RADEON_MEM_SDRAM_MODE_REG); - printf("RADEON_CONFIG_MEMSIZE = %d (%d MB)\n", sz, sz / 1024 / 1024); - printf("RADEON_MEM_SDRAM_MODE_REG >> 30 = %d (%s)\n", - type >> 30, typeStr[type>>30]); - } -#endif - -} - - -static void -shutdown_fbdev( void ) -{ - struct vt_mode VT; - - printf("cleaning up...\n"); - /* restore original variable screen info */ - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) { - fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", - strerror(errno)); - exit(1); - } - - munmap(MMIOAddress, FixedInfo.mmio_len); - munmap(FrameBuffer, FixedInfo.smem_len); - close(FrameBufferFD); - - /* restore text mode */ - ioctl(ConsoleFD, KDSETMODE, KD_TEXT); - - /* set vt */ - if (ioctl(ConsoleFD, VT_GETMODE, &VT) != -1) { - VT.mode = VT_AUTO; - ioctl(ConsoleFD, VT_SETMODE, &VT); - } - - /* restore original vt */ - if (OriginalVT >= 0) { - ioctl(ConsoleFD, VT_ACTIVATE, OriginalVT); - OriginalVT = -1; - } - - close(ConsoleFD); -} - - -static void -gltest( void ) -{ - static const int attribs[] = { - GLFBDEV_DOUBLE_BUFFER, - GLFBDEV_DEPTH_SIZE, 16, - GLFBDEV_NONE - }; - GLFBDevContextPtr ctx; - GLFBDevBufferPtr buf; - GLFBDevVisualPtr vis; - int bytes, r, g, b, a; - float ang; - - printf("GLFBDEV_VENDOR = %s\n", glFBDevGetString(GLFBDEV_VENDOR)); - printf("GLFBDEV_VERSION = %s\n", glFBDevGetString(GLFBDEV_VERSION)); - - /* framebuffer size */ - bytes = VarInfo.xres_virtual * VarInfo.yres_virtual * VarInfo.bits_per_pixel / 8; - - vis = glFBDevCreateVisual( &FixedInfo, &VarInfo, attribs ); - assert(vis); - - buf = glFBDevCreateBuffer( &FixedInfo, &VarInfo, vis, FrameBuffer, NULL, bytes ); - assert(buf); - - ctx = glFBDevCreateContext( vis, NULL ); - assert(buf); - - b = glFBDevMakeCurrent( ctx, buf, buf ); - assert(b); - - /*printf("GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS));*/ - glGetIntegerv(GL_RED_BITS, &r); - glGetIntegerv(GL_GREEN_BITS, &g); - glGetIntegerv(GL_BLUE_BITS, &b); - glGetIntegerv(GL_ALPHA_BITS, &a); - printf("RED_BITS=%d GREEN_BITS=%d BLUE_BITS=%d ALPHA_BITS=%d\n", - r, g, b, a); - - glClearColor(0.5, 0.5, 1.0, 0); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1, 1, -1, 1, 2, 30); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0, 0, -15); - glViewport(0, 0, VarInfo.xres_virtual, VarInfo.yres_virtual); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - for (ang = 0; ang <= 180; ang += 15) { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glPushMatrix(); - glRotatef(ang, 1, 0, 0); - glutSolidTorus(1, 3, 40, 20); - glPopMatrix(); - glFBDevSwapBuffers(buf); - } - - /* clean up */ - b = glFBDevMakeCurrent( NULL, NULL, NULL); - assert(b); - - glFBDevDestroyContext(ctx); - glFBDevDestroyBuffer(buf); - glFBDevDestroyVisual(vis); -} - - -int -main( int argc, char *argv[] ) -{ - signal(SIGUSR1, signal_handler); /* exit if someone tries a vt switch */ - signal(SIGSEGV, signal_handler); /* catch segfaults */ - - initialize_fbdev(); - gltest(); - shutdown_fbdev(); - - return 0; -} diff --git a/progs/miniglx/manytex.c b/progs/miniglx/manytex.c deleted file mode 100644 index 3ba89d499e4..00000000000 --- a/progs/miniglx/manytex.c +++ /dev/null @@ -1,382 +0,0 @@ -/* $Id: manytex.c,v 1.2 2003-08-23 01:28:59 jonsmirl Exp $ */ - -/* - * test handling of many texture maps - * Also tests texture priority and residency. - * - * Brian Paul - * August 2, 2000 - */ - - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> -#include <GL/glut.h> - - -static GLint NumTextures = 20; -static GLuint *TextureID = NULL; -static GLint *TextureWidth = NULL, *TextureHeight = NULL; -static GLboolean *TextureResidency = NULL; -static GLint TexWidth = 128, TexHeight = 128; -static GLfloat Zrot = 0; -static GLboolean Anim = GL_TRUE; -static GLint WinWidth = 500, WinHeight = 400; -static GLboolean MipMap = GL_FALSE; -static GLboolean LinearFilter = GL_FALSE; -static GLboolean RandomSize = GL_FALSE; -static GLint Rows, Columns; -static GLint LowPriorityCount = 0; - - -static void Idle( void ) -{ - Zrot += 1.0; - glutPostRedisplay(); -} - - -static void Display( void ) -{ - GLfloat spacing = WinWidth / Columns; - GLfloat size = spacing * 0.4; - GLint i; - - /* test residency */ - if (0) - { - GLboolean b; - GLint i, resident; - b = glAreTexturesResident(NumTextures, TextureID, TextureResidency); - if (b) { - printf("all resident\n"); - } - else { - resident = 0; - for (i = 0; i < NumTextures; i++) { - if (TextureResidency[i]) { - resident++; - } - } - printf("%d of %d texture resident\n", resident, NumTextures); - } - } - - /* render the textured quads */ - glClear( GL_COLOR_BUFFER_BIT ); - for (i = 0; i < NumTextures; i++) { - GLint row = i / Columns; - GLint col = i % Columns; - GLfloat x = col * spacing + spacing * 0.5; - GLfloat y = row * spacing + spacing * 0.5; - - GLfloat maxDim = (TextureWidth[i] > TextureHeight[i]) - ? TextureWidth[i] : TextureHeight[i]; - GLfloat w = TextureWidth[i] / maxDim; - GLfloat h = TextureHeight[i] / maxDim; - - glPushMatrix(); - glTranslatef(x, y, 0.0); - glRotatef(Zrot, 0, 0, 1); - glScalef(size, size, 1); - - glBindTexture(GL_TEXTURE_2D, TextureID[i]); - glBegin(GL_POLYGON); -#if 0 - glTexCoord2f(0, 0); glVertex2f(-1, -1); - glTexCoord2f(1, 0); glVertex2f( 1, -1); - glTexCoord2f(1, 1); glVertex2f( 1, 1); - glTexCoord2f(0, 1); glVertex2f(-1, 1); -#else - glTexCoord2f(0, 0); glVertex2f(-w, -h); - glTexCoord2f(1, 0); glVertex2f( w, -h); - glTexCoord2f(1, 1); glVertex2f( w, h); - glTexCoord2f(0, 1); glVertex2f(-w, h); -#endif - glEnd(); - glPopMatrix(); - } - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - WinWidth = width; - WinHeight = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(0, width, 0, height, -1, 1); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -} - - -/* - * Return a random int in [min, max]. - */ -static int RandomInt(int min, int max) -{ - int i = rand(); - int j = i % (max - min + 1); - return min + j; -} - - - -static void Init( void ) -{ - GLint i; - - if (RandomSize) { - printf("Creating %d %s random-size textures, ", NumTextures, - MipMap ? "Mipmapped" : "non-Mipmapped"); - } - else { - printf("Creating %d %s %d x %d textures, ", NumTextures, - MipMap ? "Mipmapped" : "non-Mipmapped", - TexWidth, TexHeight); - } - - if (LinearFilter) { - printf("bilinear filtering\n"); - } - else { - printf("nearest filtering\n"); - } - - - /* compute number of rows and columns of rects */ - { - GLfloat area = (GLfloat) (WinWidth * WinHeight) / (GLfloat) NumTextures; - GLfloat edgeLen = sqrt(area); - - Columns = WinWidth / edgeLen; - Rows = (NumTextures + Columns - 1) / Columns; - printf("Rows: %d Cols: %d\n", Rows, Columns); - } - - - if (!TextureID) { - TextureID = (GLuint *) malloc(sizeof(GLuint) * NumTextures); - assert(TextureID); - glGenTextures(NumTextures, TextureID); - } - - if (!TextureResidency) { - TextureResidency = (GLboolean *) malloc(sizeof(GLboolean) * NumTextures); - assert(TextureResidency); - } - - if (!TextureWidth) { - TextureWidth = (GLint *) malloc(sizeof(GLint) * NumTextures); - assert(TextureWidth); - } - if (!TextureHeight) { - TextureHeight = (GLint *) malloc(sizeof(GLint) * NumTextures); - assert(TextureHeight); - } - - for (i = 0; i < NumTextures; i++) { - GLubyte color[4]; - GLubyte *texImage; - GLint j, row, col; - - row = i / Columns; - col = i % Columns; - - glBindTexture(GL_TEXTURE_2D, TextureID[i]); - - if (i < LowPriorityCount) - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 0.5F); - - if (RandomSize) { -#if 0 - int k = (glutGet(GLUT_ELAPSED_TIME) % 7) + 2; - TexWidth = 1 << k; - TexHeight = 1 << k; -#else - TexWidth = 1 << RandomInt(2, 7); - TexHeight = 1 << RandomInt(2, 7); - printf("Random size of %3d: %d x %d\n", i, TexWidth, TexHeight); -#endif - } - - TextureWidth[i] = TexWidth; - TextureHeight[i] = TexHeight; - - texImage = (GLubyte*) malloc(4 * TexWidth * TexHeight * sizeof(GLubyte)); - assert(texImage); - - /* determine texture color */ - color[0] = (GLint) (255.0 * ((float) col / (Columns - 1))); - color[1] = 127; - color[2] = (GLint) (255.0 * ((float) row / (Rows - 1))); - color[3] = 255; - - /* fill in solid-colored teximage */ - for (j = 0; j < TexWidth * TexHeight; j++) { - texImage[j*4+0] = color[0]; - texImage[j*4+1] = color[1]; - texImage[j*4+2] = color[2]; - texImage[j*4+3] = color[3]; - } - - if (MipMap) { - GLint level = 0; - GLint w = TexWidth, h = TexHeight; - while (1) { - glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, w, h, 0, - GL_RGBA, GL_UNSIGNED_BYTE, texImage); - if (w == 1 && h == 1) - break; - if (w > 1) - w /= 2; - if (h > 1) - h /= 2; - level++; - /*printf("%d: %d x %d\n", level, w, h);*/ - } - if (LinearFilter) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_LINEAR_MIPMAP_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_NEAREST_MIPMAP_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - } - else { - /* Set corners to white */ - int k = 0; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - k = (TexWidth - 1) * 4; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - k = (TexWidth * TexHeight - TexWidth) * 4; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - k = (TexWidth * TexHeight - 1) * 4; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0, - GL_RGBA, GL_UNSIGNED_BYTE, texImage); - if (LinearFilter) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - } - - free(texImage); - } - - glEnable(GL_TEXTURE_2D); -} - - -static void Key( unsigned char key, int x, int y ) -{ - const GLfloat step = 3.0; - (void) x; - (void) y; - switch (key) { - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 's': - Idle(); - break; - case 'z': - Zrot -= step; - break; - case 'Z': - Zrot += step; - break; - case ' ': - Init(); - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -int main( int argc, char *argv[] ) -{ - GLint i; - - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( WinWidth, WinHeight ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc(Idle); - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-n") == 0) { - NumTextures = atoi(argv[i+1]); - if (NumTextures <= 0) { - printf("Error, bad number of textures\n"); - return 1; - } - i++; - } - else if (strcmp(argv[i], "-mipmap") == 0) { - MipMap = GL_TRUE; - } - else if (strcmp(argv[i], "-linear") == 0) { - LinearFilter = GL_TRUE; - } - else if (strcmp(argv[i], "-size") == 0) { - TexWidth = atoi(argv[i+1]); - TexHeight = atoi(argv[i+2]); - assert(TexWidth >= 1); - assert(TexHeight >= 1); - i += 2; - } - else if (strcmp(argv[i], "-randomsize") == 0) { - RandomSize = GL_TRUE; - } - else if (strcmp(argv[i], "-lowpri") == 0) { - LowPriorityCount = atoi(argv[i+1]); - i++; - } - else { - printf("Usage:\n"); - printf(" manytex [options]\n"); - printf("Options:\n"); - printf(" -n <number of texture objects>\n"); - printf(" -size <width> <height> - specify texture size\n"); - printf(" -randomsize - use random size textures\n"); - printf(" -mipmap - generate mipmaps\n"); - printf(" -linear - use linear filtering instead of nearest\n"); - printf(" -lowpri <n> - Set lower priority on <n> textures\n"); - return 0; - } - } - - Init(); - - glutMainLoop(); - - return 0; -} diff --git a/progs/miniglx/miniglxsample.c b/progs/miniglx/miniglxsample.c deleted file mode 100644 index d4d6729f932..00000000000 --- a/progs/miniglx/miniglxsample.c +++ /dev/null @@ -1,128 +0,0 @@ - -#define USE_MINIGLX 1 /* 1 = use Mini GLX, 0 = use Xlib/GLX */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <GL/gl.h> - -#if USE_MINIGLX -#include <GL/miniglx.h> -#else -#include <GL/glx.h> -#include <X11/Xlib.h> -#endif - -static void _subset_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) -{ - glBegin( GL_QUADS ); - glVertex2f( x1, y1 ); - glVertex2f( x2, y1 ); - glVertex2f( x2, y2 ); - glVertex2f( x1, y2 ); - glEnd(); -} - - -/* - * Create a simple double-buffered RGBA window. - */ -static Window -MakeWindow(Display * dpy, unsigned int width, unsigned int height) -{ - int visAttributes[] = { - GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DOUBLEBUFFER, - None - }; - XSetWindowAttributes attr; - unsigned long attrMask; - Window root; - Window win; - GLXContext ctx; - XVisualInfo *visinfo; - - root = RootWindow(dpy, 0); - - /* Choose GLX visual / pixel format */ - visinfo = glXChooseVisual(dpy, 0, visAttributes); - if (!visinfo) { - printf("Error: couldn't get an RGB, Double-buffered visual\n"); - exit(1); - } - - /* Create the window */ - attr.background_pixel = 0; - attr.border_pixel = 0; - attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone); - attrMask = CWBackPixel | CWBorderPixel | CWColormap; - win = XCreateWindow(dpy, root, 0, 0, width, height, - 0, visinfo->depth, InputOutput, - visinfo->visual, attrMask, &attr); - if (!win) { - printf("Error: XCreateWindow failed\n"); - exit(1); - } - - /* Display the window */ - XMapWindow(dpy, win); - - /* Create GLX rendering context */ - ctx = glXCreateContext(dpy, visinfo, NULL, True); - if (!ctx) { - printf("Error: glXCreateContext failed\n"); - exit(1); - } - - /* Bind the rendering context and window */ - glXMakeCurrent(dpy, win, ctx); - - glViewport(0, 0, width, height); - - return win; -} - - -/* - * Draw a few frames of a rotating square. - */ -static void -DrawFrames(Display * dpy, Window win) -{ - int angle; - glShadeModel(GL_FLAT); - glClearColor(0.5, 0.5, 0.5, 1.0); - for (angle = 0; angle < 360; angle += 10) { - glClear(GL_COLOR_BUFFER_BIT); - glColor3f(1.0, 1.0, 0.0); - glPushMatrix(); - glRotatef(angle, 0, 0, 1); - _subset_Rectf(-0.8, -0.8, 0.8, 0.8); - glPopMatrix(); - glXSwapBuffers(dpy, win); - sleep(1); - } -} - - -int -main(int argc, char *argv[]) -{ - Display *dpy; - Window win; - - dpy = XOpenDisplay(NULL); - if (!dpy) { - printf("Error: XOpenDisplay failed\n"); - return 1; - } - - win = MakeWindow(dpy, 300, 300); - - DrawFrames(dpy, win); - - return 0; -} diff --git a/progs/miniglx/miniglxtest.c b/progs/miniglx/miniglxtest.c deleted file mode 100644 index 25e4c59104d..00000000000 --- a/progs/miniglx/miniglxtest.c +++ /dev/null @@ -1,195 +0,0 @@ -/* $Id: miniglxtest.c,v 1.3 2004-03-25 14:58:39 brianp Exp $ */ - -/* - * Test the mini GLX interface. - */ - - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <GL/gl.h> -#define USE_MINI_GLX 1 -#if USE_MINI_GLX -#include <GL/miniglx.h> -#else -#include <GL/glx.h> -#endif - -#define FRONTBUFFER 1 -#define NR 6 -#define DO_SLEEPS 1 -#define NR_DISPLAYS 2 - -GLXContext ctx; - - -static void _subset_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) -{ - glBegin( GL_QUADS ); - glVertex2f( x1, y1 ); - glVertex2f( x2, y1 ); - glVertex2f( x2, y2 ); - glVertex2f( x1, y2 ); - glEnd(); -} - - - -static void redraw( Display *dpy, Window w, int rot ) -{ - printf("Redraw event\n"); - -#if FRONTBUFFER - glDrawBuffer( GL_FRONT ); -#else -/* glDrawBuffer( GL_BACK ); */ -#endif - - glClearColor( rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX, - 1); - - glClear( GL_COLOR_BUFFER_BIT ); - -#if 1 - glColor3f( rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX, - rand()/(float)RAND_MAX ); - glPushMatrix(); - glRotatef(rot, 0, 0, 1); - glScalef(.5, .5, .5); - _subset_Rectf( -1, -1, 1, 1 ); - glPopMatrix(); -#endif - -#if FRONTBUFFER - glFlush(); -#else - glXSwapBuffers( dpy, w ); -#endif - glFinish(); -} - - -static Window make_rgb_db_window( Display *dpy, - unsigned int width, unsigned int height ) -{ - int attrib[] = { GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, -#if !FRONTBUFFER - GLX_DOUBLEBUFFER, -#endif - None }; - int scrnum; - XSetWindowAttributes attr; - unsigned long mask; - Window root; - Window win; - XVisualInfo *visinfo; - - scrnum = 0; - root = RootWindow( dpy, scrnum ); - - if (!(visinfo = glXChooseVisual( dpy, scrnum, attrib ))) { - printf("Error: couldn't get an RGB, Double-buffered visual\n"); - exit(1); - } - - if(!(ctx = glXCreateContext( dpy, visinfo, NULL, True ))) { - printf("Error: glXCreateContext failed\n"); - exit(1); - } - - /* window attributes */ - attr.background_pixel = 0; - attr.border_pixel = 0; - attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone); - attr.event_mask = StructureNotifyMask | ExposureMask; - mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - - win = XCreateWindow( dpy, root, 0, 0, width, height, - 0, visinfo->depth, InputOutput, - visinfo->visual, mask, &attr ); - if (!win) { - printf("Error: XCreateWindow failed\n"); - exit(1); - } - - glXMakeCurrent( dpy, win, ctx ); - - glViewport(0, 0, width, height); - - return win; -} - - -static void event_loop( Display *dpy, Window win ) -{ - int i; - - printf("Hang on... drawing %d frames\n", NR); - for (i = 0; i < NR; i++) { - redraw( dpy, win, i*10 ); - if (DO_SLEEPS) { - printf("sleep(1)\n"); - sleep(1); - } - } -} - - -static int foo( void ) -{ - Display *dpy; - Window win; - - dpy = XOpenDisplay(NULL); - if (!dpy) { - printf("Error: XOpenDisplay failed\n"); - return 1; - } - - win = make_rgb_db_window( dpy, 800, 600); - - srand(getpid()); - - glShadeModel( GL_FLAT ); - glClearColor( 0.5, 0.5, 0.5, 1.0 ); - - XMapWindow( dpy, win ); - - { - XEvent e; - while (1) { - XNextEvent( dpy, &e ); - if (e.type == MapNotify && e.xmap.window == win) { - break; - } - } - } - - event_loop( dpy, win ); - - glXDestroyContext( dpy, ctx ); - XDestroyWindow( dpy, win ); - - XCloseDisplay( dpy ); - - return 0; -} - - -int main() -{ - int i; - for (i = 0 ; i < NR_DISPLAYS ; i++) { - if (foo() != 0) - break; - } - - return 0; -} diff --git a/progs/miniglx/sample_server.c b/progs/miniglx/sample_server.c deleted file mode 100644 index cac6e3b8345..00000000000 --- a/progs/miniglx/sample_server.c +++ /dev/null @@ -1,112 +0,0 @@ -/* $Id: sample_server.c,v 1.1 2003-08-06 17:47:15 keithw Exp $ */ - -/* - * Sample server that just keeps first available window mapped. - */ - - -#include <stdio.h> -#include <stdlib.h> -#include <GL/gl.h> -#include <GL/miniglx.h> - -struct client { - struct client *next; - Window windowid; - int mappable; -}; - -struct client *clients = 0, *mapped_client = 0; - - -static struct client *find_client( Window id ) -{ - struct client *c; - - for (c = clients ; c ; c = c->next) - if (c->windowid == id) - return c; - - return 0; -} - -int main( int argc, char *argv[] ) -{ - Display *dpy; - XEvent ev; - - dpy = __miniglx_StartServer(NULL); - if (!dpy) { - fprintf(stderr, "Error: __miniglx_StartServer failed\n"); - return 1; - } - - while (XNextEvent( dpy, &ev )) { - struct client *c; - - switch (ev.type) { - case MapRequest: - fprintf(stderr, "MapRequest\n"); - c = find_client(ev.xmaprequest.window); - if (!c) break; - c->mappable = True; - break; - - case UnmapNotify: - fprintf(stderr, "UnmapNotify\n"); - c = find_client(ev.xunmap.window); - if (!c) break; - c->mappable = False; - if (c == mapped_client) - mapped_client = 0; - break; - - case CreateNotify: - fprintf(stderr, "CreateNotify\n"); - c = malloc(sizeof(*c)); - c->next = clients; - c->windowid = ev.xcreatewindow.window; - c->mappable = False; - clients = c; - break; - - case DestroyNotify: - fprintf(stderr, "DestroyNotify\n"); - c = find_client(ev.xdestroywindow.window); - if (!c) break; - if (c == clients) - clients = c->next; - else { - struct client *t; - for (t = clients ; t->next != c ; t = t->next) - ; - t->next = c->next; - } - - if (c == mapped_client) - mapped_client = 0; - - free(c); - break; - - default: - break; - } - - /* Search for first mappable client if none already mapped. - */ - if (!mapped_client) { - for (c = clients ; c ; c = c->next) { - if (c->mappable) { - XMapWindow( dpy, c->windowid ); - mapped_client = c; - break; - } - } - } - } - - XCloseDisplay( dpy ); - - return 0; -} diff --git a/progs/miniglx/sample_server2.c b/progs/miniglx/sample_server2.c deleted file mode 100644 index 109677ba969..00000000000 --- a/progs/miniglx/sample_server2.c +++ /dev/null @@ -1,229 +0,0 @@ -/* $Id: sample_server2.c,v 1.2 2003-08-23 01:28:59 jonsmirl Exp $ */ - -/* - * Sample server that just keeps first available window mapped. - * - * It also reads and echos anything that happens on stdin as an - * example of tracking events from sources other than miniglx clients. - * - * It reads & writes without blocking, so that eg. piping a lot of - * text to stdin and then hitting 'ctrl-S' on the output stream won't - * cause it to stop handling miniglx events. - * - * See select_tut in the linux manual pages for a good overview of the - * select(2) system call. - */ - - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <GL/gl.h> -#include <GL/miniglx.h> -#include <errno.h> -#include <assert.h> - -struct client { - struct client *next; - Window windowid; - int mappable; -}; - -struct client *clients = 0, *mapped_client = 0; - -#define BUFSZ 4096 -char rbuf[BUFSZ]; -int rbuf_count; - - -static struct client *find_client( Window id ) -{ - struct client *c; - - for (c = clients ; c ; c = c->next) - if (c->windowid == id) - return c; - - return 0; -} - -int main( int argc, char *argv[] ) -{ - Display *dpy; - XEvent ev; - int autostart = 0; - - if (argc == 2 && strcmp(argv[1], "-autostart") == 0) - autostart = 1; - - dpy = __miniglx_StartServer(NULL); - if (!dpy) { - fprintf(stderr, "Error: __miniglx_StartServer failed\n"); - return 1; - } - - /* How is vt switching communicated through the XNextEvent interface? - */ - while (1) { - int r, n; - struct timeval tv; - fd_set rfds, wfds; - int bored = 0; - - FD_ZERO(&rfds); - FD_ZERO(&wfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - if (rbuf_count) { - FD_SET( 1, &wfds ); /* notify when we can write out buffer */ - n = 1; - } - else { - FD_SET( 0, &rfds ); /* else notify when new data to read */ - n = 0; - } - - /* __miniglx_Select waits until any of these file groups becomes - * readable/writable/etc (like regular select), until timeout - * expires (like regular select), until a signal is received - * (like regular select) or until an event is available for - * XCheckMaskEvent(). - */ - r = __miniglx_Select( dpy, n+1, &rfds, &wfds, 0, &tv ); - - /* This can happen if select() is interrupted by a signal: - */ - if (r < 0 && errno != EINTR && errno != EAGAIN) { - perror ("select()"); - exit (1); - } - - if (tv.tv_sec == 0 && tv.tv_usec == 0) - bored = 1; - - /* Check and handle events on our local file descriptors - */ - if (FD_ISSET( 0, &rfds )) { - /* Something on stdin */ - assert(rbuf_count == 0); - r = read(0, rbuf, BUFSZ); - if (r < 1) { - perror("read"); - abort(); - } - rbuf_count = r; - } - - if (FD_ISSET( 1, &wfds )) { - /* Can write to stdout */ - assert(rbuf_count > 0); - r = write(1, rbuf, rbuf_count); - if (r < 1) { - perror("write"); - abort(); - } - rbuf_count -= r; - if (rbuf_count) - memmove(rbuf + r, rbuf, rbuf_count); - } - - - /* Check and handle events generated by miniglx: - */ - while (XCheckMaskEvent( dpy, ~0, &ev )) { - struct client *c; - bored = 0; - - fprintf(stderr, "Received event %d\n", ev.type); - - switch (ev.type) { - case CreateNotify: - fprintf(stderr, "CreateNotify -- new client\n"); - c = malloc(sizeof(*c)); - c->next = clients; - c->windowid = ev.xcreatewindow.window; - c->mappable = False; - clients = c; - break; - - case DestroyNotify: - fprintf(stderr, "DestroyNotify\n"); - c = find_client(ev.xdestroywindow.window); - if (!c) break; - if (c == clients) - clients = c->next; - else { - struct client *t; - for (t = clients ; t->next != c ; t = t->next) - ; - t->next = c->next; - } - - if (c == mapped_client) - mapped_client = 0; - - free(c); - break; - - case MapRequest: - fprintf(stderr, "MapRequest\n"); - c = find_client(ev.xmaprequest.window); - if (!c) break; - c->mappable = True; - break; - - case UnmapNotify: - fprintf(stderr, "UnmapNotify\n"); - c = find_client(ev.xunmap.window); - if (!c) break; - c->mappable = False; - if (c == mapped_client) - mapped_client = 0; - break; - - default: - break; - } - } - - - /* Search for first mappable client if none already mapped. - */ - if (!mapped_client) { - struct client *c; - for (c = clients ; c ; c = c->next) { - if (c->mappable) { - XMapWindow( dpy, c->windowid ); - mapped_client = c; - break; - } - } - if (!clients && autostart) { - system("nohup ./texline &"); - system("nohup ./manytex &"); - } - } - else if (bored) { - struct client *c; - /* bored of mapped client now, let's try & find another one */ - for (c = mapped_client->next ; c && !c->mappable ; c = c->next) - ; - if (!c) - for (c = clients ; c && !c->mappable ; c = c->next) - ; - if (c && c != mapped_client) { - XUnmapWindow( dpy, mapped_client->windowid ); - XMapWindow( dpy, c->windowid ); - mapped_client = c; - } - else - fprintf(stderr, "I'm bored!\n"); - } - } - - XCloseDisplay( dpy ); - - return 0; -} diff --git a/progs/miniglx/texline.c b/progs/miniglx/texline.c deleted file mode 100644 index 3cc22fdf3f4..00000000000 --- a/progs/miniglx/texline.c +++ /dev/null @@ -1,268 +0,0 @@ -/* $Id: texline.c,v 1.1 2003-08-06 17:47:15 keithw Exp $ */ - -/* - * Test textured lines. - * - * Brian Paul - * September 2000 - */ - - -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> -#include "../util/readtex.c" /* I know, this is a hack. */ - -#define TEXTURE_FILE "../images/girl.rgb" - -static GLboolean Antialias = GL_FALSE; -static GLboolean Animate = GL_FALSE; -static GLint Texture = 1; -static GLboolean Stipple = GL_FALSE; -static GLfloat LineWidth = 1.0; - -static GLfloat Xrot = -60.0, Yrot = 0.0, Zrot = 0.0; -static GLfloat DYrot = 1.0; -static GLboolean Points = GL_FALSE; -static GLfloat Scale = 1.0; - -static void Idle( void ) -{ - if (Animate) { - Zrot += DYrot; - glutPostRedisplay(); - } -} - - -static void Display( void ) -{ - GLfloat x, y, s, t; - - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glScalef(Scale, Scale, Scale); - - if (Texture) - glColor3f(1, 1, 1); - - if (Points) { - glBegin(GL_POINTS); - for (t = 0.0; t <= 1.0; t += 0.025) { - for (s = 0.0; s <= 1.0; s += 0.025) { - x = s * 2.0 - 1.0; - y = t * 2.0 - 1.0; - if (!Texture) - glColor3f(1, 0, 1); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, t, s); - glTexCoord2f(s, t); - glVertex2f(x, y); - } - } - glEnd(); - } - else { - glBegin(GL_LINES); - for (t = 0.0; t <= 1.0; t += 0.025) { - x = t * 2.0 - 1.0; - if (!Texture) - glColor3f(1, 0, 1); - glTexCoord2f(t, 0.0); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, t); - glVertex2f(x, -1.0); - if (!Texture) - glColor3f(0, 1, 0); - glTexCoord2f(t, 1.0); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, t); - glVertex2f(x, 1.0); - } - glEnd(); - } - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, 10.0, 100.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -12.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'a': - Antialias = !Antialias; - if (Antialias) { - glEnable(GL_LINE_SMOOTH); - glEnable(GL_POINT_SMOOTH); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - } - else { - glDisable(GL_LINE_SMOOTH); - glDisable(GL_POINT_SMOOTH); - glDisable(GL_BLEND); - } - break; - case 't': - Texture++; - if (Texture > 2) - Texture = 0; - if (Texture == 0) { - glActiveTextureARB(GL_TEXTURE0_ARB); - glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE1_ARB); - glDisable(GL_TEXTURE_2D); - } - else if (Texture == 1) { - glActiveTextureARB(GL_TEXTURE0_ARB); - glEnable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE1_ARB); - glDisable(GL_TEXTURE_2D); - } - else { - glActiveTextureARB(GL_TEXTURE0_ARB); - glEnable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE1_ARB); - glEnable(GL_TEXTURE_2D); - } - break; - case 'w': - LineWidth -= 0.25; - if (LineWidth < 0.25) - LineWidth = 0.25; - glLineWidth(LineWidth); - glPointSize(LineWidth); - break; - case 'W': - LineWidth += 0.25; - if (LineWidth > 8.0) - LineWidth = 8.0; - glLineWidth(LineWidth); - glPointSize(LineWidth); - break; - case 'p': - Points = !Points; - break; - case 's': - Stipple = !Stipple; - if (Stipple) - glEnable(GL_LINE_STIPPLE); - else - glDisable(GL_LINE_STIPPLE); - break; - case ' ': - Animate = !Animate; - if (Animate) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 27: - exit(0); - break; - } - printf("LineWidth, PointSize = %f\n", LineWidth); - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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( int argc, char *argv[] ) -{ - GLuint u; - for (u = 0; u < 2; u++) { - glActiveTextureARB(GL_TEXTURE0_ARB + u); - glBindTexture(GL_TEXTURE_2D, 10+u); - if (u == 0) - glEnable(GL_TEXTURE_2D); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - if (u == 0) - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - else - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) { - printf("Error: couldn't load texture image\n"); - exit(1); - } - } - - glLineStipple(1, 0xff); - - if (argc > 1 && strcmp(argv[1], "-info")==0) { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - } -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowSize( 400, 300 ); - - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - - glutCreateWindow(argv[0] ); - - Init(argc, argv); - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Animate) - glutIdleFunc( Idle ); - - glutMainLoop(); - return 0; -} diff --git a/progs/redbook/.cvsignore b/progs/redbook/.cvsignore deleted file mode 100644 index 8ed3efe3e23..00000000000 --- a/progs/redbook/.cvsignore +++ /dev/null @@ -1,64 +0,0 @@ -.cvsignore -aaindex -aapoly -aargb -accanti -accpersp -alpha -alpha3D -anti -bezcurve -bezmesh -checker -clip -colormat -cube -depthcue -dof -double -drawf -feedback -fog -fogindex -font -hello -image -light -lines -list -material -mipmap -model -movelight -nurbs -pickdepth -picksquare -plane -planet -polyoff -polys -quadric -robot -sccolorlight -scene -scenebamb -sceneflat -select -smooth -stencil -stroke -surface -teaambient -teapots -tess -tesswind -texbind -texgen -texprox -texsub -texturesurf -torus -trim -unproject -varray -wrap diff --git a/progs/redbook/Imakefile b/progs/redbook/Imakefile deleted file mode 100644 index ab3b6d7f793..00000000000 --- a/progs/redbook/Imakefile +++ /dev/null @@ -1,221 +0,0 @@ -LOCAL_LIBRARIES = $(XLIB) $(TOP)\lib\Mesaaux.a $(TOP)\lib\Mesaglu.a $(TOP)\lib\MesaGL.a
-
-INCLUDES = -I$(TOP)\include
-
-SRCS = accanti.c \
- accnot.c \
- accpersp.c \
- accum.c \
- aim.c \
- alpha.c \
- alpha3D.c \
- anti.c \
- antiindex.c \
- antipindex.c \
- antipoint.c \
- antipoly.c \
- bezcurve.c \
- bezmesh.c \
- bezsurf.c \
- checker.c \
- checker2.c \
- chess.c \
- clip.c \
- colormat.c \
- cone.c \
- cube.c \
- curve.c \
- depthcue.c \
- disk.c \
- dof.c \
- dofnot.c \
- double.c \
- drawf.c \
- feedback.c \
- fog.c \
- fogindex.c \
- font.c \
- light.c \
- linelist.c \
- lines.c \
- list.c \
- list2.c \
- maplight.c \
- material.c \
- mipmap.c \
- model.c \
- movelight.c \
- nurbs.c \
- pickdepth.c \
- pickline.c \
- picksquare.c \
- plane.c \
- planet.c \
- planetup.c \
- polys.c \
- robot.c \
- sccolorlight.c \
- scene.c \
- scenebamb.c \
- sceneflat.c \
- select.c \
- simple.c \
- smooth.c \
- sphere.c \
- stencil.c \
- stroke.c \
- surface.c \
- tea.c \
- teaambient.c \
- teapots.c \
- texgen.c \
- texturesurf.c \
- trim.c \
- xfont.c
-
-PROGRAMS = ProgramTargetName(accanti) \
- ProgramTargetName(accnot) \
- ProgramTargetName(accpersp) \
- ProgramTargetName(accum) \
- ProgramTargetName(aim) \
- ProgramTargetName(alpha) \
- ProgramTargetName(alpha3D) \
- ProgramTargetName(anti) \
- ProgramTargetName(antiindex) \
- ProgramTargetName(antipindex) \
- ProgramTargetName(antipoint) \
- ProgramTargetName(antipoly) \
- ProgramTargetName(bezcurve) \
- ProgramTargetName(bezmesh) \
- ProgramTargetName(bezsurf) \
- ProgramTargetName(checker) \
- ProgramTargetName(checker2) \
- ProgramTargetName(chess) \
- ProgramTargetName(clip) \
- ProgramTargetName(colormat) \
- ProgramTargetName(cone) \
- ProgramTargetName(cube) \
- ProgramTargetName(curve) \
- ProgramTargetName(depthcue) \
- ProgramTargetName(disk) \
- ProgramTargetName(dof) \
- ProgramTargetName(dofnot) \
- ProgramTargetName(double) \
- ProgramTargetName(drawf) \
- ProgramTargetName(feedback) \
- ProgramTargetName(fog) \
- ProgramTargetName(fogindex) \
- ProgramTargetName(font) \
- ProgramTargetName(light) \
- ProgramTargetName(linelist) \
- ProgramTargetName(lines) \
- ProgramTargetName(list) \
- ProgramTargetName(list2) \
- ProgramTargetName(maplight) \
- ProgramTargetName(material) \
- ProgramTargetName(mipmap) \
- ProgramTargetName(model) \
- ProgramTargetName(movelight) \
- ProgramTargetName(nurbs) \
- ProgramTargetName(pickdepth) \
- ProgramTargetName(pickline) \
- ProgramTargetName(picksquare) \
- ProgramTargetName(plane) \
- ProgramTargetName(planet) \
- ProgramTargetName(planetup) \
- ProgramTargetName(polys) \
- ProgramTargetName(robot) \
- ProgramTargetName(sccolorlight) \
- ProgramTargetName(scene) \
- ProgramTargetName(scenebamb) \
- ProgramTargetName(sceneflat) \
- ProgramTargetName(select) \
- ProgramTargetName(simple) \
- ProgramTargetName(smooth) \
- ProgramTargetName(sphere) \
- ProgramTargetName(stencil) \
- ProgramTargetName(stroke) \
- ProgramTargetName(surface) \
- ProgramTargetName(tea) \
- ProgramTargetName(teaambient) \
- ProgramTargetName(teapots) \
- ProgramTargetName(texgen) \
- ProgramTargetName(texturesurf) \
- ProgramTargetName(trim) \
- ProgramTargetName(xfont)
-
-AllTarget($(PROGRAMS))
-
-NormalProgramTarget(accanti,accanti.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(accnot,accnot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(accpersp,accpersp.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(accum,accum.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(aim,aim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(alpha,alpha.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(alpha3D,alpha3D.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(anti,anti.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(antiindex,antiindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(antipindex,antipindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(antipoint,antipoint.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(antipoly,antipoly.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(bezcurve,bezcurve.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(bezmesh,bezmesh.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(bezsurf,bezsurf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(checker,checker.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(checker2,checker2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(chess,chess.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(clip,clip.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(colormat,colormat.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(cone,cone.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(cube,cube.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(curve,curve.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(depthcue,depthcue.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(disk,disk.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(dof,dof.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(dofnot,dofnot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(double,double.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(drawf,drawf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(feedback,feedback.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(fog,fog.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(fogindex,fogindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(font,font.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(light,light.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(linelist,linelist.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(lines,lines.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(list,list.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(list2,list2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(maplight,maplight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(material,material.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(mipmap,mipmap.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(model,model.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(movelight,movelight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(nurbs,nurbs.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(pickdepth,pickdepth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(pickline,pickline.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(picksquare,picksquare.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(plane,plane.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(planet,planet.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(planetup,planetup.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(polys,polys.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(robot,robot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(sccolorlight,sccolorlight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(scene,scene.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(scenebamb,scenebamb.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(sceneflat,sceneflat.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(select,select.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(simple,simple.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(smooth,smooth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(sphere,sphere.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(stencil,stencil.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(stroke,stroke.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(surface,surface.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(tea,tea.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(teaambient,teaambient.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(teapots,teapots.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(texgen,texgen.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(texturesurf,texturesurf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(trim,trim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(xfont,xfont.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-
-DependTarget()
-
diff --git a/progs/redbook/Windows/redbook.dsw b/progs/redbook/Windows/redbook.dsw deleted file mode 100644 index 71ba7e89e3e..00000000000 --- a/progs/redbook/Windows/redbook.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "teapots"=".\teapots.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/progs/redbook/Windows/teapots.dsp b/progs/redbook/Windows/teapots.dsp deleted file mode 100644 index 4d39865810c..00000000000 --- a/progs/redbook/Windows/teapots.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="teapots" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=teapots - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "teapots.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "teapots.mak" CFG="teapots - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "teapots - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "teapots - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "teapots - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../teapots.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "teapots - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../teapots.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "teapots - Win32 Release"
-# Name "teapots - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\teapots.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/progs/samples/.cvsignore b/progs/samples/.cvsignore deleted file mode 100644 index 12b0650567b..00000000000 --- a/progs/samples/.cvsignore +++ /dev/null @@ -1,45 +0,0 @@ -.cvsignore -accum -bitmap1 -bitmap2 -blendeq -blendxor -copy -cursor -depth -eval -fog -font -line -logo -nurb -oglinfo -olympic -overlay -point -prim -quad -select -shape -sphere -star -stencil -stretch -texture -tri -wave -bugger -pend -lthreads -lxdemo -lxgears -lxheads -lxinfo -lxpixmap -anywin -ffset -bdemo -binfo -incopy -demo -font diff --git a/progs/samples/Imakefile b/progs/samples/Imakefile deleted file mode 100644 index 948a9783597..00000000000 --- a/progs/samples/Imakefile +++ /dev/null @@ -1,101 +0,0 @@ -LOCAL_LIBRARIES = $(XLIB) $(TOP)\lib\glut.a $(TOP)\lib\Mesaglu.a $(TOP)\lib\MesaGL.a
-
-INCLUDES = -I$(TOP)\include
-
-SRCS = accum.c \
- bitmap1.c \
- bitmap2.c \
- blendeq.c \
- blendxor.c \
- copy.c \
- cursor.c \
- depth.c \
- eval.c \
- fog.c \
- font.c \
- line.c \
- logo.c \
- nurb.c \
- oglinfo.c \
- olympic.c \
- overlay.c \
- point.c \
- prim.c \
- quad.c \
- select.c \
- shape.c \
- speed.c \
- sphere.c \
- star.c \
- stencil.c \
- stretch.c \
- texture.c \
- tri.c \
- wave.c
-
-PROGRAMS = ProgramTargetName(accum) \
- ProgramTargetName(bitmap1) \
- ProgramTargetName(bitmap2) \
- ProgramTargetName(blendeq) \
- ProgramTargetName(blendxor) \
- ProgramTargetName(copy) \
- ProgramTargetName(cursor) \
- ProgramTargetName(depth) \
- ProgramTargetName(eval) \
- ProgramTargetName(fog) \
- ProgramTargetName(font) \
- ProgramTargetName(line) \
- ProgramTargetName(logo) \
- ProgramTargetName(nurb) \
- ProgramTargetName(oglinfo) \
- ProgramTargetName(olympic) \
- ProgramTargetName(overlay) \
- ProgramTargetName(point) \
- ProgramTargetName(prim) \
- ProgramTargetName(quad) \
- ProgramTargetName(select) \
- ProgramTargetName(shape) \
- ProgramTargetName(speed) \
- ProgramTargetName(sphere) \
- ProgramTargetName(star) \
- ProgramTargetName(stencil) \
- ProgramTargetName(stretch) \
- ProgramTargetName(texture) \
- ProgramTargetName(tri) \
- ProgramTargetName(wave)
-
-AllTarget($(PROGRAMS))
-
-NormalProgramTarget(accum,accum.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(bitmap1,bitmap1.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(bitmap2,bitmap2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(blendeq,blendeq.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(blendxor,blendxor.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(copy,copy.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(cursor,cursor.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(depth,depth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(eval,eval.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(fog,fog.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(font,font.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(line,line.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(logo,logo.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(nurb,nurb.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(oglinfo,oglinfo.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(olympic,olympic.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(overlay,overlay.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(point,point.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(prim,prim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(quad,quad.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(select,select.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(shape,shape.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(speed,speed.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(sphere,sphere.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(star,star.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(stencil,stencil.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(stretch,stretch.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(texture,texture.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(tri,tri.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-NormalProgramTarget(wave,wave.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
-
-DependTarget()
-
diff --git a/progs/tests/.cvsignore b/progs/tests/.cvsignore deleted file mode 100644 index 2c0e16c35ec..00000000000 --- a/progs/tests/.cvsignore +++ /dev/null @@ -1,54 +0,0 @@ -.cvsignore -getproclist.h -antialias -arbfpspec -arbfptest1 -arbfptexture -arbfptrig -arbvptest1 -arbvptest3 -arbvptorus -arbvpwarpmesh -blendminmax -blendsquare -bufferobj -bug_3101 -bug_3195 -crossbar -cva -dinoshade -fbotest1 -fbotexture -floattex -fog -fogcoord -fptest1 -fptexture -getprocaddress -invert -manytex -multipal -no_s3tc -packedpixels -pbo -projtex -seccolor -sharedtex -stencil_wrap -stencilwrap -tex1d -texcmp -texgenmix -texline -texobjshare -texrect -texwrap -vparray -vptest1 -vptest2 -vptest3 -vptorus -vpwarpmesh -yuvrect -yuvsquare -zreaddraw diff --git a/progs/tests/Makefile b/progs/tests/Makefile deleted file mode 100644 index 7f6655dd54b..00000000000 --- a/progs/tests/Makefile +++ /dev/null @@ -1,154 +0,0 @@ -# progs/tests/Makefile - - -# These programs aren't intended to be included with the normal distro. -# They're not too interesting but they're good for testing. - -TOP = ../.. -include $(TOP)/configs/current - - -LIBS = $(APP_LIB_DEPS) - -SOURCES = \ - afsmultiarb.c \ - antialias.c \ - arbfpspec.c \ - arbfptest1.c \ - arbfptexture.c \ - arbfptrig.c \ - arbnpot.c \ - arbvptest1.c \ - arbvptest3.c \ - arbvptorus.c \ - arbvpwarpmesh.c \ - blendminmax.c \ - blendsquare.c \ - bufferobj.c \ - bug_3050.c \ - bug_3101.c \ - bug_3195.c \ - copypixrate.c \ - crossbar.c \ - cva.c \ - dinoshade.c \ - floattex.c \ - fbotest1.c \ - fbotest2.c \ - fbotexture.c \ - fog.c \ - fogcoord.c \ - fptest1.c \ - fptexture.c \ - getprocaddress.c \ - interleave.c \ - invert.c \ - jkrahntest.c \ - manytex.c \ - mipmap_limits.c \ - multipal.c \ - no_s3tc.c \ - packedpixels.c \ - pbo.c \ - projtex.c \ - readrate.c \ - seccolor.c \ - sharedtex.c \ - stencilwrap.c \ - stencil_wrap.c \ - subtexrate.c \ - tex1d.c \ - texcompress2.c \ - texfilt.c \ - texline.c \ - texobjshare.c \ - texrect.c \ - texwrap.c \ - vparray.c \ - vptest1.c \ - vptest2.c \ - vptest3.c \ - vptorus.c \ - vpwarpmesh.c \ - yuvrect.c \ - yuvsquare.c \ - zreaddraw.c - -PROGS = $(SOURCES:%.c=%) - -INCLUDES = -I. -I$(TOP)/include - -UTIL_FILES = readtex.h readtex.c - - -##### RULES ##### - -.SUFFIXES: -.SUFFIXES: .c - -.c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: $(UTIL_FILES) $(PROGS) - -clean: - rm -f $(PROGS) - rm -f *.o - rm -f getproclist.h - - -# auto code generation -getprocaddress: getprocaddress.c getproclist.h - -getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py - python getprocaddress.py > getproclist.h - -afsmultiarb: afsmultiarb.o readtex.o - $(CC) $(CFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@ - -afsmultiarb.o: afsmultiarb.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -texrect: texrect.o readtex.o - $(CC) $(CFLAGS) texrect.o readtex.o $(LIBS) -o $@ - -texrect.o: texrect.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -bug_3195: bug_3195.o readtex.o - $(CC) $(CFLAGS) bug_3195.o readtex.o $(LIBS) -o $@ - -bug_3195.o: bug_3195.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -invert: invert.o readtex.o - $(CC) $(CFLAGS) invert.o readtex.o $(LIBS) -o $@ - -invert.o: invert.c readtex.h - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -readtex.o: readtex.c - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - - -readtex.h: $(TOP)/progs/util/readtex.h - ln -s $(TOP)/progs/util/readtex.h . - -readtex.c: $(TOP)/progs/util/readtex.c - ln -s $(TOP)/progs/util/readtex.c . - - - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` diff --git a/progs/tests/Makefile.win b/progs/tests/Makefile.win deleted file mode 100644 index ff5b1e626e8..00000000000 --- a/progs/tests/Makefile.win +++ /dev/null @@ -1,44 +0,0 @@ -# $Id: Makefile.win,v 1.1 2002-01-16 01:03:25 kschultz Exp $ - -# Mesa 3-D graphics library -# Version: 3.5 -# Copyright (C) 1995-2001 Brian Paul - -# Makefile for GLUT-based demo programs for Windows - -!include <win32.mak> - -##### MACROS ##### - -TOP = .. -INCDIR = ..\include -LIBDIR = ..\lib - -SRCS = cva.c \ - dinoshade.c \ - fogcoord.c \ - manytex.c \ - multipal.c \ - projtex.c \ - seccolor.c \ -# sharedtex.c \ - texline.c \ - texwrap.c \ - vptest1.c \ - vptest2.c \ - vptest3.c \ - vptorus.c \ - vpwarpmesh.c - -!include "../mesawin32.mak" - -##### TARGETS ##### - -clean:: - -clobber:: - @del readtex.c readtex.h - -$(EXES) :$*.obj - @echo $@ - $(link) -out:$@ $* /LIBPATH:$(LIBDIR) $(LIBS) diff --git a/progs/tests/afsmultiarb.c b/progs/tests/afsmultiarb.c deleted file mode 100644 index c026ecd4ce2..00000000000 --- a/progs/tests/afsmultiarb.c +++ /dev/null @@ -1,469 +0,0 @@ -/* - * GL_ATI_fragment_shader test - * Roland Scheidegger - * - * Command line options: - * -info print GL implementation information - */ - - -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -#include "readtex.h" - -#define TEXTURE_1_FILE "../images/girl.rgb" -#define TEXTURE_2_FILE "../images/reflect.rgb" - -#define TEX0 1 -#define TEX7 8 -#define ANIMATE 10 -#define SHADER 20 -#define QUIT 100 - -static GLboolean Animate = GL_TRUE; -static GLint NumUnits = 6; -static GLboolean TexEnabled[8]; -static GLuint boringshaderID = 0; -static GLuint boring2passID = 0; -static GLboolean Shader = GL_FALSE; - -static GLfloat Drift = 0.0; -static GLfloat drift_increment = 0.005; -static GLfloat Xrot = 20.0, Yrot = 30.0, Zrot = 0.0; -static GLfloat shaderconstant[4] = {0.5, 0.0, 0.0, 0.0}; - -static void Idle( void ) -{ - if (Animate) { - GLint i; - - Drift += drift_increment; - if (Drift >= 1.0) - Drift = 0.0; - - for (i = 0; i < NumUnits; i++) { - glActiveTextureARB(GL_TEXTURE0_ARB + i); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - if (i == 0) { - glTranslatef(Drift, 0.0, 0.0); - glScalef(2, 2, 1); - } - else if (i == 1) { - glTranslatef(0.0, Drift, 0.0); - } - else { - glTranslatef(0.5, 0.5, 0.0); - glRotatef(180.0 * Drift, 0, 0, 1); - glScalef(1.0/i, 1.0/i, 1.0/i); - glTranslatef(-0.5, -0.5, 0.0); - } - } - glMatrixMode(GL_MODELVIEW); - - glutPostRedisplay(); - } -} - - -static void DrawObject(void) -{ - GLint i; - GLint j; - static const GLfloat tex_coords[] = { 0.0, 0.0, 1.0, 1.0, 0.0 }; - static const GLfloat vtx_coords[] = { -1.0, -1.0, 1.0, 1.0, -1.0 }; - - if (!TexEnabled[0] && !TexEnabled[1]) - glColor3f(0.1, 0.1, 0.1); /* add onto this */ - else - glColor3f(1, 1, 1); /* modulate this */ - - glBegin(GL_QUADS); - - /* Toggle between the vector and scalar entry points. This is done purely - * to hit multiple paths in the driver. - */ - if ( Drift > 0.49 ) { - for (j = 0; j < 4; j++ ) { - for (i = 0; i < NumUnits; i++) - glMultiTexCoord2fARB(GL_TEXTURE0_ARB + i, - tex_coords[j], tex_coords[j+1]); - glVertex2f( vtx_coords[j], vtx_coords[j+1] ); - } - } - else { - for (j = 0; j < 4; j++ ) { - for (i = 0; i < NumUnits; i++) - glMultiTexCoord2fvARB(GL_TEXTURE0_ARB + i, & tex_coords[j]); - glVertex2fv( & vtx_coords[j] ); - } - } - - glEnd(); -} - - - -static void Display( void ) -{ - static GLint T0 = 0; - static GLint Frames = 0; - GLint t; - - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glScalef(5.0, 5.0, 5.0); - DrawObject(); - glPopMatrix(); - - glutSwapBuffers(); - - Frames++; - - t = glutGet(GLUT_ELAPSED_TIME); - if (t - T0 >= 2500) { - GLfloat seconds = (t - T0) / 1000.0; - GLfloat fps = Frames / seconds; - drift_increment = 2.2 * seconds / Frames; - printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps); - T0 = t; - Frames = 0; - } -} - - -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, 10.0, 100.0 ); - /*glOrtho( -6.0, 6.0, -6.0, 6.0, 10.0, 100.0 );*/ - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -70.0 ); -} - - -static void ModeMenu(int entry) -{ - if (entry >= TEX0 && entry <= TEX7) { - /* toggle */ - GLint i = entry - TEX0; - TexEnabled[i] = !TexEnabled[i]; - glActiveTextureARB(GL_TEXTURE0_ARB + i); - if (TexEnabled[i]) - glEnable(GL_TEXTURE_2D); - else - glDisable(GL_TEXTURE_2D); - printf("Enabled: "); - for (i = 0; i < NumUnits; i++) - printf("%d ", (int) TexEnabled[i]); - printf("\n"); - } - else if (entry==ANIMATE) { - Animate = !Animate; - } - else if (entry==SHADER) { - Shader = !Shader; - if (Shader) { - fprintf(stderr, "using 2-pass shader\n"); - glBindFragmentShaderATI(boring2passID); - } - else { - fprintf(stderr, "using 1-pass shader\n"); - glBindFragmentShaderATI(boringshaderID); - } - } - else if (entry==QUIT) { - exit(0); - } - - glutPostRedisplay(); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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( int argc, char *argv[] ) -{ - GLuint texObj[8]; - GLint size, i; - - const char *exten = (const char *) glGetString(GL_EXTENSIONS); - if (!strstr(exten, "GL_ATI_fragment_shader")) { - printf("Sorry, GL_ATI_fragment_shader not supported by this renderer.\n"); - exit(1); - } - - - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size); - printf("%d x %d max texture size\n", size, size); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - for (i = 0; i < NumUnits; i++) { - if (i < 6) - TexEnabled[i] = GL_TRUE; - else - TexEnabled[i] = GL_FALSE; - } - - /* allocate two texture objects */ - glGenTextures(NumUnits, texObj); - - /* setup the texture objects */ - for (i = 0; i < NumUnits; i++) { - - glActiveTextureARB(GL_TEXTURE0_ARB + i); - glBindTexture(GL_TEXTURE_2D, texObj[i]); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - if (i == 0) { - if (!LoadRGBMipmaps(TEXTURE_1_FILE, GL_RGB)) { - printf("Error: couldn't load texture image\n"); - exit(1); - } - } - else if (i == 1) { - if (!LoadRGBMipmaps(TEXTURE_2_FILE, GL_RGB)) { - printf("Error: couldn't load texture image\n"); - exit(1); - } - } - else { - /* checker */ - GLubyte image[8][8][3]; - GLint i, j; - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) { - if ((i + j) & 1) { - image[i][j][0] = 50; - image[i][j][1] = 50; - image[i][j][2] = 50; - } - else { - image[i][j][0] = 25; - image[i][j][1] = 25; - image[i][j][2] = 25; - } - } - } - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0, - GL_RGB, GL_UNSIGNED_BYTE, (GLvoid *) image); - } - - /* Bind texObj[i] to ith texture unit */ -/* if (i < 2) - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - else - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);*/ - - if (TexEnabled[i]) - glEnable(GL_TEXTURE_2D); - } - - boringshaderID = glGenFragmentShadersATI(1); - boring2passID = glGenFragmentShadersATI(1); - if (boring2passID == 0) - { - fprintf(stderr, "couldn't get frag shader id\n"); - exit(1); - } - glBindFragmentShaderATI(boringshaderID); -/* maybe not the most creative shader but at least I know how it should look like! */ - glBeginFragmentShaderATI(); - glSampleMapATI(GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI); - glSampleMapATI(GL_REG_1_ATI, GL_TEXTURE1_ARB, GL_SWIZZLE_STR_ATI); - glSampleMapATI(GL_REG_2_ATI, GL_TEXTURE2_ARB, GL_SWIZZLE_STR_ATI); - glSampleMapATI(GL_REG_3_ATI, GL_TEXTURE3_ARB, GL_SWIZZLE_STR_ATI); - glSampleMapATI(GL_REG_4_ATI, GL_TEXTURE4_ARB, GL_SWIZZLE_STR_ATI); - glSampleMapATI(GL_REG_5_ATI, GL_TEXTURE5_ARB, GL_SWIZZLE_STR_ATI); - glColorFragmentOp2ATI(GL_MUL_ATI, - GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_PRIMARY_COLOR, GL_NONE, GL_NONE); - glAlphaFragmentOp1ATI(GL_MOV_ATI, - GL_REG_0_ATI, GL_NONE, - GL_PRIMARY_COLOR, GL_NONE, GL_NONE); - glColorFragmentOp3ATI(GL_MAD_ATI, - GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_REG_1_ATI, GL_NONE, GL_NONE, - GL_REG_2_ATI, GL_NONE, GL_NONE); - glColorFragmentOp2ATI(GL_ADD_ATI, - GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_REG_3_ATI, GL_NONE, GL_NONE); - glColorFragmentOp2ATI(GL_ADD_ATI, - GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_REG_4_ATI, GL_NONE, GL_NONE); - glColorFragmentOp2ATI(GL_ADD_ATI, - GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_REG_5_ATI, GL_NONE, GL_NONE); - glEndFragmentShaderATI(); - -/* mathematically equivalent to first shader but using 2 passes together with - some tex coord rerouting */ - glBindFragmentShaderATI(boring2passID); - glBeginFragmentShaderATI(); - glPassTexCoordATI(GL_REG_1_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI); - glSampleMapATI(GL_REG_2_ATI, GL_TEXTURE2_ARB, GL_SWIZZLE_STR_ATI); - glSampleMapATI(GL_REG_3_ATI, GL_TEXTURE3_ARB, GL_SWIZZLE_STR_ATI); - glSampleMapATI(GL_REG_4_ATI, GL_TEXTURE4_ARB, GL_SWIZZLE_STR_ATI); - glSampleMapATI(GL_REG_5_ATI, GL_TEXTURE5_ARB, GL_SWIZZLE_STR_ATI); - glColorFragmentOp2ATI(GL_ADD_ATI, - GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI, - GL_REG_2_ATI, GL_NONE, GL_NONE, - GL_REG_3_ATI, GL_NONE, GL_NONE); - glColorFragmentOp2ATI(GL_ADD_ATI, - GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_REG_4_ATI, GL_NONE, GL_NONE); - glColorFragmentOp2ATI(GL_ADD_ATI, - GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_REG_5_ATI, GL_NONE, GL_NONE); - /* not really a dependant read */ - glSampleMapATI(GL_REG_0_ATI, GL_REG_1_ATI, GL_SWIZZLE_STR_ATI); - glSampleMapATI(GL_REG_1_ATI, GL_TEXTURE1_ARB, GL_SWIZZLE_STR_ATI); - glPassTexCoordATI(GL_REG_5_ATI, GL_REG_0_ATI, GL_SWIZZLE_STR_ATI); - glColorFragmentOp2ATI(GL_MUL_ATI, - GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_PRIMARY_COLOR, GL_NONE, GL_NONE); - glAlphaFragmentOp1ATI(GL_MOV_ATI, - GL_REG_0_ATI, GL_NONE, - GL_PRIMARY_COLOR, GL_NONE, GL_NONE); - glColorFragmentOp3ATI(GL_MAD_ATI, - GL_REG_0_ATI, GL_NONE, GL_SATURATE_BIT_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_REG_1_ATI, GL_NONE, GL_NONE, - GL_REG_5_ATI, GL_NONE, GL_NONE); - /* in principle we're finished here, but to test a bit more - we do some fun with dot ops, replication et al. */ - glSetFragmentShaderConstantATI(GL_CON_3_ATI, shaderconstant); - glColorFragmentOp2ATI(GL_DOT4_ATI, - GL_REG_3_ATI, GL_GREEN_BIT_ATI, GL_EIGHTH_BIT_ATI, - GL_ZERO, GL_NONE, GL_COMP_BIT_ATI | GL_NEGATE_BIT_ATI, - GL_CON_3_ATI, GL_RED, GL_2X_BIT_ATI); - /* those args must get ignored, except dstReg */ - glAlphaFragmentOp2ATI(GL_DOT4_ATI, - GL_REG_4_ATI, GL_NONE, - GL_ZERO, GL_NONE, GL_NONE, - GL_ZERO, GL_NONE, GL_NONE); - /* -> reg3 g = reg4 alpha = -0.5 */ - glAlphaFragmentOp2ATI(GL_ADD_ATI, - GL_REG_5_ATI, GL_NONE, - GL_REG_3_ATI, GL_GREEN, GL_NONE, - GL_REG_4_ATI, GL_NONE, GL_NONE); - /* -> reg5 a = -1 */ - glColorFragmentOp3ATI(GL_DOT2_ADD_ATI, - GL_REG_4_ATI, GL_BLUE_BIT_ATI, GL_HALF_BIT_ATI, - GL_REG_5_ATI, GL_ALPHA, GL_NEGATE_BIT_ATI, - GL_ONE, GL_NONE, GL_BIAS_BIT_ATI, - GL_ONE, GL_ALPHA, GL_2X_BIT_ATI | GL_NEGATE_BIT_ATI); - /* -> reg 4 b = -0.5 */ - glColorFragmentOp2ATI(GL_MUL_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE, - GL_REG_4_ATI, GL_BLUE, GL_NEGATE_BIT_ATI | GL_2X_BIT_ATI, - GL_REG_0_ATI, GL_NONE, GL_NONE); - glEndFragmentShaderATI(); - - glBindFragmentShaderATI(boringshaderID); - glEnable(GL_FRAGMENT_SHADER_ATI); - - glShadeModel(GL_FLAT); - glClearColor(0.3, 0.3, 0.4, 1.0); - - if (argc > 1 && strcmp(argv[1], "-info")==0) { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - } - printf("output should be identical with both shaders to multiarb demo when 6 textures are enabled\n"); -} - - -int main( int argc, char *argv[] ) -{ -/* GLint i;*/ - - glutInit( &argc, argv ); - glutInitWindowSize( 300, 300 ); - glutInitWindowPosition( 0, 0 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0] ); - - Init( argc, argv ); - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - glutIdleFunc( Idle ); - - glutCreateMenu(ModeMenu); - -/* for (i = 0; i < NumUnits; i++) { - char s[100]; - sprintf(s, "Toggle Texture %d", i); - glutAddMenuEntry(s, TEX0 + i); - }*/ - glutAddMenuEntry("Toggle 1/2 Pass Shader", SHADER); - glutAddMenuEntry("Toggle Animation", ANIMATE); - glutAddMenuEntry("Quit", QUIT); - glutAttachMenu(GLUT_RIGHT_BUTTON); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/antialias.c b/progs/tests/antialias.c deleted file mode 100644 index d8269a3ee12..00000000000 --- a/progs/tests/antialias.c +++ /dev/null @@ -1,229 +0,0 @@ -/* $Id: antialias.c,v 1.2 2003-03-29 16:42:57 brianp Exp $ */ - -/* - * Test multisampling and polygon smoothing. - * - * Brian Paul - * 4 November 2002 - */ - -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - - -static GLfloat Zrot = 0; -static GLboolean Anim = GL_TRUE; -static GLboolean HaveMultisample = GL_TRUE; - - -static void -PrintString(const char *s) -{ - while (*s) { - glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); - s++; - } -} - - -static void -Polygon( GLint verts, GLfloat radius, GLfloat z ) -{ - int i; - for (i = 0; i < verts; i++) { - float a = (i * 2.0 * 3.14159) / verts; - float x = radius * cos(a); - float y = radius * sin(a); - glVertex3f(x, y, z); - } -} - - -static void -DrawObject( void ) -{ - glLineWidth(3.0); - glColor3f(1, 1, 1); - glBegin(GL_LINE_LOOP); - Polygon(12, 1.2, 0); - glEnd(); - - glLineWidth(1.0); - glColor3f(1, 1, 1); - glBegin(GL_LINE_LOOP); - Polygon(12, 1.1, 0); - glEnd(); - - glColor3f(1, 0, 0); - glBegin(GL_POLYGON); - Polygon(12, 0.4, 0.3); - glEnd(); - - glColor3f(0, 1, 0); - glBegin(GL_POLYGON); - Polygon(12, 0.6, 0.2); - glEnd(); - - glColor3f(0, 0, 1); - glBegin(GL_POLYGON); - Polygon(12, 0.8, 0.1); - glEnd(); - - glColor3f(1, 1, 1); - glBegin(GL_POLYGON); - Polygon(12, 1.0, 0); - glEnd(); -} - - -static void -Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glColor3f(1, 1, 1); - if (HaveMultisample) { - glRasterPos2f(-3.1, -1.6); - PrintString("MULTISAMPLE"); - } - glRasterPos2f(-0.8, -1.6); - PrintString("No antialiasing"); - glRasterPos2f(1.6, -1.6); - PrintString("GL_POLYGON_SMOOTH"); - - /* multisample */ - if (HaveMultisample) { - glEnable(GL_DEPTH_TEST); - glEnable(GL_MULTISAMPLE_ARB); - glPushMatrix(); - glTranslatef(-2.5, 0, 0); - glPushMatrix(); - glRotatef(Zrot, 0, 0, 1); - DrawObject(); - glPopMatrix(); - glPopMatrix(); - glDisable(GL_MULTISAMPLE_ARB); - glDisable(GL_DEPTH_TEST); - } - - /* non-aa */ - glEnable(GL_DEPTH_TEST); - glPushMatrix(); - glTranslatef(0, 0, 0); - glPushMatrix(); - glRotatef(Zrot, 0, 0, 1); - DrawObject(); - glPopMatrix(); - glPopMatrix(); - glDisable(GL_DEPTH_TEST); - - /* polygon smooth */ - glEnable(GL_POLYGON_SMOOTH); - glEnable(GL_LINE_SMOOTH); - glEnable(GL_BLEND); - glPushMatrix(); - glTranslatef(2.5, 0, 0); - glPushMatrix(); - glRotatef(Zrot, 0, 0, 1); - DrawObject(); - glPopMatrix(); - glPopMatrix(); - glDisable(GL_LINE_SMOOTH); - glDisable(GL_POLYGON_SMOOTH); - glDisable(GL_BLEND); - - glutSwapBuffers(); -} - - -static void -Reshape( int width, int height ) -{ - GLfloat ar = (float) width / (float) height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(-2.0*ar, 2.0*ar, -2.0, 2.0, -1.0, 1.0); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -} - - -static void -Idle( void ) -{ - Zrot = 0.01 * glutGet(GLUT_ELAPSED_TIME); - glutPostRedisplay(); -} - - -static void -Key( unsigned char key, int x, int y ) -{ - const GLfloat step = 1.0; - (void) x; - (void) y; - switch (key) { - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 'z': - Zrot = (int) (Zrot - step); - break; - case 'Z': - Zrot = (int) (Zrot + step); - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void -Init( void ) -{ - /* GLUT imposes the four samples/pixel requirement */ - int s; - glGetIntegerv(GL_SAMPLES_ARB, &s); - if (!glutExtensionSupported("GL_ARB_multisample") || s < 1) { - printf("Warning: multisample antialiasing not supported.\n"); - HaveMultisample = GL_FALSE; - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_SAMPLES_ARB = %d\n", s); - - glBlendFunc(GL_SRC_ALPHA, GL_ONE); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE); - - glGetIntegerv(GL_MULTISAMPLE_ARB, &s); - printf("GL_MULTISAMPLE_ARB = %d\n", s); -} - - -int -main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 600, 300 ); - glutInitDisplayMode( GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE | - GLUT_DEPTH | GLUT_MULTISAMPLE ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc( Idle ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/api_speed.c b/progs/tests/api_speed.c deleted file mode 100644 index aed65b35fe3..00000000000 --- a/progs/tests/api_speed.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2002 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. - */ - -/** - * \file api_speed.c - * Simple test to measure the overhead of making GL calls. - * - * The main purpose of this test is to measure the difference in calling - * overhead of different dispatch methods. Since it uses asm/timex.h to - * access the Pentium's cycle counters, it will probably only compile on - * Linux (though most architectures have a get_cycles function in timex.h). - * That is why it isn't in the default Makefile. - * - * \author Ian Romanick <[email protected]> - */ - -#include <stdio.h> -#include <stdlib.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/gl.h> -#include <GL/glext.h> -#include <GL/glut.h> - -#define inline __inline__ -#include <asm/timex.h> - -static float Width = 400; -static float Height = 400; -static unsigned count = 1000000; - - -static void Idle( void ) -{ - glutPostRedisplay(); -} - -#define DO_FUNC(f,p) \ - do { \ - t0 = get_cycles(); \ - for ( i = 0 ; i < count ; i++ ) { \ - f p ; \ - } \ - t1 = get_cycles(); \ - printf("%u calls to % 20s required %llu cycles.\n", count, # f, t1 - t0); \ - } while( 0 ) - -/** - * Main display function. This is the place to add more API calls. - */ -static void Display( void ) -{ - int i; - const float v[3] = { 1.0, 0.0, 0.0 }; - cycles_t t0; - cycles_t t1; - - glBegin(GL_TRIANGLE_STRIP); - - DO_FUNC( glColor3fv, (v) ); - DO_FUNC( glNormal3fv, (v) ); - DO_FUNC( glTexCoord2fv, (v) ); - DO_FUNC( glTexCoord3fv, (v) ); - DO_FUNC( glMultiTexCoord2fv, (GL_TEXTURE0, v) ); - DO_FUNC( glMultiTexCoord2f, (GL_TEXTURE0, 0.0, 0.0) ); - DO_FUNC( glFogCoordfvEXT, (v) ); - DO_FUNC( glFogCoordfEXT, (0.5) ); - - glEnd(); - - exit(0); -} - - -static void Reshape( int width, int height ) -{ - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(0.0, width, 0.0, height, -1.0, 1.0); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowSize( (int) Width, (int) Height ); - glutInitWindowPosition( 0, 0 ); - - glutInitDisplayMode( GLUT_RGB ); - - glutCreateWindow( argv[0] ); - - if ( argc > 1 ) { - count = strtoul( argv[1], NULL, 0 ); - if ( count == 0 ) { - fprintf( stderr, "Usage: %s [iterations]\n", argv[0] ); - exit(1); - } - } - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - glutIdleFunc( Idle ); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/api_speed.py b/progs/tests/api_speed.py deleted file mode 100755 index 0ddaf5836c9..00000000000 --- a/progs/tests/api_speed.py +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env python2 - -# (C) Copyright IBM Corporation 2004 -# 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 -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, 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 (including the next -# paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS 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. -# -# Authors: -# Ian Romanick <[email protected]> - - -# This script is used to run api_speed against several different libGL -# libraries and compare the results. See the show_usage function for more -# details on how to use it. - - -import re, os, sys, getopt - -class results: - def process_file(self, f): - self.cycles = {} - self.iterations = -1 - - for line in f.readlines(): - m = re.match("(\d+) calls to (.{20}) required (\d+) cycles.", line) - - if self.iterations != -1 and int(m.group(1)) != self.iterations: - raise - - # This could be done with lstrip, but the version of - # the Python library on my system doesn't have it. - # The installed version of Python is quite old. :( - - temp = m.group(2) - function_name = None - for i in range(len(temp)): - if temp[i] != ' ': - function_name = temp[i:] - break - - if function_name == None: - raise - - self.cycles[ function_name ] = int(m.group(3)) - self.iterations = int(m.group(1)) - - - def show_results(self): - for name in self.cycles: - print "%s -> %f" % (name, float(self.cycles[name]) / self.iterations) - - - def compare_results(self, other): - for name in self.cycles: - if other.cycles.has_key(name): - a = float(self.cycles[name]) / float(self.iterations) - b = float(other.cycles[name]) / float(other.iterations) - if abs( a ) < 0.000001: - print "a = %f, b = %f" % (a, b) - else: - p = (100.0 * b / a) - 100.0 - print "%- 20s %7.2f - %7.2f = % -6.2f (%+.1f%%)" % (name, a, b, a - b, p) - return - - -def make_execution_string(lib, iterations): - if lib == None: - return "./api_speed %u" % (iterations) - else: - return "LD_PRELOAD=%s ./api_speed %u" % (lib, iterations) - - -def show_usage(): - print """Usage: %s [-i iterations] {library ...} - -The full path to one or more libGL libraries (including the full name of the -library) can be included on the command-line. Each library will be tested, -and the results compared. The first library listed will be used as the -"base line" for all comparisons.""" % (sys.argv[0]) - sys.exit(1) - - -if __name__ == '__main__': - try: - (args, trail) = getopt.getopt(sys.argv[1:], "i:") - except Exception,e: - show_usage() - - iterations = 1000000 - try: - for (arg,val) in args: - if arg == "-i": - iterations = int(val) - except Exception,e: - show_usage() - - - # If no libraries were specifically named, just run the test against - # the default system libGL. - - if len(trail) == 0: - trail.append(None) - - - result_array = [] - names = [] - - for lib in trail: - s = make_execution_string( lib, iterations ) - r = results() - r.process_file( os.popen(s) ) - names.append(lib) - result_array.append(r) - - - # If the test was only run against one library, just show the results - # of the test run. Otherwise, compare each successive run against - # the first run. - - if len( result_array ) == 1: - result_array[0].show_results() - else: - for i in range(1, len( result_array )): - print "%s vs. %s" % (names[0], names[i]) - result_array[0].compare_results( result_array[i] ) - print "" diff --git a/progs/tests/arbfpspec.c b/progs/tests/arbfpspec.c deleted file mode 100644 index eac2a9100f5..00000000000 --- a/progs/tests/arbfpspec.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - * To demo that specular color gets lost someplace after vertex - * program completion and fragment program startup - */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0; -static GLboolean Anim = GL_TRUE; - - -static void Idle( void ) -{ - Xrot += .3; - Yrot += .4; - Zrot += .2; - glutPostRedisplay(); -} - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1, 0, 0); - glRotatef(Yrot, 0, 1, 0); - glRotatef(Zrot, 0, 0, 1); - glutSolidTorus(0.75, 2.0, 10, 20); - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -12.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case ' ': - Xrot = Yrot = Zrot = 0; - break; - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 'z': - Zrot -= 5.0; - break; - case 'Z': - Zrot += 5.0; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - const GLfloat step = 3.0; - (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 ) -{ - GLint errno; - GLuint prognum, fprognum; - - static const char prog[] = - "!!ARBvp1.0\n" - "DP4 result.position.x, state.matrix.mvp.row[0], vertex.position ;\n" - "DP4 result.position.y, state.matrix.mvp.row[1], vertex.position ;\n" - "DP4 result.position.z, state.matrix.mvp.row[2], vertex.position ;\n" - "DP4 result.position.w, state.matrix.mvp.row[3], vertex.position ;\n" - "MOV result.color.front.primary, {.5, .5, .5, 1};\n" - "MOV result.color.front.secondary, {1, 1, 1, 1};\n" - "END"; - - static const char fprog[] = - "!!ARBfp1.0\n" - "MOV result.color, fragment.color.secondary;\n" - "END"; - - if (!glutExtensionSupported("GL_ARB_vertex_program")) { - printf("Sorry, this program requires GL_ARB_vertex_program"); - exit(1); - } - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Sorry, this program requires GL_ARB_fragment_program"); - exit(1); - } - - glGenProgramsARB(1, &prognum); - glGenProgramsARB(1, &fprognum); - - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog), (const GLubyte *) prog); - - assert(glIsProgramARB(prognum)); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } - - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, fprognum); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(fprog), (const GLubyte *) fprog); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } - - glEnable(GL_VERTEX_PROGRAM_ARB); - glEnable(GL_FRAGMENT_PROGRAM_ARB); - glEnable(GL_DEPTH_TEST); - glClearColor(0.3, 0.3, 0.3, 1); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc(Idle); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/arbfptest1.c b/progs/tests/arbfptest1.c deleted file mode 100644 index 45d05125b26..00000000000 --- a/progs/tests/arbfptest1.c +++ /dev/null @@ -1,210 +0,0 @@ -/* Test GL_ARB_fragment_program */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - - glColor4f(0, 0.5, 0, 1); - glColor4f(0, 1, 0, 1); - glBegin(GL_POLYGON); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 0, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -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.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - -static void load_program(const char *prog, GLuint prognum) -{ - int a; - GLint errorpos, errno; - - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, prognum); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog), (const GLubyte *) prog); - - assert(glIsProgramARB(prognum)); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - for (a=-10; a<10; a++) - { - if ((errorpos+a < 0) || (errorpos+a >= strlen(prog))) continue; - printf("%c", prog[errorpos+a]); - } - printf("\n"); - exit(1); - } -} - -static void Init( void ) -{ - static const char *prog0 = - "!!ARBfp1.0\n" - "TEMP R0, RC, HC, H0, H1, H2, H3, H30 ;\n" - "MUL result.color, R0, fragment.position; \n" - "ADD result.color, H3, fragment.texcoord; \n" - "ADD_SAT result.color, H3, fragment.texcoord; \n" - "MUL result.color.xy, R0.wzyx, fragment.position; \n" - "MUL result.color, H0, fragment.position; \n" - "MUL result.color, -H0, fragment.position; \n" - "MOV RC, H1; \n" - "MOV HC, H2; \n" - "END \n" - ; - /* masked updates, defines, declarations */ - static const char *prog1 = - "!!ARBfp1.0\n" - "PARAM foo = {1., 2., 3., 4.}; \n" - "PARAM foo2 = 5.; \n" - "PARAM foo3 = {5., 6., 7., 8.}; \n" - "PARAM bar = 3.; \n" - "TEMP R0, R1, RC, EQ, NE, bar2; \n" - "ALIAS bar3 = bar; \n" - "MOV result.color.xy, R0; \n" - "MOV result.color, R0; \n" - "MOV result.color.xyzw, R0; \n" - "MOV result.color.xy, R0; \n" - "MOV RC.x, R1.x; \n" - "KIL NE; \n" - "KIL EQ.xyxy; \n" - "END \n" - ; - - /* texture instructions */ - static const char *prog2 = - "!!ARBfp1.0\n" - "TEMP R0, R1, R2, R3;\n" - "TEX R0, fragment.texcoord, texture[1], 2D; \n" - "TEX R1, fragment.texcoord[1], texture[1], CUBE; \n" - "TEX R2, fragment.texcoord[2], texture[2], 3D; \n" - "TXP R3, fragment.texcoord[3], texture[3], RECT; \n" - "MUL result.color, R0, fragment.color; \n" - "END \n" - ; - - /* test negation, absolute value */ - static const char *prog3 = - "!!ARBfp1.0\n" - "TEMP R0, R1;\n" - "MOV R0, R1; \n" - "MOV R0, -R1; \n" - "MOV result.color, R0; \n" - "END \n" - ; - - /* literal constant sources */ - static const char *prog4 = - "!!ARBfp1.0\n" - "TEMP R0, R1;\n" - "PARAM Pi = 3.14159; \n" - "MOV R0, {1., -2., +3., 4.}; \n" - "MOV R0, 5.; \n" - "MOV R0, -5.; \n" - "MOV R0, 5.; \n" - "MOV R0, Pi; \n" - "MOV result.color, R0; \n" - "END \n" - ; - - /* change the fragment color in a simple way */ - static const char *prog10 = - "!!ARBfp1.0\n" - "PARAM blue = {0., 0., 1., 0.};\n" - "PARAM color = {1., 0., 0., 1.};\n" - "TEMP R0; \n" - "MOV R0, fragment.color; \n" - "#ADD result.color, R0, fragment.color; \n" - "#ADD result.color, blue, fragment.color; \n" - "#ADD result.color, {1., 0., 0., 0.}, fragment.color; \n" - "ADD result.color, color, fragment.color; \n" - "END \n" - ; - - GLuint progs[20]; - - glGenProgramsARB(20, progs); - assert(progs[0]); - assert(progs[1]); - assert(progs[0] != progs[1]); - - - printf("program 0:\n"); - load_program(prog0, progs[0]); - printf("program 1:\n"); - load_program(prog1, progs[1]); - printf("program 2:\n"); - load_program(prog2, progs[2]); - printf("program 3:\n"); - load_program(prog3, progs[3]); - printf("program 4:\n"); - load_program(prog4, progs[4]); - printf("program 10:\n"); - load_program(prog10, progs[5]); - - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - glEnable(GL_ALPHA_TEST); - glAlphaFunc(GL_ALWAYS, 0.0); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/arbfptexture.c b/progs/tests/arbfptexture.c deleted file mode 100644 index a854908c311..00000000000 --- a/progs/tests/arbfptexture.c +++ /dev/null @@ -1,153 +0,0 @@ -/* GL_ARB_fragment_program texture test */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -#include "readtex.c" - - -#define TEXTURE_FILE "../images/girl.rgb" - -static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0; - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - - glBegin(GL_POLYGON); -#define Q 2 - glColor4f(1.0, 1.0, 1.0, 1); glTexCoord4f(0, 0, 0, Q); glVertex2f(-1, -1); - glColor4f(0.2, 0.2, 1.0, 1); glTexCoord4f(1, 0, 0, Q); glVertex2f( 1, -1); - glColor4f(0.2, 1.0, 0.2, 1); glTexCoord4f(1, 1, 0, Q); glVertex2f( 1, 1); - glColor4f(1.0, 0.2, 0.2, 1); glTexCoord4f(0, 1, 0, Q); glVertex2f(-1, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -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.0, 0.0, -8.0 ); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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 Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "TEX R0, fragment.texcoord[0], texture[0], 2D; \n" - "MUL result.color, R0, fragment.color; \n" - "END" - ; - GLuint modulateProg; - GLuint Texture; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - assert(glIsProgramARB(modulateProg)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - /* Load texture */ - glGenTextures(1, &Texture); - glBindTexture(GL_TEXTURE_2D, Texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) { - printf("Error: couldn't load texture image file %s\n", TEXTURE_FILE); - exit(1); - } - /* XXX this enable shouldn't really be needed!!! */ - glEnable(GL_TEXTURE_2D); - - glClearColor(.3, .3, .3, 0); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/arbfptrig.c b/progs/tests/arbfptrig.c deleted file mode 100644 index 26b68c6b412..00000000000 --- a/progs/tests/arbfptrig.c +++ /dev/null @@ -1,156 +0,0 @@ -/* GL_ARB_fragment_program texture test */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -#include "readtex.c" - - -#define TEXTURE_FILE "../images/girl.rgb" - -static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0; - -#define PI 3.141592 - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - - glBegin(GL_POLYGON); - glTexCoord2f(-PI, 0); glVertex2f(-1, -1); - glTexCoord2f(PI, 0); glVertex2f( 1, -1); - glTexCoord2f(PI, 1); glVertex2f( 1, 1); - glTexCoord2f(-PI, 1); glVertex2f(-1, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -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.0, 0.0, -8.0 ); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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 Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - static const char *modulate2D = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "MOV R0, {0,0,0,1};\n" - "SCS R0, fragment.texcoord[0].x; \n" - "ADD R0, R0, {1.0}.x;\n" - "MUL R0, R0, {0.5}.x;\n" - "MOV result.color, R0; \n" - "END" - ; - GLuint modulateProg; - GLuint Texture; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulate2D), (const GLubyte *)modulate2D); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - assert(glIsProgramARB(modulateProg)); - - glEnable(GL_FRAGMENT_PROGRAM_ARB); - - /* Load texture */ - glGenTextures(1, &Texture); - glBindTexture(GL_TEXTURE_2D, Texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) { - printf("Error: couldn't load texture image file %s\n", TEXTURE_FILE); - exit(1); - } - /* XXX this enable shouldn't really be needed!!! */ - glEnable(GL_TEXTURE_2D); - - glClearColor(.3, .3, .3, 0); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/arbnpot.c b/progs/tests/arbnpot.c deleted file mode 100644 index 8107717e271..00000000000 --- a/progs/tests/arbnpot.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Test NPOT textures with the GL_ARB_texture_non_power_of_two extension. - * Brian Paul - * 2 July 2003 - */ - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> -#include "../util/readtex.c" - -#define IMAGE_FILE "../images/girl.rgb" - -static GLfloat Zrot = 0; - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Zrot, 0, 0, 1); - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); - glVertex2f(-1, -1); - glTexCoord2f(1, 0); - glVertex2f(1, -1); - glTexCoord2f(1, 1); - glVertex2f(1, 1); - glTexCoord2f(0, 1); - glVertex2f(-1, 1); - glEnd(); - glPopMatrix(); - - glutSwapBuffers(); -} - - -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.0, 0.0, -7.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'z': - Zrot -= 1.0; - break; - case 'Z': - Zrot += 1.0; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - GLubyte *image; - int imgWidth, imgHeight, minDim, w; - GLenum imgFormat; - - if (!glutExtensionSupported("GL_ARB_texture_non_power_of_two")) { - printf("Sorry, this program requires GL_ARB_texture_non_power_of_two\n"); - exit(1); - } - -#if 1 - image = LoadRGBImage( IMAGE_FILE, &imgWidth, &imgHeight, &imgFormat ); - if (!image) { - printf("Couldn't read %s\n", IMAGE_FILE); - exit(0); - } -#else - int i, j; - imgFormat = GL_RGB; - imgWidth = 3; - imgHeight = 3; - image = malloc(imgWidth * imgHeight * 3); - for (i = 0; i < imgHeight; i++) { - for (j = 0; j < imgWidth; j++) { - int k = (i * imgWidth + j) * 3; - if ((i + j) & 1) { - image[k+0] = 255; - image[k+1] = 0; - image[k+2] = 0; - } - else { - image[k+0] = 0; - image[k+1] = 255; - image[k+2] = 0; - } - } - } -#endif - - printf("Read %d x %d\n", imgWidth, imgHeight); - - minDim = imgWidth < imgHeight ? imgWidth : imgHeight; - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexImage1D(GL_TEXTURE_1D, 0, GL_RGB, imgWidth, 0, - imgFormat, GL_UNSIGNED_BYTE, image); - assert(glGetError() == GL_NO_ERROR); - - glTexImage1D(GL_PROXY_TEXTURE_1D, 0, GL_RGB, imgWidth, 0, - imgFormat, GL_UNSIGNED_BYTE, image); - glGetTexLevelParameteriv(GL_PROXY_TEXTURE_1D, 0, GL_TEXTURE_WIDTH, &w); - assert(w == imgWidth); - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, imgWidth, imgHeight, 0, - imgFormat, GL_UNSIGNED_BYTE, image); - assert(glGetError() == GL_NO_ERROR); - - glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGB, imgWidth, imgHeight, 0, - imgFormat, GL_UNSIGNED_BYTE, image); - glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w); - assert(w == imgWidth); - - glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB, imgWidth, imgHeight, 1, 0, - imgFormat, GL_UNSIGNED_BYTE, image); - assert(glGetError() == GL_NO_ERROR); - - glTexImage3D(GL_PROXY_TEXTURE_3D, 0, GL_RGB, imgWidth, imgHeight, 1, 0, - imgFormat, GL_UNSIGNED_BYTE, image); - glGetTexLevelParameteriv(GL_PROXY_TEXTURE_3D, 0, GL_TEXTURE_WIDTH, &w); - assert(w == imgWidth); - - glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGB, - minDim, minDim, 0, - imgFormat, GL_UNSIGNED_BYTE, image); - assert(glGetError() == GL_NO_ERROR); - - glTexImage2D(GL_PROXY_TEXTURE_CUBE_MAP, 0, GL_RGB, - minDim, minDim, 0, - imgFormat, GL_UNSIGNED_BYTE, image); - glGetTexLevelParameteriv(GL_PROXY_TEXTURE_CUBE_MAP, 0, GL_TEXTURE_WIDTH, &w); - assert(w == minDim); - - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glEnable(GL_TEXTURE_2D); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 400, 400 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/arbvptest1.c b/progs/tests/arbvptest1.c deleted file mode 100644 index 0ebd3987f58..00000000000 --- a/progs/tests/arbvptest1.c +++ /dev/null @@ -1,164 +0,0 @@ -/* Test glGenProgramsARB(), glIsProgramARB(), glLoadProgramARB() */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - - glBegin(GL_POLYGON); - glVertexAttrib2fARB(0, -1, -1); - glVertexAttrib2fARB(0, 1, -1); - glVertexAttrib2fARB(0, 0, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -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.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - -static void load_program(const char *prog, GLuint prognum) -{ - int a; - GLint errorpos, errno; - - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog), (const GLubyte *) prog); - - assert(glIsProgramARB(prognum)); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - - for (a=-10; a<10; a++) - { - if ((errorpos+a < 0) || (errorpos+a >= strlen(prog))) continue; - printf("%c", prog[errorpos+a]); - } - printf("\n"); - exit(1); - } -} - -static void Init( void ) -{ - GLuint prognum[4]; - - static const char *prog1 = - "!!ARBvp1.0\n" - "TEMP R0;\n" - "MUL result.color.primary.xyz, R0, program.local[35]; \n" - "END\n"; - static const char *prog2 = - "!!ARBvp1.0\n" - "#\n" - "# c[0-3] = modelview projection (composite) matrix\n" - "# c[32] = normalized light direction in object-space\n" - "# c[35] = yellow diffuse material, (1.0, 1.0, 0.0, 1.0)\n" - "# c[64].x = 0.0\n" - "# c[64].z = 0.125, a scaling factor\n" - "TEMP R0, R1;\n" - "#\n" - "# outputs diffuse illumination for color and perturbed position\n" - "#\n" - "DP3 R0, program.local[32], vertex.normal; # light direction DOT normal\n" - "MUL result.color.primary.xyz, R0, program.local[35]; \n" - "MAX R0, program.local[64].x, R0; \n" - "MUL R0, R0, vertex.normal; \n" - "MUL R0, R0, program.local[64].z; \n" - "ADD R1, vertex.position, -R0; # perturb object space position\n" - "DP4 result.position.x, state.matrix.mvp.row[3], R1; \n" - "DP4 result.position.y, state.matrix.mvp.row[1], R1; \n" - "DP4 result.position.z, state.matrix.mvp.row[2], R1; \n" - "DP4 result.position.w, state.matrix.mvp.row[3], R1; \n" - "END\n"; - static const char *prog3 = - "!!ARBvp1.0\n" - "TEMP R0, R1, R2, R3;\n" - "DP4 result.position.x, state.matrix.mvp.row[0], vertex.position;\n" - "DP4 result.position.y, state.matrix.mvp.row[1], vertex.position;\n" - "DP4 result.position.z, state.matrix.mvp.row[2], vertex.position;\n" - "DP4 result.position.w, state.matrix.mvp.row[3], vertex.position;\n" - "DP3 R0.x, state.matrix.modelview.inverse.row[0], vertex.normal;\n" - "DP3 R0.y, state.matrix.modelview.inverse.row[1], vertex.normal;\n" - "DP3 R0.z, state.matrix.modelview.inverse.row[2], vertex.normal;\n" - "DP3 R1.x, program.env[32], R0; # R1.x = Lpos DOT n'\n" - "DP3 R1.y, program.env[33], R0; # R1.y = hHat DOT n'\n" - "MOV R1.w, program.local[38].x; # R1.w = specular power\n" - "LIT R2, R1; # Compute lighting values\n" - "MAD R3, program.env[35].x, R2.y, program.env[35].y; # diffuse + emissive\n" - "MAD result.color.primary.xyz, program.env[36], R2.z, R3; # + specular\n" - "END\n"; - static const char *prog4 = - "!!ARBvp1.0\n" - "TEMP R2, R3;\n" - "PARAM foo = {0., 0., 0., 1.};\n" - "PARAM blah[] = { program.local[0..8] };\n" - "ADDRESS A0;\n" - "ARL A0.x, foo.x;\n" - "DP4 R2, R3, blah[A0.x].x;\n" - "DP4 R2, R3, blah[A0.x + 5];\n" - "DP4 result.position, R3, blah[A0.x - 4];\n" - "END\n"; - - glGenProgramsARB(4, prognum); - - load_program(prog1, prognum[0]); - load_program(prog2, prognum[1]); - load_program(prog3, prognum[2]); - load_program(prog4, prognum[3]); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/arbvptest3.c b/progs/tests/arbvptest3.c deleted file mode 100644 index 6437062900e..00000000000 --- a/progs/tests/arbvptest3.c +++ /dev/null @@ -1,127 +0,0 @@ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -static float Zrot = 0.0; - - -static void Display( void ) -{ - glClearColor(0.3, 0.3, 0.3, 1); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glEnable(GL_VERTEX_PROGRAM_ARB); - - glLoadIdentity(); - glRotatef(Zrot, 0, 0, 1); - - glPushMatrix(); - - glVertexAttrib3fARB(3, 1, 0.5, 0.25); - glBegin(GL_TRIANGLES); -#if 1 - glVertexAttrib3fARB(3, 1.0, 0.0, 0.0); - glVertexAttrib2fARB(0, -0.5, -0.5); - glVertexAttrib3fARB(3, 0.0, 1.0, 0.0); - glVertexAttrib2fARB(0, 0.5, -0.5); - glVertexAttrib3fARB(3, 0.0, 0.0, 1.0); - glVertexAttrib2fARB(0, 0, 0.5); -#else - glVertex2f( -1, -1); - glVertex2f( 1, -1); - glVertex2f( 0, 1); -#endif - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - /* glFrustum( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 );*/ - glOrtho(-2.0, 2.0, -2.0, 2.0, -2.0, 2.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - /*glTranslatef( 0.0, 0.0, -15.0 );*/ -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'z': - Zrot -= 5.0; - break; - case 'Z': - Zrot += 5.0; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - GLint errno; - GLuint prognum; - - static const char *prog1 = - "!!ARBvp1.0\n" - "MOV result.color, vertex.attrib[3];\n" - - "DP4 result.position.x, vertex.position, state.matrix.modelview.row[0];\n" - "DP4 result.position.y, vertex.position, state.matrix.modelview.row[1];\n" - "DP4 result.position.z, vertex.position, state.matrix.modelview.row[2];\n" - "DP4 result.position.w, vertex.position, state.matrix.modelview.row[3];\n" - "END\n"; - - glGenProgramsARB(1, &prognum); - - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog1), (const GLubyte *) prog1); - - assert(glIsProgramARB(prognum)); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/arbvptorus.c b/progs/tests/arbvptorus.c deleted file mode 100644 index c1e2d0b76a8..00000000000 --- a/progs/tests/arbvptorus.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * A lit, rotating torus via vertex program - */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0; -static GLboolean Anim = GL_TRUE; - - -static void Idle( void ) -{ - Xrot += .3; - Yrot += .4; - Zrot += .2; - glutPostRedisplay(); -} - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1, 0, 0); - glRotatef(Yrot, 0, 1, 0); - glRotatef(Zrot, 0, 0, 1); - glutSolidTorus(0.75, 2.0, 10, 20); - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -12.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case ' ': - Xrot = Yrot = Zrot = 0; - break; - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 'z': - Zrot -= 5.0; - break; - case 'Z': - Zrot += 5.0; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - const GLfloat step = 3.0; - (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 ) -{ - GLint errno; - GLuint prognum; - - /* borrowed from an nvidia demo: - * c[0..3] = modelview matrix - * c[4..7] = invtrans modelview matrix - * c[32] = light pos - * c[35] = diffuse color - */ - static const char prog[] = - "!!ARBvp1.0\n" - "TEMP R0, R1; \n" - "#Simple transform and diffuse lighting\n" - "# object x MVP -> clip\n" - "DP4 result.position.x, state.matrix.mvp.row[0], vertex.position ;\n" - "DP4 result.position.y, state.matrix.mvp.row[1], vertex.position ;\n" - "DP4 result.position.z, state.matrix.mvp.row[2], vertex.position ;\n" - "DP4 result.position.w, state.matrix.mvp.row[3], vertex.position ;\n" - - "# normal x MV-1T -> lighting normal\n" - "DP3 R1.x, state.matrix.modelview.invtrans.row[0], vertex.normal ;\n" - "DP3 R1.y, state.matrix.modelview.invtrans.row[1], vertex.normal;\n" - "DP3 R1.z, state.matrix.modelview.invtrans.row[2], vertex.normal;\n" - - "DP3 R0, program.local[32], R1; # L.N\n" -#if 0 - "MUL result.color.xyz, R0, program.local[35] ; # col = L.N * diffuse\n" -#else - "MUL result.color.primary.xyz, R0, program.local[35] ; # col = L.N * diffuse\n" -#endif - "MOV result.texcoord, vertex.texcoord;\n" - "END"; - - if (!glutExtensionSupported("GL_ARB_vertex_program")) { - printf("Sorry, this program requires GL_ARB_vertex_program"); - exit(1); - } - - - glGenProgramsARB(1, &prognum); - - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog), (const GLubyte *) prog); - - assert(glIsProgramARB(prognum)); - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } - - /* Light position */ - glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 32, 2, 2, 4, 1); - /* Diffuse material color */ - glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 35, 0.25, 0, 0.25, 1); - - glEnable(GL_VERTEX_PROGRAM_ARB); - glEnable(GL_DEPTH_TEST); - glClearColor(0.3, 0.3, 0.3, 1); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc(Idle); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/arbvpwarpmesh.c b/progs/tests/arbvpwarpmesh.c deleted file mode 100644 index 3dfe94f7596..00000000000 --- a/progs/tests/arbvpwarpmesh.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Warp a triangle mesh with a vertex program. - */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0; -static GLboolean Anim = GL_TRUE; -static GLfloat Phi = 0.0; - - -static void Idle( void ) -{ - Phi += 0.01; - glutPostRedisplay(); -} - - -static void DrawMesh( int rows, int cols ) -{ - static const GLfloat colorA[3] = { 0, 1, 0 }; - static const GLfloat colorB[3] = { 0, 0, 1 }; - const float dx = 2.0 / (cols - 1); - const float dy = 2.0 / (rows - 1); - float x, y; - int i, j; - -#if 1 -#define COLOR3FV(c) glVertexAttrib3fvARB(3, c) -#define VERTEX2F(x, y) glVertexAttrib2fARB(0, x, y) -#else -#define COLOR3FV(c) glColor3fv(c) -#define VERTEX2F(x, y) glVertex2f(x, y) -#endif - - y = -1.0; - for (i = 0; i < rows - 1; i++) { - glBegin(GL_QUAD_STRIP); - x = -1.0; - for (j = 0; j < cols; j++) { - if ((i + j) & 1) - COLOR3FV(colorA); - else - COLOR3FV(colorB); - VERTEX2F(x, y); - VERTEX2F(x, y + dy); - x += dx; - } - glEnd(); - y += dy; - } -} - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1, 0, 0); - glRotatef(Yrot, 0, 1, 0); - glRotatef(Zrot, 0, 0, 1); - - /* Position the gravity source */ - { - GLfloat x, y, z, r = 0.5; - x = r * cos(Phi); - y = r * sin(Phi); - z = 1.0; - glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 30, x, y, z, 1); - glDisable(GL_VERTEX_PROGRAM_ARB); - glBegin(GL_POINTS); - glColor3f(1,1,1); - glVertex3f(x, y, z); - glEnd(); - } - - glEnable(GL_VERTEX_PROGRAM_ARB); - DrawMesh(8, 8); - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - float ar = (float) width / (float) height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -1.0 * ar, 1.0 * ar, -1.0, 1.0, 5.0, 25.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -12.0 ); - glScalef(2, 2, 2); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 'p': - Phi += 0.2; - break; - case 'z': - Zrot -= 5.0; - break; - case 'Z': - Zrot += 5.0; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - const GLfloat step = 3.0; - (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 ) -{ - GLuint prognum; - GLint errno; - - /* - * c[0..3] = modelview matrix - * c[4..7] = inverse modelview matrix - * c[30] = gravity source location - * c[31] = gravity source strength - * c[32] = light pos - * c[35] = diffuse color - */ - static const char prog[] = - "!!ARBvp1.0\n" - "TEMP R1, R2, R3; " - - "# Compute distance from vertex to gravity source\n" - "ADD R1, program.local[30], -vertex.position; # vector from vertex to gravity\n" - "DP3 R2, R1, R1; # dot product\n" - "RSQ R2, R2.x; # square root = distance\n" - "MUL R2, R2, program.local[31].xxxx; # scale by the gravity factor\n" - - "# Displace vertex by gravity factor along R1 vector\n" - "MAD R3, R1, R2, vertex.position;\n" - - "# Continue with typical modelview/projection\n" - "DP4 result.position.x, state.matrix.mvp.row[0], R3 ; # object x MVP -> clip\n" - "DP4 result.position.y, state.matrix.mvp.row[1], R3 ;\n" - "DP4 result.position.z, state.matrix.mvp.row[2], R3 ;\n" - "DP4 result.position.w, state.matrix.mvp.row[3], R3 ;\n" - - "MOV result.color, vertex.attrib[3];\n # copy input color to output color\n" - - "END"; - - if (!glutExtensionSupported("GL_ARB_vertex_program")) { - printf("Sorry, this program requires GL_ARB_vertex_program\n"); - exit(1); - } - - glGenProgramsARB(1, &prognum); - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(prog), (const GLubyte *)prog); - errno = glGetError(); - printf("glGetError = %d\n", errno); - - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } - - /* Light position */ - glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 32, 2, 2, 4, 1); - /* Diffuse material color */ - glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 35, 0.25, 0, 0.25, 1); - - /* Gravity strength */ - glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 31, .5, 0, 0, 0); - - glEnable(GL_DEPTH_TEST); - glClearColor(0.3, 0.3, 0.3, 1); - glShadeModel(GL_FLAT); - glPointSize(3); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc(Idle); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/auxbuffer.c b/progs/tests/auxbuffer.c deleted file mode 100644 index 70f0b73910d..00000000000 --- a/progs/tests/auxbuffer.c +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Test AUX buffer rendering - * Use GLX since GLUT doesn't support AUX buffers - */ - - -/* - * Copyright (C) 1999-2001 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. - */ - -/* - * This is a port of the infamous "gears" demo to straight GLX (i.e. no GLUT) - * Port by Brian Paul 23 March 2001 - * - * Command line options: - * -info print GL implementation information - * - */ - - -#include <math.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <X11/Xlib.h> -#include <X11/keysym.h> -#include <GL/gl.h> -#include <GL/glx.h> - - -static int -current_time(void) -{ - return 0; -} - - - - -#ifndef M_PI -#define M_PI 3.14159265 -#endif - -static int WinWidth = 300, WinHeight = 300; -static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; -static GLint gear1, gear2, gear3; -static GLfloat angle = 0.0; - - -/* - * - * Draw a gear wheel. You'll probably want to call this function when - * building a display list since we do a lot of trig here. - * - * Input: inner_radius - radius of hole at center - * outer_radius - radius at center of teeth - * width - width of gear - * teeth - number of teeth - * tooth_depth - depth of tooth - */ -static void -gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, - GLint teeth, GLfloat tooth_depth) -{ - GLint i; - GLfloat r0, r1, r2; - GLfloat angle, da; - GLfloat u, v, len; - - r0 = inner_radius; - r1 = outer_radius - tooth_depth / 2.0; - r2 = outer_radius + tooth_depth / 2.0; - - da = 2.0 * M_PI / teeth / 4.0; - - glShadeModel(GL_FLAT); - - glNormal3f(0.0, 0.0, 1.0); - - /* draw front face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - if (i < teeth) { - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - width * 0.5); - } - } - glEnd(); - - /* draw front sides of teeth */ - glBegin(GL_QUADS); - da = 2.0 * M_PI / teeth / 4.0; - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), - width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - width * 0.5); - } - glEnd(); - - glNormal3f(0.0, 0.0, -1.0); - - /* draw back face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - if (i < teeth) { - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - } - } - glEnd(); - - /* draw back sides of teeth */ - glBegin(GL_QUADS); - da = 2.0 * M_PI / teeth / 4.0; - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - -width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), - -width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - } - glEnd(); - - /* draw outward faces of teeth */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - u = r2 * cos(angle + da) - r1 * cos(angle); - v = r2 * sin(angle + da) - r1 * sin(angle); - len = sqrt(u * u + v * v); - u /= len; - v /= len; - glNormal3f(v, -u, 0.0); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5); - glNormal3f(cos(angle), sin(angle), 0.0); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), - width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), - -width * 0.5); - u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da); - v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da); - glNormal3f(v, -u, 0.0); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), - -width * 0.5); - glNormal3f(cos(angle), sin(angle), 0.0); - } - - glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5); - glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5); - - glEnd(); - - glShadeModel(GL_SMOOTH); - - /* draw inside radius cylinder */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glNormal3f(-cos(angle), -sin(angle), 0.0); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - } - glEnd(); -} - - -static void -draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - glRotatef(view_rotx, 1.0, 0.0, 0.0); - glRotatef(view_roty, 0.0, 1.0, 0.0); - glRotatef(view_rotz, 0.0, 0.0, 1.0); - - glPushMatrix(); - glTranslatef(-3.0, -2.0, 0.0); - glRotatef(angle, 0.0, 0.0, 1.0); - glCallList(gear1); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(3.1, -2.0, 0.0); - glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0); - glCallList(gear2); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(-3.1, 4.2, 0.0); - glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0); - glCallList(gear3); - glPopMatrix(); - - glPopMatrix(); -} - - -/* new window size or exposure */ -static void -reshape(int width, int height) -{ - GLfloat h = (GLfloat) height / (GLfloat) width; - - WinWidth = width; - WinHeight = height; - glViewport(0, 0, (GLint) width, (GLint) height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0, 0.0, -40.0); -} - - -static void -init(void) -{ - static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 }; - static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 }; - static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 }; - static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 }; - int i; - - glGetIntegerv(GL_AUX_BUFFERS, &i); - printf("AUX BUFFERS: %d\n", i); - - glLightfv(GL_LIGHT0, GL_POSITION, pos); - glEnable(GL_CULL_FACE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - /* make the gears */ - gear1 = glGenLists(1); - glNewList(gear1, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); - gear(1.0, 4.0, 1.0, 20, 0.7); - glEndList(); - - gear2 = glGenLists(1); - glNewList(gear2, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); - gear(0.5, 2.0, 2.0, 10, 0.7); - glEndList(); - - gear3 = glGenLists(1); - glNewList(gear3, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); - gear(1.3, 2.0, 0.5, 10, 0.7); - glEndList(); - - glEnable(GL_NORMALIZE); -} - - -/* - * Create an RGB, double-buffered window. - * Return the window and context handles. - */ -static void -make_window( Display *dpy, const char *name, - int x, int y, int width, int height, - Window *winRet, GLXContext *ctxRet) -{ - int attrib[] = { GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DOUBLEBUFFER, - GLX_DEPTH_SIZE, 1, - GLX_AUX_BUFFERS, 1, - None }; - int scrnum; - XSetWindowAttributes attr; - unsigned long mask; - Window root; - Window win; - GLXContext ctx; - XVisualInfo *visinfo; - - scrnum = DefaultScreen( dpy ); - root = RootWindow( dpy, scrnum ); - - visinfo = glXChooseVisual( dpy, scrnum, attrib ); - if (!visinfo) { - printf("Error: couldn't get an RGB, Double-buffered visual\n"); - exit(1); - } - - /* window attributes */ - attr.background_pixel = 0; - attr.border_pixel = 0; - attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone); - attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask; - mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - - win = XCreateWindow( dpy, root, 0, 0, width, height, - 0, visinfo->depth, InputOutput, - visinfo->visual, mask, &attr ); - - /* set hints and properties */ - { - XSizeHints sizehints; - sizehints.x = x; - sizehints.y = y; - sizehints.width = width; - sizehints.height = height; - sizehints.flags = USSize | USPosition; - XSetNormalHints(dpy, win, &sizehints); - XSetStandardProperties(dpy, win, name, name, - None, (char **)NULL, 0, &sizehints); - } - - ctx = glXCreateContext( dpy, visinfo, NULL, True ); - if (!ctx) { - printf("Error: glXCreateContext failed\n"); - exit(1); - } - - XFree(visinfo); - - *winRet = win; - *ctxRet = ctx; -} - - -static void -event_loop(Display *dpy, Window win) -{ - while (1) { - while (XPending(dpy) > 0) { - XEvent event; - XNextEvent(dpy, &event); - switch (event.type) { - case Expose: - /* we'll redraw below */ - break; - case ConfigureNotify: - reshape(event.xconfigure.width, event.xconfigure.height); - break; - case KeyPress: - { - char buffer[10]; - int r, code; - code = XLookupKeysym(&event.xkey, 0); - if (code == XK_Left) { - view_roty += 5.0; - } - else if (code == XK_Right) { - view_roty -= 5.0; - } - else if (code == XK_Up) { - view_rotx += 5.0; - } - else if (code == XK_Down) { - view_rotx -= 5.0; - } - else { - r = XLookupString(&event.xkey, buffer, sizeof(buffer), - NULL, NULL); - if (buffer[0] == 27) { - /* escape */ - return; - } - } - } - } - } - - /* next frame */ - angle += 2.0; - - /* draw to aux buffer */ - glDrawBuffer(GL_AUX0); - - draw(); - - /* Copy aux buffer image to back color buffer */ - glReadBuffer(GL_AUX0); - glDrawBuffer(GL_BACK); - glWindowPos2iARB(0, 0); - glDisable(GL_DEPTH_TEST); - glCopyPixels(0, 0, WinWidth, WinHeight, GL_COLOR); - glEnable(GL_DEPTH_TEST); - - glXSwapBuffers(dpy, win); - - /* calc framerate */ - { - static int t0 = -1; - static int frames = 0; - int t = current_time(); - - if (t0 < 0) - t0 = t; - - frames++; - - if (t - t0 >= 5.0) { - GLfloat seconds = t - t0; - GLfloat fps = frames / seconds; - printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, - fps); - t0 = t; - frames = 0; - } - } - } -} - - -int -main(int argc, char *argv[]) -{ - Display *dpy; - Window win; - GLXContext ctx; - char *dpyName = ":0"; - GLboolean printInfo = GL_FALSE; - int i; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-display") == 0) { - dpyName = argv[i+1]; - i++; - } - else if (strcmp(argv[i], "-info") == 0) { - printInfo = GL_TRUE; - } - } - - dpy = XOpenDisplay(dpyName); - if (!dpy) { - printf("Error: couldn't open display %s\n", dpyName); - return -1; - } - - make_window(dpy, "glxgears", 0, 0, WinWidth, WinHeight, &win, &ctx); - XMapWindow(dpy, win); - glXMakeCurrent(dpy, win, ctx); - - if (printInfo) { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - } - - init(); - - event_loop(dpy, win); - - glXDestroyContext(dpy, ctx); - XDestroyWindow(dpy, win); - XCloseDisplay(dpy); - - return 0; -} diff --git a/progs/tests/blendminmax.c b/progs/tests/blendminmax.c deleted file mode 100644 index 2aab1a39d29..00000000000 --- a/progs/tests/blendminmax.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2004 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. - */ - -/** - * \file blendminmax.c - * - * Simple test of GL_EXT_blend_minmax functionality. Four squares are drawn - * with different blending modes, but all should be rendered with the same - * final color. - * - * \author Ian Romanick <[email protected]> - */ - -#include <stdio.h> -#include <stdlib.h> -#include <GL/glut.h> - -static int Width = 400; -static int Height = 200; -static const GLfloat Near = 5.0, Far = 25.0; - - -static void Display( void ) -{ - glClearColor(0.2, 0.2, 0.8, 0); - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - - /* This is the "reference" square. - */ - - glTranslatef(-4.5, 0, 0); - glBlendEquation( GL_FUNC_ADD ); - glBlendFunc( GL_ONE, GL_ZERO ); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - /* GL_MIN and GL_MAX are supposed to ignore the blend function setting. - * To test that, we set the blend function to GL_ZERO for both color and - * alpha each time GL_MIN or GL_MAX is used. - * - * Apple ships an extension called GL_ATI_blend_weighted_minmax (supported - * on Mac OS X 10.2 and later). I believe the difference with that - * extension is that it uses the blend function. However, I have no idea - * what the enums are for it. The extension is listed at Apple's developer - * site, but there is no documentation. - * - * http://developer.apple.com/opengl/extensions.html - */ - - glTranslatef(3.0, 0, 0); - glBlendEquation( GL_FUNC_ADD ); - glBlendFunc( GL_ONE, GL_ZERO ); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - glBlendEquation( GL_MAX ); - glBlendFunc( GL_ZERO, GL_ZERO ); - glBegin(GL_QUADS); - glColor3f( 0.2, 0.2, 0.2 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - glTranslatef(3.0, 0, 0); - glBlendEquation( GL_FUNC_ADD ); - glBlendFunc( GL_ONE, GL_ZERO ); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - glBlendEquation( GL_MIN ); - glBlendFunc( GL_ZERO, GL_ZERO ); - glBegin(GL_QUADS); - glColor3f( 0.8, 0.8, 0.8 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - glTranslatef(3.0, 0, 0); - glBlendEquation( GL_FUNC_ADD ); - glBlendFunc( GL_ONE, GL_ZERO ); - glBegin(GL_QUADS); - glColor3f( 0.8, 0.8, 0.8 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - glBlendEquation( GL_MIN ); - glBlendFunc( GL_ZERO, GL_ZERO ); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / (float) height; - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, Near, Far ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - const char * const ver_string = (const char * const) - glGetString( GL_VERSION ); - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", ver_string); - - if ( !glutExtensionSupported("GL_ARB_imaging") && !glutExtensionSupported("GL_EXT_blend_minmax")) { - printf("Sorry, this program requires either GL_ARB_imaging or GL_EXT_blend_minmax.\n"); - exit(1); - } - - printf("\nAll 4 squares should be the same color.\n"); - glEnable( GL_BLEND ); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "GL_EXT_blend_minmax test" ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/blendsquare.c b/progs/tests/blendsquare.c deleted file mode 100644 index 1694866a557..00000000000 --- a/progs/tests/blendsquare.c +++ /dev/null @@ -1,178 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2004 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. - */ - -/** - * \file blendsquare.c - * - * Simple test of GL_NV_blend_square functionality. Four squares are drawn - * with different blending modes, but all should be rendered with the same - * final color. - * - * \author Ian Romanick <[email protected]> - */ - -#include <stdio.h> -#include <stdlib.h> -#include <GL/glut.h> - -static int Width = 400; -static int Height = 200; -static const GLfloat Near = 5.0, Far = 25.0; - - -static void Display( void ) -{ - glClearColor(0.2, 0.2, 0.8, 0); - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - - glTranslatef(-4.5, 0, 0); - glBlendFunc( GL_ONE, GL_ZERO ); - glBegin(GL_QUADS); - glColor3f( 0.5 * 0.5, 0.5 * 0.5, 0.5 * 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - glTranslatef(3.0, 0, 0); - glBlendFunc( GL_ONE, GL_ZERO ); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - glBlendFunc( GL_DST_COLOR, GL_ZERO ); - glBegin(GL_QUADS); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - glTranslatef(3.0, 0, 0); - glBlendFunc( GL_SRC_COLOR, GL_ZERO ); - glBegin(GL_QUADS); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - glTranslatef(3.0, 0, 0); - glBlendFunc( GL_ONE, GL_ZERO ); - glBegin(GL_QUADS); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - glBlendFunc( GL_ZERO, GL_DST_COLOR ); - glBegin(GL_QUADS); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / (float) height; - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, Near, Far ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - const char * const ver_string = (const char * const) - glGetString( GL_VERSION ); - const double version = strtod( ver_string, NULL ); - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", ver_string); - - if ( (version < 1.4) && !glutExtensionSupported("GL_NV_blend_square")) { - printf("Sorry, this program requires either OpenGL 1.4 or GL_NV_blend_square\n"); - exit(1); - } - - printf("\nAll 4 squares should be the same color. The two on the left are drawn\n" - "without NV_blend_square functionality, and the two on the right are drawn\n" - "with NV_blend_square functionality. If the two on the left are dark, but\n" - "the two on the right are not, then NV_blend_square is broken.\n"); - glEnable( GL_BLEND ); - glBlendEquation( GL_FUNC_ADD ); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "GL_NV_blend_square test" ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/bufferobj.c b/progs/tests/bufferobj.c deleted file mode 100644 index c765d2516ba..00000000000 --- a/progs/tests/bufferobj.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Test GL_ARB_vertex_buffer_object - * - * Brian Paul - * 16 Sep 2003 - */ - - -#define GL_GLEXT_PROTOTYPES -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - -#define NUM_OBJECTS 10 - -struct object -{ - GLuint BufferID; - GLuint ElementsBufferID; - GLuint NumVerts; - GLuint VertexOffset; - GLuint ColorOffset; - GLuint NumElements; -}; - -static struct object Objects[NUM_OBJECTS]; -static GLuint NumObjects; - -static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; -static GLboolean Anim = GL_TRUE; - - -static void CheckError(int line) -{ - GLenum err = glGetError(); - if (err) { - printf("GL Error 0x%x at line %d\n", (int) err, line); - } -} - - -static void DrawObject( const struct object *obj ) -{ - glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID); - glVertexPointer(3, GL_FLOAT, 0, (void *) obj->VertexOffset); - glEnable(GL_VERTEX_ARRAY); - - /* test push/pop attrib */ - /* XXX this leads to a segfault with NVIDIA's 53.36 driver */ -#if 0 - if (1) - { - glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); - /*glVertexPointer(3, GL_FLOAT, 0, (void *) (obj->VertexOffset + 10000));*/ - glBindBufferARB(GL_ARRAY_BUFFER_ARB, 999999); - glPopClientAttrib(); - } -#endif - glColorPointer(3, GL_FLOAT, 0, (void *) obj->ColorOffset); - glEnable(GL_COLOR_ARRAY); - - if (obj->NumElements > 0) { - /* indexed arrays */ - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, obj->ElementsBufferID); - glDrawElements(GL_LINE_LOOP, obj->NumElements, GL_UNSIGNED_INT, NULL); - } - else { - /* non-indexed arrays */ - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); - glDrawArrays(GL_LINE_LOOP, 0, obj->NumVerts); - } -} - - -static void Idle( void ) -{ - Zrot = 0.05 * glutGet(GLUT_ELAPSED_TIME); - glutPostRedisplay(); -} - - -static void Display( void ) -{ - int i; - - glClear( GL_COLOR_BUFFER_BIT ); - - for (i = 0; i < NumObjects; i++) { - float x = 5.0 * ((float) i / (NumObjects-1) - 0.5); - glPushMatrix(); - glTranslatef(x, 0, 0); - glRotatef(Xrot, 1, 0, 0); - glRotatef(Yrot, 0, 1, 0); - glRotatef(Zrot, 0, 0, 1); - - DrawObject(Objects + i); - - glPopMatrix(); - } - - CheckError(__LINE__); - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - float ar = (float) width / (float) height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, 5.0, 25.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - const GLfloat step = 3.0; - (void) x; - (void) y; - switch (key) { - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 'z': - Zrot -= step; - break; - case 'Z': - Zrot += step; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - const GLfloat step = 3.0; - (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 MakeObject1(struct object *obj) -{ - GLfloat *v, *c; - void *p; - int i; - GLubyte buffer[500]; - - for (i = 0; i < 500; i++) - buffer[i] = i & 0xff; - - obj->BufferID = 0; - glGenBuffersARB(1, &obj->BufferID); - assert(obj->BufferID != 0); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, 500, buffer, GL_STATIC_DRAW_ARB); - - for (i = 0; i < 500; i++) - buffer[i] = 0; - - glGetBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, 500, buffer); - - for (i = 0; i < 500; i++) - assert(buffer[i] == (i & 0xff)); - - glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAPPED_ARB, &i); - assert(!i); - - glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_USAGE_ARB, &i); - - v = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); - - /* do some sanity tests */ - glGetBufferPointervARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAP_POINTER_ARB, &p); - assert(p == v); - - glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &i); - assert(i == 500); - - glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_USAGE_ARB, &i); - assert(i == GL_STATIC_DRAW_ARB); - - glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_ACCESS_ARB, &i); - assert(i == GL_WRITE_ONLY_ARB); - - glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAPPED_ARB, &i); - assert(i); - - /* Make rectangle */ - v[0] = -1; v[1] = -1; v[2] = 0; - v[3] = 1; v[4] = -1; v[5] = 0; - v[6] = 1; v[7] = 1; v[8] = 0; - v[9] = -1; v[10] = 1; v[11] = 0; - c = v + 12; - c[0] = 1; c[1] = 0; c[2] = 0; - c[3] = 1; c[4] = 0; c[5] = 0; - c[6] = 1; c[7] = 0; c[8] = 1; - c[9] = 1; c[10] = 0; c[11] = 1; - obj->NumVerts = 4; - obj->VertexOffset = 0; - obj->ColorOffset = 3 * sizeof(GLfloat) * obj->NumVerts; - obj->NumElements = 0; - - glUnmapBufferARB(GL_ARRAY_BUFFER_ARB); - - glGetBufferPointervARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAP_POINTER_ARB, &p); - assert(!p); - - glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAPPED_ARB, &i); - assert(!i); -} - - -static void MakeObject2(struct object *obj) -{ - GLfloat *v, *c; - - glGenBuffersARB(1, &obj->BufferID); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, 1000, NULL, GL_STATIC_DRAW_ARB); - v = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); - - /* Make triangle */ - v[0] = -1; v[1] = -1; v[2] = 0; - v[3] = 1; v[4] = -1; v[5] = 0; - v[6] = 0; v[7] = 1; v[8] = 0; - c = v + 9; - c[0] = 0; c[1] = 1; c[2] = 0; - c[3] = 0; c[4] = 1; c[5] = 0; - c[6] = 1; c[7] = 1; c[8] = 0; - obj->NumVerts = 3; - obj->VertexOffset = 0; - obj->ColorOffset = 3 * sizeof(GLfloat) * obj->NumVerts; - obj->NumElements = 0; - - glUnmapBufferARB(GL_ARRAY_BUFFER_ARB); -} - - -static void MakeObject3(struct object *obj) -{ - GLfloat vertexData[1000]; - GLfloat *v, *c; - GLuint *i; - int bytes; - - /* Make rectangle */ - v = vertexData; - v[0] = -1; v[1] = -0.5; v[2] = 0; - v[3] = 1; v[4] = -0.5; v[5] = 0; - v[6] = 1; v[7] = 0.5; v[8] = 0; - v[9] = -1; v[10] = 0.5; v[11] = 0; - c = vertexData + 12; - c[0] = 0; c[1] = 0; c[2] = 1; - c[3] = 0; c[4] = 0; c[5] = 1; - c[6] = 0; c[7] = 1; c[8] = 1; - c[9] = 0; c[10] = 1; c[11] = 1; - obj->NumVerts = 4; - obj->VertexOffset = 0; - obj->ColorOffset = 3 * sizeof(GLfloat) * obj->NumVerts; - - bytes = obj->NumVerts * (3 + 3) * sizeof(GLfloat); - - /* Don't use glMap/UnmapBuffer for this object */ - glGenBuffersARB(1, &obj->BufferID); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, bytes, vertexData, GL_STATIC_DRAW_ARB); - - /* Setup a buffer of indices to test the ELEMENTS path */ - glGenBuffersARB(1, &obj->ElementsBufferID); - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, obj->ElementsBufferID); - glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 100, NULL, GL_STATIC_DRAW_ARB); - i = (GLuint *) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_READ_WRITE_ARB); - i[0] = 0; - i[1] = 1; - i[2] = 2; - i[3] = 3; - glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB); - obj->NumElements = 4; -} - - - -static void Init( void ) -{ - if (!glutExtensionSupported("GL_ARB_vertex_buffer_object")) { - printf("GL_ARB_vertex_buffer_object not found!\n"); - exit(0); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Test buffer object deletion */ - if (1) { - static GLubyte data[1000]; - GLuint id = 999; - glBindBufferARB(GL_ARRAY_BUFFER_ARB, id); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, 1000, data, GL_STATIC_DRAW_ARB); - glVertexPointer(3, GL_FLOAT, 0, (void *) 0); - glDeleteBuffersARB(1, &id); - assert(!glIsBufferARB(id)); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); - glVertexPointer(3, GL_FLOAT, 0, (void *) 0); - assert(!glIsBufferARB(id)); - } - - MakeObject1(Objects + 0); - MakeObject2(Objects + 1); - MakeObject3(Objects + 2); - NumObjects = 3; -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 600, 300 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc(Idle); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/bug_3050.c b/progs/tests/bug_3050.c deleted file mode 100644 index 4ea7b80f231..00000000000 --- a/progs/tests/bug_3050.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2006 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. - */ - -/** - * \file bug_3050.c - * - * Simple regression test for bug #3050. Create a texture and make a few - * calls to \c glGetTexLevelParameteriv. If the bug still exists, trying - * to get \c GL_TEXTURE_WITDH will cause a protocol error. - * - * This test \b only applies to indirect-rendering. This may mean that the - * test needs to be run with the environment variable \c LIBGL_ALWAYS_INDIRECT - * set to a non-zero value. - * - * \author Ian Romanick <[email protected]> - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <GL/glut.h> - -static int Width = 400; -static int Height = 200; -static const GLfloat Near = 5.0, Far = 25.0; - - -static void Display( void ) -{ -} - - -static void Reshape( int width, int height ) -{ -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - unsigned i; - static const GLenum pnames[] = { - GL_TEXTURE_RED_SIZE, - GL_TEXTURE_GREEN_SIZE, - GL_TEXTURE_BLUE_SIZE, - GL_TEXTURE_ALPHA_SIZE, - GL_TEXTURE_LUMINANCE_SIZE, - GL_TEXTURE_INTENSITY_SIZE, - GL_TEXTURE_BORDER, - GL_TEXTURE_INTERNAL_FORMAT, - GL_TEXTURE_WIDTH, - GL_TEXTURE_HEIGHT, - GL_TEXTURE_DEPTH, - ~0 - }; - - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - - printf("\nThis program should log some data about a texture and exit.\n"); - printf("This is a regression test for bug #3050. If the bug still\n"); - printf("exists, a GLX protocol error will be generated.\n"); - printf("https://bugs.freedesktop.org/show_bug.cgi?id=3050\n\n"); - - - if ( ! glutExtensionSupported( "GL_NV_texture_rectangle" ) - && ! glutExtensionSupported( "GL_EXT_texture_rectangle" ) - && ! glutExtensionSupported( "GL_ARB_texture_rectangle" ) ) { - printf( "This test requires one of GL_ARB_texture_rectangle, GL_EXT_texture_rectangle,\n" - "or GL_NV_texture_rectangle be supported\n." ); - exit( 1 ); - } - - - glBindTexture( GL_TEXTURE_RECTANGLE_NV, 1 ); - glTexImage2D( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, GL_RGBA, 8, 8, 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL ); - - for ( i = 0 ; pnames[i] != ~0 ; i++ ) { - GLint param_i; - GLfloat param_f; - GLenum err; - - glGetTexLevelParameteriv( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, pnames[i], & param_i ); - err = glGetError(); - - if ( err ) { - printf("glGetTexLevelParameteriv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) generated a GL\n" - "error of 0x%04x!", - pnames[i], err ); - exit( 1 ); - } - else { - printf("glGetTexLevelParameteriv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) = 0x%04x\n", - pnames[i], param_i ); - } - - - glGetTexLevelParameterfv( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, pnames[i], & param_f ); - err = glGetError(); - - if ( err ) { - printf("glGetTexLevelParameterfv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) generated a GL\n" - "error of 0x%04x!\n", - pnames[i], err ); - exit( 1 ); - } - else { - printf("glGetTexLevelParameterfv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) = %.1f (0x%04x)\n", - pnames[i], param_f, (GLint) param_f ); - } - } -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "Bug #3050 Test" ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - return 0; -} diff --git a/progs/tests/bug_3101.c b/progs/tests/bug_3101.c deleted file mode 100644 index 761dcbb9513..00000000000 --- a/progs/tests/bug_3101.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2005 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. - */ - -/** - * \file bug_3101.c - * - * Simple regression test for bug #3101. Attempt to draw a single square. - * After emiting the first vertex, call \c glEdgeFlag to change the vertex - * format. If the bug still exists, this will cause a segfault. - * - * \author Ian Romanick <[email protected]> - */ - -#include <stdio.h> -#include <stdlib.h> -#include <GL/glut.h> - -static int Width = 400; -static int Height = 200; -static const GLfloat Near = 5.0, Far = 25.0; - - -static void Display( void ) -{ - glClearColor(0.2, 0.2, 0.8, 0); - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - - /* This is the "reference" square. - */ - - glTranslatef(-4.5, 0, 0); - glBlendEquation( GL_FUNC_ADD ); - glBlendFunc( GL_ONE, GL_ZERO ); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glEdgeFlag(GL_TRUE); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / (float) height; - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, Near, Far ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - const char * const ver_string = (const char * const) - glGetString( GL_VERSION ); - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", ver_string); - - printf("\nThis program should draw a single square, but not crash.\n"); - printf("This is a regression test for bug #3101.\n"); - printf("https://bugs.freedesktop.org/show_bug.cgi?id=3101\n"); - glEnable( GL_BLEND ); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "Bug #3101 Test" ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/bug_3195.c b/progs/tests/bug_3195.c deleted file mode 100644 index 4aceae04abe..00000000000 --- a/progs/tests/bug_3195.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (C) 2000 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. - */ - -/** - * \file bug_3195.c - * - * Simple regression test for bug #3195. A bug in the i180 driver caused - * a segfault (inside the driver) when the LOD bias is adjusted and no texture - * is enabled. This test, which is based on progs/demos/lodbias.c, sets up - * all the texturing, disables all textures, adjusts the LOD bias, then - * re-enables \c GL_TEXTURE_2D. - * - * \author Brian Paul - * \author Ian Romanick <[email protected]> - */ - -#include <assert.h> -#include <stdlib.h> -#include <stdio.h> -#include <math.h> -#include <GL/glut.h> -#include <GL/glext.h> - -#include "readtex.h" - -#define TEXTURE_FILE "../images/girl.rgb" - -static GLfloat Xrot = 0, Yrot = -30, Zrot = 0; -static GLint Bias = 0, BiasStepSign = +1; /* ints avoid fp precision problem */ -static GLint BiasMin = -400, BiasMax = 400; - - - -static void -PrintString(const char *s) -{ - while (*s) { - glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); - s++; - } -} - -static void Idle( void ) -{ - static int lastTime = 0; - int time = glutGet(GLUT_ELAPSED_TIME); - int step; - - if (lastTime == 0) - lastTime = time; - else if (time - lastTime < 10) - return; - - step = (time - lastTime) / 10 * BiasStepSign; - lastTime = time; - - Bias += step; - if (Bias < BiasMin) { - exit(0); - } - else if (Bias > BiasMax) { - Bias = BiasMax; - BiasStepSign = -1; - } - - glutPostRedisplay(); -} - - -static void Display( void ) -{ - char str[100]; - - glClear( GL_COLOR_BUFFER_BIT ); - - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(-1, 1, -1, 1, -1, 1); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - - glDisable(GL_TEXTURE_2D); - glColor3f(1,1,1); - glRasterPos3f(-0.9, -0.9, 0.0); - sprintf(str, "Texture LOD Bias = %4.1f", Bias * 0.01); - PrintString(str); - - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -8.0 ); - - glPushMatrix(); - glRotatef(Xrot, 1, 0, 0); - glRotatef(Yrot, 0, 1, 0); - glRotatef(Zrot, 0, 0, 1); - - glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 0.01 * Bias); - glEnable(GL_TEXTURE_2D); - - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); glVertex2f(-1, -1); - glTexCoord2f(2, 0); glVertex2f( 1, -1); - glTexCoord2f(2, 2); glVertex2f( 1, 1); - glTexCoord2f(0, 2); glVertex2f(-1, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - const GLfloat step = 3.0; - (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 ) -{ - GLfloat maxBias; - const char * const ver_string = (const char * const) - glGetString( GL_VERSION ); - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", ver_string); - - printf("\nThis program should function nearly identically to Mesa's lodbias demo.\n" - "It should cycle through the complet LOD bias range once and exit. If bug\n" - "#3195 still exists, the demo should crash almost immediatly.\n"); - printf("This is a regression test for bug #3195.\n"); - printf("https://bugs.freedesktop.org/show_bug.cgi?id=3195\n"); - - if (!glutExtensionSupported("GL_EXT_texture_lod_bias")) { - printf("Sorry, GL_EXT_texture_lod_bias not supported by this renderer.\n"); - exit(1); - } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - if (glutExtensionSupported("GL_SGIS_generate_mipmap")) { - /* test auto mipmap generation */ - GLint width, height, i; - GLenum format; - GLubyte *image = LoadRGBImage(TEXTURE_FILE, &width, &height, &format); - if (!image) { - printf("Error: could not load texture image %s\n", TEXTURE_FILE); - exit(1); - } - /* resize to 256 x 256 */ - if (width != 256 || height != 256) { - GLubyte *newImage = malloc(256 * 256 * 4); - gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image, - 256, 256, GL_UNSIGNED_BYTE, newImage); - free(image); - image = newImage; - } - printf("Using GL_SGIS_generate_mipmap\n"); - glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE); - glTexImage2D(GL_TEXTURE_2D, 0, format, 256, 256, 0, - format, GL_UNSIGNED_BYTE, image); - free(image); - - /* make sure mipmap was really generated correctly */ - width = height = 256; - for (i = 0; i < 9; i++) { - GLint w, h; - glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_WIDTH, &w); - glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_HEIGHT, &h); - printf("Level %d size: %d x %d\n", i, w, h); - assert(w == width); - assert(h == height); - width /= 2; - height /= 2; - } - - } - else if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) { - printf("Error: could not load texture image %s\n", TEXTURE_FILE); - exit(1); - } - - /* mipmapping required for this extension */ - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS_EXT, &maxBias); - printf("LOD bias range: [%g, %g]\n", -maxBias, maxBias); - BiasMin = -100 * maxBias; - BiasMax = 100 * maxBias; - - /* Since we have (about) 8 mipmap levels, no need to bias beyond - * the range [-1, +8]. - */ - if (BiasMin < -100) - BiasMin = -100; - if (BiasMax > 800) - BiasMax = 800; -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 350, 350 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "Bug #3195 Test" ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - glutIdleFunc(Idle); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/copypixrate.c b/progs/tests/copypixrate.c deleted file mode 100644 index e9a42a1c8c9..00000000000 --- a/progs/tests/copypixrate.c +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Measure glCopyPixels speed - * - * Brian Paul - * 26 Jan 2006 - */ - -#define GL_GLEXT_PROTOTYPES -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> -#include <GL/glut.h> - -static GLint WinWidth = 1000, WinHeight = 800; -static GLint ImgWidth, ImgHeight; - -static GLenum Buffer = GL_FRONT; -static GLenum AlphaTest = GL_FALSE; -static GLboolean UseBlit = GL_FALSE; - -static PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT_func = NULL; - - -/** - * draw teapot in lower-left corner of window - */ -static void -DrawTestImage(void) -{ - GLfloat ar; - - ImgWidth = WinWidth / 3; - ImgHeight = WinHeight / 3; - - glViewport(0, 0, ImgWidth, ImgHeight); - glScissor(0, 0, ImgWidth, ImgHeight); - glEnable(GL_SCISSOR_TEST); - - glClearColor(0.5, 0.5, 0.5, 0.0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - ar = (float) WinWidth / WinHeight; - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0); - glMatrixMode(GL_MODELVIEW); - - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - glFrontFace(GL_CW); - glPushMatrix(); - glRotatef(45, 1, 0, 0); - glutSolidTeapot(2.0); - glPopMatrix(); - glFrontFace(GL_CCW); - glDisable(GL_DEPTH_TEST); - glDisable(GL_LIGHTING); - - glDisable(GL_SCISSOR_TEST); - - glViewport(0, 0, WinWidth, WinHeight); - glFinish(); -} - - -static int -Rand(int max) -{ - return ((int) random()) % max; -} - - -/** - * Measure glCopyPixels rate - */ -static void -RunTest(void) -{ - double t1, t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0; - int iters = 0; - float copyRate, mbRate; - int r, g, b, a, bpp; - - if (AlphaTest) { - glEnable(GL_ALPHA_TEST); - glAlphaFunc(GL_GREATER, 0.0); - } - - glGetIntegerv(GL_RED_BITS, &r); - glGetIntegerv(GL_GREEN_BITS, &g); - glGetIntegerv(GL_BLUE_BITS, &b); - glGetIntegerv(GL_ALPHA_BITS, &a); - bpp = (r + g + b + a) / 8; - - do { - int x, y; - x = Rand(WinWidth); - y = Rand(WinHeight); - - if (x > ImgWidth || y > ImgHeight) { -#ifdef GL_EXT_framebuffer_blit - if (UseBlit) - { - glBlitFramebufferEXT_func(0, 0, ImgWidth, ImgHeight, - x, y, x + ImgWidth, y + ImgHeight, - GL_COLOR_BUFFER_BIT, GL_LINEAR); - } - else -#endif - { - glWindowPos2iARB(x, y); - glCopyPixels(0, 0, ImgWidth, ImgHeight, GL_COLOR); - } - glFinish(); /* XXX OK? */ - - iters++; - - t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0; - } - } while (t1 - t0 < 5.0); - - glDisable(GL_ALPHA_TEST); - - copyRate = iters / (t1 - t0); - mbRate = ImgWidth * ImgHeight * bpp * copyRate / (1024 * 1024); - - printf("Image size: %d x %d, %d Bpp\n", ImgWidth, ImgHeight, bpp); - printf("%d copies in %.2f = %.2f copies/sec, %.2f MB/s\n", - iters, t1-t0, copyRate, mbRate); -} - - -static void -Draw(void) -{ - glClearColor(0.0, 0.0, 0.0, 0.0); - glClearColor(0.2, 0.2, 0.8, 0); - glReadBuffer(Buffer); - glDrawBuffer(Buffer); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - DrawTestImage(); - - RunTest(); - - if (Buffer == GL_FRONT) - glFinish(); - else - glutSwapBuffers(); - - printf("exiting\n"); - exit(0); -} - - -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.0, 0.0, -15.0); -} - - -static void -Key(unsigned char key, int x, int y) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void -SpecialKey(int key, int x, int y) -{ - (void) x; - (void) y; - switch (key) { - case GLUT_KEY_UP: - break; - case GLUT_KEY_DOWN: - break; - case GLUT_KEY_LEFT: - break; - case GLUT_KEY_RIGHT: - break; - } - glutPostRedisplay(); -} - - -static void -ParseArgs(int argc, char *argv[]) -{ - int i; - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-back") == 0) - Buffer = GL_BACK; - else if (strcmp(argv[i], "-alpha") == 0) - AlphaTest = GL_TRUE; - else if (strcmp(argv[i], "-blit") == 0) - UseBlit = GL_TRUE; - } -} - - -static void -Init(void) -{ - if (glutExtensionSupported("GL_EXT_framebuffer_blit")) { - glBlitFramebufferEXT_func = (PFNGLBLITFRAMEBUFFEREXTPROC) - glutGetProcAddress("glBlitFramebufferEXT"); - } - else if (UseBlit) { - printf("Warning: GL_EXT_framebuffer_blit not supported.\n"); - UseBlit = GL_FALSE; - } -} - - -int -main(int argc, char *argv[]) -{ - GLint mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE | GLUT_DEPTH; - glutInit(&argc, argv); - - ParseArgs(argc, argv); - if (AlphaTest) - mode |= GLUT_ALPHA; - - glutInitWindowPosition(0, 0); - glutInitWindowSize(WinWidth, WinHeight); - glutInitDisplayMode(mode); - glutCreateWindow(argv[0]); - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutSpecialFunc(SpecialKey); - glutDisplayFunc(Draw); - - printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER)); - printf("Draw Buffer: %s\n", (Buffer == GL_BACK) ? "Back" : "Front"); - Init(); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/crossbar.c b/progs/tests/crossbar.c deleted file mode 100644 index 12aabb1c9ad..00000000000 --- a/progs/tests/crossbar.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2005 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. - */ - -/** - * \file crossbar.c - * - * Simple test of GL_ARB_texture_env_crossbar functionality. Several squares - * are drawn with different texture combine modes, but all should be rendered - * with the same final color. - * - * \author Ian Romanick <[email protected]> - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <GL/glut.h> - -static const GLint tests[][8] = { - { 1, GL_REPLACE, GL_PRIMARY_COLOR, GL_PRIMARY_COLOR, - 2, GL_REPLACE, GL_TEXTURE, GL_PRIMARY_COLOR }, - { 3, GL_REPLACE, GL_PRIMARY_COLOR, GL_PRIMARY_COLOR, - 2, GL_SUBTRACT, GL_TEXTURE0, GL_TEXTURE1 }, - { 2, GL_REPLACE, GL_PRIMARY_COLOR, GL_PRIMARY_COLOR, - 2, GL_REPLACE, GL_TEXTURE0, GL_TEXTURE0 }, - { 2, GL_REPLACE, GL_PRIMARY_COLOR, GL_PRIMARY_COLOR, - 1, GL_SUBTRACT, GL_TEXTURE0, GL_TEXTURE1 }, - { 3, GL_ADD, GL_TEXTURE1, GL_TEXTURE1, - 2, GL_MODULATE, GL_TEXTURE1, GL_PREVIOUS }, - { 3, GL_ADD, GL_TEXTURE1, GL_TEXTURE1, - 4, GL_MODULATE, GL_TEXTURE0, GL_PREVIOUS }, -}; - -#define NUM_TESTS (sizeof(tests) / sizeof(tests[0])) - -static int Width = 100 * (NUM_TESTS + 1); -static int Height = 200; -static const GLfloat Near = 5.0, Far = 25.0; - - -static void Display( void ) -{ - unsigned i; - - - glClearColor(0.2, 0.2, 0.8, 0); - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - - /* This is the "reference" square. - */ - - glActiveTexture( GL_TEXTURE0 ); - glDisable( GL_TEXTURE_2D ); - glActiveTexture( GL_TEXTURE1 ); - glDisable( GL_TEXTURE_2D ); - - glTranslatef(-(NUM_TESTS * 1.5), 0, 0); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - for ( i = 0 ; i < NUM_TESTS ; i++ ) { - glActiveTexture( GL_TEXTURE0 ); - glEnable( GL_TEXTURE_2D ); - glBindTexture( GL_TEXTURE_2D, tests[i][0] ); - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE ); - glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB, tests[i][1] ); - glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB, tests[i][2] ); - glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB, tests[i][3] ); - - glActiveTexture( GL_TEXTURE1 ); - glEnable( GL_TEXTURE_2D ); - glBindTexture( GL_TEXTURE_2D, tests[i][4] ); - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE ); - glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB, tests[i][5] ); - glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB, tests[i][6] ); - glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB, tests[i][7] ); - - glCallList(1); - } - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / (float) height; - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, Near, Far ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - const char * const ver_string = (const char * const) - glGetString( GL_VERSION ); - float ver = strtof( ver_string, NULL ); - GLint tex_units; - GLint temp[ 256 ]; - - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", ver_string); - - if ( (!glutExtensionSupported("GL_ARB_multitexture") - && (ver < 1.3)) - || (!glutExtensionSupported("GL_ARB_texture_env_combine") - && !glutExtensionSupported("GL_EXT_texture_env_combine") - && (ver < 1.3)) - || (!glutExtensionSupported("GL_ARB_texture_env_crossbar") - && !glutExtensionSupported("GL_NV_texture_env_combine4") - && (ver < 1.4)) ) { - printf("\nSorry, this program requires GL_ARB_multitexture and either\n" - "GL_ARB_texture_env_combine or GL_EXT_texture_env_combine (or OpenGL 1.3).\n" - "Either GL_ARB_texture_env_crossbar or GL_NV_texture_env_combine4 (or\n" - "OpenGL 1.4) are also required.\n"); - exit(1); - } - - glGetIntegerv( GL_MAX_TEXTURE_UNITS, & tex_units ); - if ( tex_units < 2 ) { - printf("\nSorry, this program requires at least 2 texture units.\n"); - exit(1); - } - - printf("\nAll %u squares should be the same color.\n", NUM_TESTS + 1); - - (void) memset( temp, 0x00, sizeof( temp ) ); - glBindTexture( GL_TEXTURE_2D, 1 ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, - GL_RGBA, GL_UNSIGNED_BYTE, temp ); - - (void) memset( temp, 0x7f, sizeof( temp ) ); - glBindTexture( GL_TEXTURE_2D, 2 ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, - GL_RGBA, GL_UNSIGNED_BYTE, temp ); - - (void) memset( temp, 0xff, sizeof( temp ) ); - glBindTexture( GL_TEXTURE_2D, 3 ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, - GL_RGBA, GL_UNSIGNED_BYTE, temp ); - - (void) memset( temp, 0x3f, sizeof( temp ) ); - glBindTexture( GL_TEXTURE_2D, 4 ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, - GL_RGBA, GL_UNSIGNED_BYTE, temp ); - - - glNewList( 1, GL_COMPILE ); - glTranslatef(3.0, 0, 0); - glBegin(GL_QUADS); - glColor3f( 0.9, 0.0, 0.0 ); - glMultiTexCoord2f( GL_TEXTURE0, 0.5, 0.5 ); - glMultiTexCoord2f( GL_TEXTURE1, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - glEndList(); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "GL_ARB_texture_env_crossbar test" ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/cva.c b/progs/tests/cva.c deleted file mode 100644 index 8514be6226e..00000000000 --- a/progs/tests/cva.c +++ /dev/null @@ -1,164 +0,0 @@ -/* $Id: cva.c,v 1.7 2003-12-08 09:03:35 joukj Exp $ */ - -/* - * Trivial CVA test, good for testing driver fastpaths (especially - * indexed vertex buffers if they are supported). - * - * Gareth Hughes - * November 2000 - */ - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#ifdef __VMS -# include <stddef.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */ -#else -# include <malloc.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */ -#endif -#ifdef _WIN32 -#include <windows.h> -#endif -#define GL_GLEXT_LEGACY -#include <GL/glut.h> - - -GLfloat verts[][4] = { - { -0.5, -0.5, -2.0, 0.0 }, - { 0.5, -0.5, -2.0, 0.0 }, - { -0.5, 0.5, -2.0, 0.0 }, - { 0.5, 0.5, -2.0, 0.0 }, -}; - -GLubyte color[][4] = { - { 0xff, 0x00, 0x00, 0x00 }, - { 0x00, 0xff, 0x00, 0x00 }, - { 0x00, 0x00, 0xff, 0x00 }, - { 0xff, 0xff, 0xff, 0x00 }, -}; - -GLuint indices[] = { 0, 1, 2, 3 }; - -GLboolean compiled = GL_TRUE; -GLboolean doubleBuffer = GL_TRUE; - - -void init( void ) -{ - glClearColor( 0.0, 0.0, 0.0, 0.0 ); - glShadeModel( GL_SMOOTH ); - - glFrontFace( GL_CCW ); - glCullFace( GL_BACK ); - glEnable( GL_CULL_FACE ); - - glEnable( GL_DEPTH_TEST ); - - glEnableClientState( GL_VERTEX_ARRAY ); - glEnableClientState( GL_COLOR_ARRAY ); - - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -1.0, 1.0, -1.0, 1.0, 2.0, 10.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - - glVertexPointer( 3, GL_FLOAT, sizeof(verts[0]), verts ); - glColorPointer( 4, GL_UNSIGNED_BYTE, 0, color ); - -#ifdef GL_EXT_compiled_vertex_array - if ( compiled ) { - glLockArraysEXT( 0, 4 ); - } -#endif -} - -void display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glDrawElements( GL_TRIANGLES, 3, GL_UNSIGNED_INT, indices ); - - glFlush(); - if ( doubleBuffer ) { - glutSwapBuffers(); - } -} - -void keyboard( unsigned char key, int x, int y ) -{ - switch ( key ) { - case 27: - exit( 0 ); - break; - } - - glutPostRedisplay(); -} - -GLboolean args( int argc, char **argv ) -{ - GLint i; - - doubleBuffer = GL_TRUE; - - for ( i = 1 ; i < argc ; i++ ) { - if ( strcmp( argv[i], "-sb" ) == 0 ) { - doubleBuffer = GL_FALSE; - } else if ( strcmp( argv[i], "-db" ) == 0 ) { - doubleBuffer = GL_TRUE; - } else { - fprintf( stderr, "%s (Bad option).\n", argv[i] ); - return GL_FALSE; - } - } - return GL_TRUE; -} - -int main( int argc, char **argv ) -{ - GLenum type; - char *string; - - glutInit( &argc, argv ); - - if ( args( argc, argv ) == GL_FALSE ) { - exit( 1 ); - } - - type = GLUT_RGB | GLUT_DEPTH; - type |= ( doubleBuffer ) ? GLUT_DOUBLE : GLUT_SINGLE; - - glutInitDisplayMode( type ); - glutInitWindowSize( 250, 250 ); - glutInitWindowPosition( 100, 100 ); - glutCreateWindow( "CVA Test" ); - - /* Make sure the server supports GL 1.2 vertex arrays. - */ - string = (char *) glGetString( GL_VERSION ); - - if ( !strstr(string, "1.2") && - !strstr(string, "1.3") && - !strstr(string, "1.4")) { - fprintf( stderr, "This program requires OpenGL 1.2 vertex arrays.\n" ); - exit( -1 ); - } - - /* See if the server supports compiled vertex arrays. - */ - string = (char *) glGetString( GL_EXTENSIONS ); - - if ( !strstr( string, "GL_EXT_compiled_vertex_array" ) ) { - fprintf( stderr, "Compiled vertex arrays not supported by this renderer.\n" ); - compiled = GL_FALSE; - } - - init(); - - glutDisplayFunc( display ); - glutKeyboardFunc( keyboard ); - glutMainLoop(); - - return 0; -} diff --git a/progs/tests/debugger.c b/progs/tests/debugger.c deleted file mode 100644 index 4c6955bcfc6..00000000000 --- a/progs/tests/debugger.c +++ /dev/null @@ -1,733 +0,0 @@ -/* - * Test the GL_MESA_program_debug extension - */ - - -#include <assert.h> -#include <ctype.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - -/* - * Print the string with line numbers - */ -static void list_program(const GLubyte *string, GLsizei len) -{ - const char *c = (const char *) string; - int i, line = 1, printNumber = 1; - - for (i = 0; i < len; i++) { - if (printNumber) { - printf("%3d ", line); - printNumber = 0; - } - if (*c == '\n') { - line++; - printNumber = 1; - } - putchar(*c); - c++; - } - putchar('\n'); -} - - -/* - * Return the line number and column number that corresponds to the - * given program position. Also return a null-terminated copy of that - * line of the program string. - */ -static const GLubyte * -find_line_column(const GLubyte *string, const GLubyte *pos, - GLint *line, GLint *col) -{ - const GLubyte *lineStart = string; - const GLubyte *p = string; - GLubyte *s; - int len; - - *line = 1; - - while (p != pos) { - if (*p == (GLubyte) '\n') { - (*line)++; - lineStart = p + 1; - } - p++; - } - - *col = (pos - lineStart) + 1; - - /* return copy of this line */ - while (*p != 0 && *p != '\n') - p++; - len = p - lineStart; - s = (GLubyte *) malloc(len + 1); - memcpy(s, lineStart, len); - s[len] = 0; - - return s; -} - - -#define ARB_VERTEX_PROGRAM 1 -#define ARB_FRAGMENT_PROGRAM 2 -#define NV_VERTEX_PROGRAM 3 -#define NV_FRAGMENT_PROGRAM 4 - - -struct breakpoint { - enum {PIXEL, LINE} type; - int x, y; - int line; - GLboolean enabled; -}; - -#define MAX_BREAKPOINTS 100 -static struct breakpoint Breakpoints[MAX_BREAKPOINTS]; -static int NumBreakpoints = 0; - - - -/* - * Interactive debugger - */ -static void Debugger2(GLenum target, GLvoid *data) -{ - static GLuint skipCount = 0; - const GLubyte *ln; - GLint pos, line, column; - GLint id; - int progType; - GLint len; - GLubyte *program; - GLboolean stop; - int i; - - /* Sigh, GL_VERTEX_PROGRAM_ARB == GL_VERTEX_PROGRAM_NV so it's a bit - * hard to distinguish between them. - */ - if (target == GL_FRAGMENT_PROGRAM_ARB) - progType = ARB_FRAGMENT_PROGRAM; - else if (target == GL_FRAGMENT_PROGRAM_NV) - progType = NV_FRAGMENT_PROGRAM; - else - progType = NV_VERTEX_PROGRAM; - - /* Until we hit zero, continue rendering */ - if (skipCount > 0) { - skipCount--; - return; - } - - /* Get id of the program and current position */ - switch (progType) { - case ARB_FRAGMENT_PROGRAM: - glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_BINDING_ARB, &id); - glGetIntegerv(GL_FRAGMENT_PROGRAM_POSITION_MESA, &pos); - break; - case NV_FRAGMENT_PROGRAM: - glGetIntegerv(GL_FRAGMENT_PROGRAM_BINDING_NV, &id); - glGetIntegerv(GL_FRAGMENT_PROGRAM_POSITION_MESA, &pos); - break; - case ARB_VERTEX_PROGRAM: - glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_BINDING_ARB, &id); - glGetIntegerv(GL_VERTEX_PROGRAM_POSITION_MESA, &pos); - break; - case NV_VERTEX_PROGRAM: - glGetIntegerv(GL_VERTEX_PROGRAM_BINDING_NV, &id); - glGetIntegerv(GL_VERTEX_PROGRAM_POSITION_MESA, &pos); - break; - default: - abort(); - } - - /* get program string */ - if (progType == ARB_VERTEX_PROGRAM || - progType == ARB_FRAGMENT_PROGRAM) - glGetProgramivARB(target, GL_PROGRAM_LENGTH_ARB, &len); - else - glGetProgramivNV(id, GL_PROGRAM_LENGTH_NV, &len); - program = malloc(len + 1); - if (progType == ARB_VERTEX_PROGRAM || - progType == ARB_FRAGMENT_PROGRAM) - glGetProgramStringARB(target, GL_PROGRAM_STRING_ARB, program); - else - glGetProgramStringNV(id, GL_PROGRAM_STRING_NV, program); - - - /* Get current line number, column, line string */ - ln = find_line_column(program, program + pos, &line, &column); - - /* test breakpoints */ - if (NumBreakpoints > 0) - stop = GL_FALSE; - else - stop = GL_TRUE; - for (i = 0; i < NumBreakpoints; i++) { - if (Breakpoints[i].enabled) { - switch (Breakpoints[i].type) { - case PIXEL: - if (progType == ARB_FRAGMENT_PROGRAM) { - - } - else if (progType == NV_FRAGMENT_PROGRAM) { - GLfloat pos[4]; - int px, py; - glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV, - 6, (GLubyte *) "f[WPOS]", pos); - px = (int) pos[0]; - py = (int) pos[1]; - printf("%d, %d\n", px, py); - if (px == Breakpoints[i].x && - py == Breakpoints[i].y) { - printf("Break at pixel (%d, %d)\n", px, py); - stop = GL_TRUE; - } - } - break; - case LINE: - if (line == Breakpoints[i].line) { - /* hit a breakpoint! */ - printf("Break at line %d\n", line); - stop = GL_TRUE; - } - break; - } - } - } - if (!stop) { - free(program); - return; - } - - printf("%d: %s\n", line, ln); - - /* get commands from stdin */ - while (1) { - char command[1000], *cmd; - - /* print prompt and get command */ - printf("(%s %d) ", (target == GL_VERTEX_PROGRAM_ARB ? "vert" : "frag"), - line); - fgets(command, 999, stdin); - - /* skip leading whitespace */ - for (cmd = command; cmd[0] == ' '; cmd++) - ; - - if (!cmd[0]) - /* nothing (repeat the previous cmd?) */ - continue; - - switch (cmd[0]) { - case 's': - /* skip N instructions */ - i = atoi(cmd + 2); - skipCount = i; - printf("Skipping %d instructions\n", i); - return; - case 'n': - /* next */ - return; - case 'c': - return; - case 'd': - /* dump machine state */ - if (progType == NV_FRAGMENT_PROGRAM) { - static const char *inRegs[] = { - "f[WPOS]", "f[COL0]", "f[COL1]", "f[FOGC]", - "f[TEX0]", "f[TEX1]", "f[TEX2]", "f[TEX3]", - NULL - }; - static const char *outRegs[] = { - "o[COLR]", "o[COLH]", "o[DEPR]", NULL - }; - GLfloat v[4]; - int i; - printf("Fragment input attributes:\n"); - for (i = 0; inRegs[i]; i++) { - glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV, - strlen(inRegs[i]), - (const GLubyte *) inRegs[i], v); - printf(" %s: %g, %g, %g, %g\n", inRegs[i], - v[0], v[1], v[2], v[3]); - } - printf("Fragment output attributes:\n"); - for (i = 0; outRegs[i]; i++) { - glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV, - strlen(outRegs[i]), - (const GLubyte *) outRegs[i], v); - printf(" %s: %g, %g, %g, %g\n", outRegs[i], - v[0], v[1], v[2], v[3]); - } - printf("Temporaries:\n"); - for (i = 0; i < 4; i++) { - char temp[100]; - GLfloat v[4]; - sprintf(temp, "R%d", i); - glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV, - strlen(temp), - (const GLubyte *) temp, v); - printf(" %s: %g, %g, %g, %g\n", temp, v[0],v[1],v[2],v[3]); - } - } - else if (progType == NV_VERTEX_PROGRAM) { - GLfloat v[4]; - int i; - static const char *inRegs[] = { - "v[OPOS]", "v[WGHT]", "v[NRML]", "v[COL0]", - "v[COL1]", "v[FOGC]", "v[6]", "v[7]", - "v[TEX0]", "v[TEX1]", "v[TEX2]", "v[TEX3]", - "v[TEX4]", "v[TEX5]", "v[TEX6]", "v[TEX7]", - NULL - }; - static const char *outRegs[] = { - "o[HPOS]", "o[COL0]", "o[COL1]", "o[BFC0]", - "o[BFC1]", "o[FOGC]", "o[PSIZ]", - "o[TEX0]", "o[TEX1]", "o[TEX2]", "o[TEX3]", - "o[TEX4]", "o[TEX5]", "o[TEX6]", "o[TEX7]", - NULL - }; - printf("Vertex input attributes:\n"); - for (i = 0; inRegs[i]; i++) { - glGetProgramRegisterfvMESA(GL_VERTEX_PROGRAM_NV, - strlen(inRegs[i]), - (const GLubyte *) inRegs[i], v); - printf(" %s: %g, %g, %g, %g\n", inRegs[i], - v[0], v[1], v[2], v[3]); - } - printf("Vertex output attributes:\n"); - for (i = 0; outRegs[i]; i++) { - glGetProgramRegisterfvMESA(GL_VERTEX_PROGRAM_NV, - strlen(outRegs[i]), - (const GLubyte *) outRegs[i], v); - printf(" %s: %g, %g, %g, %g\n", outRegs[i], - v[0], v[1], v[2], v[3]); - } - printf("Temporaries:\n"); - for (i = 0; i < 4; i++) { - char temp[100]; - GLfloat v[4]; - sprintf(temp, "R%d", i); - glGetProgramRegisterfvMESA(GL_VERTEX_PROGRAM_NV, - strlen(temp), - (const GLubyte *) temp, v); - printf(" %s: %g, %g, %g, %g\n", temp, v[0],v[1],v[2],v[3]); - } - } - break; - case 'l': - /* list */ - list_program(program, len); - break; - case 'p': - /* print */ - { - GLfloat v[4]; - char *c; - cmd++; - while (*cmd == ' ') - cmd++; - c = cmd; - while (*c) { - if (*c == '\n' || *c == '\r') - *c = 0; - else - c++; - } - glGetProgramRegisterfvMESA(target, strlen(cmd), - (const GLubyte *) cmd, v); - if (glGetError() == GL_NO_ERROR) - printf("%s = %g, %g, %g, %g\n", cmd, v[0], v[1], v[2], v[3]); - else - printf("Invalid expression\n"); - } - break; - case 'b': - if (cmd[1] == ' ' && isdigit(cmd[2])) { - char *comma = strchr(cmd, ','); - if (comma) { - /* break at pixel */ - int x = atoi(cmd + 2); - int y = atoi(comma + 1); - if (NumBreakpoints < MAX_BREAKPOINTS) { - Breakpoints[NumBreakpoints].type = PIXEL; - Breakpoints[NumBreakpoints].x = x; - Breakpoints[NumBreakpoints].y = y; - Breakpoints[NumBreakpoints].enabled = GL_TRUE; - NumBreakpoints++; - printf("Breakpoint %d: break at pixel (%d, %d)\n", - NumBreakpoints, x, y); - } - } - else { - /* break at line */ - int l = atoi(cmd + 2); - if (l && NumBreakpoints < MAX_BREAKPOINTS) { - Breakpoints[NumBreakpoints].type = LINE; - Breakpoints[NumBreakpoints].line = l; - Breakpoints[NumBreakpoints].enabled = GL_TRUE; - NumBreakpoints++; - printf("Breakpoint %d: break at line %d\n", - NumBreakpoints, l); - } - } - } - else { - /* list breakpoints */ - printf("Breakpoints:\n"); - for (i = 0; i < NumBreakpoints; i++) { - switch (Breakpoints[i].type) { - case LINE: - printf(" %d: break at line %d\n", - i + 1, Breakpoints[i].line); - break; - case PIXEL: - printf(" %d: break at pixel (%d, %d)\n", - i + 1, Breakpoints[i].x, Breakpoints[i].y); - break; - } - } - } - break; - case 'h': - /* help */ - printf("Debugger commands:\n"); - printf(" b list breakpoints\n"); - printf(" b N break at line N\n"); - printf(" b x,y break at pixel x,y\n"); - printf(" c continue execution\n"); - printf(" d display register values\n"); - printf(" h help\n"); - printf(" l list program\n"); - printf(" n next instruction\n"); - printf(" p V print value V\n"); - printf(" s N skip N instructions\n"); - break; - default: - printf("Unknown command: %c\n", cmd[0]); - } - } -} - - -/* - * Print current line, some registers, and continue. - */ -static void Debugger(GLenum target, GLvoid *data) -{ - GLint pos; - const GLubyte *ln; - GLint line, column; - GLfloat v[4]; - - assert(target == GL_FRAGMENT_PROGRAM_NV); - - glGetIntegerv(GL_FRAGMENT_PROGRAM_POSITION_MESA, &pos); - - ln = find_line_column((const GLubyte *) data, (const GLubyte *) data + pos, - &line, &column); - printf("%d:%d: %s\n", line, column, (char *) ln); - - glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV, - 2, (const GLubyte *) "R0", v); - printf(" R0 = %g, %g, %g, %g\n", v[0], v[1], v[2], v[3]); - glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV, - 7, (const GLubyte *) "f[WPOS]", v); - printf(" o[WPOS] = %g, %g, %g, %g\n", v[0], v[1], v[2], v[3]); - glGetProgramRegisterfvMESA(GL_FRAGMENT_PROGRAM_NV, - 7, (const GLubyte *) "o[COLR]", v); - printf(" o[COLR] = %g, %g, %g, %g\n", v[0], v[1], v[2], v[3]); - - free((void *) ln); -} - - - - -/**********************************************************************/ - -static GLfloat Diffuse[4] = { 0.5, 0.5, 1.0, 1.0 }; -static GLfloat Specular[4] = { 0.8, 0.8, 0.8, 1.0 }; -static GLfloat LightPos[4] = { 0.0, 10.0, 20.0, 1.0 }; -static GLfloat Delta = 1.0; - -static GLuint FragProg; -static GLuint VertProg; -static GLboolean Anim = GL_TRUE; -static GLboolean Wire = GL_FALSE; -static GLboolean PixelLight = GL_TRUE; - -static GLfloat Xrot = 0, Yrot = 0; - - -#define NAMED_PARAMETER4FV(prog, name, v) \ - glProgramNamedParameter4fvNV(prog, strlen(name), (const GLubyte *) name, v) - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - if (PixelLight) { - NAMED_PARAMETER4FV(FragProg, "LightPos", LightPos); - glEnable(GL_FRAGMENT_PROGRAM_NV); - glEnable(GL_VERTEX_PROGRAM_NV); - glDisable(GL_LIGHTING); - } - else { - glLightfv(GL_LIGHT0, GL_POSITION, LightPos); - glDisable(GL_FRAGMENT_PROGRAM_NV); - glDisable(GL_VERTEX_PROGRAM_NV); - glEnable(GL_LIGHTING); - } - - glPushMatrix(); - glRotatef(Xrot, 1, 0, 0); - glRotatef(Yrot, 0, 1, 0); - -#if 1 - glutSolidSphere(2.0, 10, 5); -#else - { - GLUquadricObj *q = gluNewQuadric(); - gluQuadricNormals(q, GL_SMOOTH); - gluQuadricTexture(q, GL_TRUE); - glRotatef(90, 1, 0, 0); - glTranslatef(0, 0, -1); - gluCylinder(q, 1.0, 1.0, 2.0, 24, 1); - gluDeleteQuadric(q); - } -#endif - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Idle(void) -{ - LightPos[0] += Delta; - if (LightPos[0] > 25.0) - Delta = -1.0; - else if (LightPos[0] <- 25.0) - Delta = 1.0; - 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 ); - /*glOrtho( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 );*/ - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case ' ': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 'x': - LightPos[0] -= 1.0; - break; - case 'X': - LightPos[0] += 1.0; - 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: - exit(0); - break; - } - glutPostRedisplay(); -} - -static void SpecialKey( int key, int x, int y ) -{ - const GLfloat step = 3.0; - (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( int argc, char *argv[] ) -{ - static const char *fragProgramText = - "!!FP1.0\n" - "DECLARE Diffuse; \n" - "DECLARE Specular; \n" - "DECLARE LightPos; \n" - - "# Compute normalized LightPos, put it in R0\n" - "DP3 R0.x, LightPos, LightPos;\n" - "RSQ R0.y, R0.x;\n" - "MUL R0, LightPos, R0.y;\n" - - "# Compute normalized normal, put it in R1\n" - "DP3 R1, f[TEX0], f[TEX0]; \n" - "RSQ R1.y, R1.x;\n" - "MUL R1, f[TEX0], R1.y;\n" - - "# Compute dot product of light direction and normal vector\n" - "DP3 R2, R0, R1;\n" - - "MUL R3, Diffuse, R2; # diffuse attenuation\n" - - "POW R4, R2.x, {20.0}.x; # specular exponent\n" - - "MUL R5, Specular, R4; # specular attenuation\n" - - "ADD o[COLR], R3, R5; # add diffuse and specular colors\n" - "END \n" - ; - - static const char *vertProgramText = - "!!VP1.0\n" - "# typical modelview/projection transform\n" - "DP4 o[HPOS].x, c[0], v[OPOS] ;\n" - "DP4 o[HPOS].y, c[1], v[OPOS] ;\n" - "DP4 o[HPOS].z, c[2], v[OPOS] ;\n" - "DP4 o[HPOS].w, c[3], v[OPOS] ;\n" - "# transform normal by inv transpose of modelview, put in tex0\n" - "DP4 o[TEX0].x, c[4], v[NRML] ;\n" - "DP4 o[TEX0].y, c[5], v[NRML] ;\n" - "DP4 o[TEX0].z, c[6], v[NRML] ;\n" - "DP4 o[TEX0].w, c[7], v[NRML] ;\n" - "END\n"; - ; - - if (!glutExtensionSupported("GL_NV_vertex_program")) { - printf("Sorry, this demo requires GL_NV_vertex_program\n"); - exit(1); - } - if (!glutExtensionSupported("GL_NV_fragment_program")) { - printf("Sorry, this demo requires GL_NV_fragment_program\n"); - exit(1); - } - - glGenProgramsNV(1, &FragProg); - assert(FragProg > 0); - glGenProgramsNV(1, &VertProg); - assert(VertProg > 0); - - /* - * Fragment program - */ - glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, FragProg, - strlen(fragProgramText), - (const GLubyte *) fragProgramText); - assert(glIsProgramNV(FragProg)); - glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, FragProg); - - NAMED_PARAMETER4FV(FragProg, "Diffuse", Diffuse); - NAMED_PARAMETER4FV(FragProg, "Specular", Specular); - - /* - * Vertex program - */ - glLoadProgramNV(GL_VERTEX_PROGRAM_NV, VertProg, - strlen(vertProgramText), - (const GLubyte *) vertProgramText); - assert(glIsProgramNV(VertProg)); - glBindProgramNV(GL_VERTEX_PROGRAM_NV, VertProg); - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV); - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MODELVIEW, GL_INVERSE_TRANSPOSE_NV); - - /* - * Misc init - */ - glClearColor(0.3, 0.3, 0.3, 0.0); - 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.0); - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("Press p to toggle between per-pixel and per-vertex lighting\n"); - -#ifdef GL_MESA_program_debug - if (argc > 1 && strcmp(argv[1], "fragment") == 0) { - printf(">> Debugging fragment program\n"); - glProgramCallbackMESA(GL_FRAGMENT_PROGRAM_ARB, Debugger2, - (GLvoid *) fragProgramText); - glEnable(GL_FRAGMENT_PROGRAM_CALLBACK_MESA); - } - else { - printf(">> Debugging vertex program\n"); - glProgramCallbackMESA(GL_VERTEX_PROGRAM_ARB, Debugger2, - (GLvoid *) fragProgramText); - glEnable(GL_VERTEX_PROGRAM_CALLBACK_MESA); - } -#endif -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 200, 200 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc(Idle); - Init(argc, argv); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/descrip.mms b/progs/tests/descrip.mms deleted file mode 100644 index b6ba3e1aebb..00000000000 --- a/progs/tests/descrip.mms +++ /dev/null @@ -1,84 +0,0 @@ -# Makefile for GLUT-based demo programs for VMS -# contributed by Jouk Jansen [email protected] - - -.first - define gl [--.include.gl] - -.include [--]mms-config. - -##### MACROS ##### - -INCDIR = ([--.include],[-.util]) -CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm - -.ifdef SHARE -GL_LIBS = $(XLIBS) -.else -GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS) -.endif - -LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB) - -PROGS = cva.exe,\ - dinoshade.exe,\ - fogcoord.exe,\ - manytex.exe,\ - multipal.exe,\ - projtex.exe,\ - seccolor.exe,\ - sharedtex.exe,\ - texline.exe,\ - texwrap.exe,\ - vptest1.exe,\ - vptest2.exe,\ - vptest3.exe,\ - vptorus.exe,\ - vpwarpmesh.exe - -##### RULES ##### -.obj.exe : - cxxlink $(MMS$TARGET_NAME),$(GL_LIBS) - -##### TARGETS ##### -default : - $(MMS)$(MMSQUALIFIERS) $(PROGS) - -clean : - delete *.obj;* - -realclean : - delete $(PROGS) - delete *.obj;* - -cva.exe : cva.obj $(LIB_DEP) -dinoshade.exe : dinoshade.obj $(LIB_DEP) -fogcoord.exe : fogcoord.obj $(LIB_DEP) -manytex.exe : manytex.obj $(LIB_DEP) -multipal.exe : multipal.obj $(LIB_DEP) -projtex.exe : projtex.obj $(LIB_DEP) -seccolor.exe : seccolor.obj $(LIB_DEP) -sharedtex.exe : sharedtex.obj $(LIB_DEP) -texline.exe : texline.obj $(LIB_DEP) -texwrap.exe : texwrap.obj $(LIB_DEP) -vptest1.exe : vptest1.obj $(LIB_DEP) -vptest2.exe : vptest2.obj $(LIB_DEP) -vptest3.exe : vptest3.obj $(LIB_DEP) -vptorus.exe : vptorus.obj $(LIB_DEP) -vpwarpmesh.exe : vpwarpmesh.obj $(LIB_DEP) - -cva.obj : cva.c -dinoshade.obj : dinoshade.c -fogcoord.obj : fogcoord.c -manytex.obj : manytex.c -multipal.obj : multipal.c -projtex.obj : projtex.c -seccolor.obj : seccolor.c -sharedtex.obj : sharedtex.c -texline.obj : texline.c -texwrap.obj : texwrap.c -vptest1.obj : vptest1.c -vptest2.obj : vptest2.c -vptest3.obj : vptest3.c -vptorus.obj : vptorus.c -vpwarpmesh.obj : vpwarpmesh.c diff --git a/progs/tests/dinoshade.c b/progs/tests/dinoshade.c deleted file mode 100644 index ed7b879bc71..00000000000 --- a/progs/tests/dinoshade.c +++ /dev/null @@ -1,914 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -/* Example for PC game developers to show how to *combine* texturing, - reflections, and projected shadows all in real-time with OpenGL. - Robust reflections use stenciling. Robust projected shadows - use both stenciling and polygon offset. PC game programmers - should realize that neither stenciling nor polygon offset are - supported by Direct3D, so these real-time rendering algorithms - are only really viable with OpenGL. - - The program has modes for disabling the stenciling and polygon - offset uses. It is worth running this example with these features - toggled off so you can see the sort of artifacts that result. - - Notice that the floor texturing, reflections, and shadowing - all co-exist properly. */ - -/* When you run this program: Left mouse button controls the - view. Middle mouse button controls light position (left & - right rotates light around dino; up & down moves light - position up and down). Right mouse button pops up menu. */ - -/* Check out the comments in the "redraw" routine to see how the - reflection blending and surface stenciling is done. You can - also see in "redraw" how the projected shadows are rendered, - including the use of stenciling and polygon offset. */ - -/* This program is derived from glutdino.c */ - -/* Compile: cc -o dinoshade dinoshade.c -lglut -lGLU -lGL -lXmu -lXext -lX11 -lm */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> /* for cos(), sin(), and sqrt() */ -#ifdef __VMS -# include <stddef.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */ -#else -# include <malloc.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */ -#endif -#ifdef _WIN32 -#include <windows.h> -#endif -#define GL_GLEXT_LEGACY -#include <GL/glut.h> /* OpenGL Utility Toolkit header */ - -/* Some <math.h> files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -/* Variable controlling various rendering modes. */ -static int stencilReflection = 1, stencilShadow = 1, offsetShadow = 1; -static int renderShadow = 1, renderDinosaur = 1, renderReflection = 1; -static int linearFiltering = 0, useMipmaps = 0, useTexture = 1; -static int reportSpeed = 0; -static int animation = 1; -static GLboolean lightSwitch = GL_TRUE; -static int directionalLight = 1; -static int forceExtension = 0; - -/* Time varying or user-controled variables. */ -static float jump = 0.0; -static float lightAngle = 0.0, lightHeight = 20; -GLfloat angle = -150; /* in degrees */ -GLfloat angle2 = 30; /* in degrees */ - -int moving, startx, starty; -int lightMoving = 0, lightStartX, lightStartY; - -enum { - MISSING, EXTENSION, ONE_DOT_ONE -}; -int polygonOffsetVersion; - -static GLdouble bodyWidth = 3.0; -/* *INDENT-OFF* */ -static GLfloat body[][2] = { {0, 3}, {1, 1}, {5, 1}, {8, 4}, {10, 4}, {11, 5}, - {11, 11.5}, {13, 12}, {13, 13}, {10, 13.5}, {13, 14}, {13, 15}, {11, 16}, - {8, 16}, {7, 15}, {7, 13}, {8, 12}, {7, 11}, {6, 6}, {4, 3}, {3, 2}, - {1, 2} }; -static GLfloat arm[][2] = { {8, 10}, {9, 9}, {10, 9}, {13, 8}, {14, 9}, {16, 9}, - {15, 9.5}, {16, 10}, {15, 10}, {15.5, 11}, {14.5, 10}, {14, 11}, {14, 10}, - {13, 9}, {11, 11}, {9, 11} }; -static GLfloat leg[][2] = { {8, 6}, {8, 4}, {9, 3}, {9, 2}, {8, 1}, {8, 0.5}, {9, 0}, - {12, 0}, {10, 1}, {10, 2}, {12, 4}, {11, 6}, {10, 7}, {9, 7} }; -static GLfloat eye[][2] = { {8.75, 15}, {9, 14.7}, {9.6, 14.7}, {10.1, 15}, - {9.6, 15.25}, {9, 15.25} }; -static GLfloat lightPosition[4]; -static GLfloat lightColor[] = {0.8, 1.0, 0.8, 1.0}; /* green-tinted */ -static GLfloat skinColor[] = {0.1, 1.0, 0.1, 1.0}, eyeColor[] = {1.0, 0.2, 0.2, 1.0}; -/* *INDENT-ON* */ - -/* Nice floor texture tiling pattern. */ -static char *circles[] = { - "....xxxx........", - "..xxxxxxxx......", - ".xxxxxxxxxx.....", - ".xxx....xxx.....", - "xxx......xxx....", - "xxx......xxx....", - "xxx......xxx....", - "xxx......xxx....", - ".xxx....xxx.....", - ".xxxxxxxxxx.....", - "..xxxxxxxx......", - "....xxxx........", - "................", - "................", - "................", - "................", -}; - -static void -makeFloorTexture(void) -{ - GLubyte floorTexture[16][16][3]; - GLubyte *loc; - int s, t; - - /* Setup RGB image for the texture. */ - loc = (GLubyte*) floorTexture; - for (t = 0; t < 16; t++) { - for (s = 0; s < 16; s++) { - if (circles[t][s] == 'x') { - /* Nice green. */ - loc[0] = 0x1f; - loc[1] = 0x8f; - loc[2] = 0x1f; - } else { - /* Light gray. */ - loc[0] = 0xaa; - loc[1] = 0xaa; - loc[2] = 0xaa; - } - loc += 3; - } - } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - if (useMipmaps) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_LINEAR_MIPMAP_LINEAR); - gluBuild2DMipmaps(GL_TEXTURE_2D, 3, 16, 16, - GL_RGB, GL_UNSIGNED_BYTE, floorTexture); - } else { - if (linearFiltering) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - } - glTexImage2D(GL_TEXTURE_2D, 0, 3, 16, 16, 0, - GL_RGB, GL_UNSIGNED_BYTE, floorTexture); - } -} - -enum { - X, Y, Z, W -}; -enum { - A, B, C, D -}; - -/* Create a matrix that will project the desired shadow. */ -void -shadowMatrix(GLfloat shadowMat[4][4], - GLfloat groundplane[4], - GLfloat lightpos[4]) -{ - GLfloat dot; - - /* Find dot product between light position vector and ground plane normal. */ - dot = groundplane[X] * lightpos[X] + - groundplane[Y] * lightpos[Y] + - groundplane[Z] * lightpos[Z] + - groundplane[W] * lightpos[W]; - - shadowMat[0][0] = dot - lightpos[X] * groundplane[X]; - shadowMat[1][0] = 0.f - lightpos[X] * groundplane[Y]; - shadowMat[2][0] = 0.f - lightpos[X] * groundplane[Z]; - shadowMat[3][0] = 0.f - lightpos[X] * groundplane[W]; - - shadowMat[X][1] = 0.f - lightpos[Y] * groundplane[X]; - shadowMat[1][1] = dot - lightpos[Y] * groundplane[Y]; - shadowMat[2][1] = 0.f - lightpos[Y] * groundplane[Z]; - shadowMat[3][1] = 0.f - lightpos[Y] * groundplane[W]; - - shadowMat[X][2] = 0.f - lightpos[Z] * groundplane[X]; - shadowMat[1][2] = 0.f - lightpos[Z] * groundplane[Y]; - shadowMat[2][2] = dot - lightpos[Z] * groundplane[Z]; - shadowMat[3][2] = 0.f - lightpos[Z] * groundplane[W]; - - shadowMat[X][3] = 0.f - lightpos[W] * groundplane[X]; - shadowMat[1][3] = 0.f - lightpos[W] * groundplane[Y]; - shadowMat[2][3] = 0.f - lightpos[W] * groundplane[Z]; - shadowMat[3][3] = dot - lightpos[W] * groundplane[W]; - -} - -/* Find the plane equation given 3 points. */ -void -findPlane(GLfloat plane[4], - GLfloat v0[3], GLfloat v1[3], GLfloat v2[3]) -{ - GLfloat vec0[3], vec1[3]; - - /* Need 2 vectors to find cross product. */ - vec0[X] = v1[X] - v0[X]; - vec0[Y] = v1[Y] - v0[Y]; - vec0[Z] = v1[Z] - v0[Z]; - - vec1[X] = v2[X] - v0[X]; - vec1[Y] = v2[Y] - v0[Y]; - vec1[Z] = v2[Z] - v0[Z]; - - /* find cross product to get A, B, and C of plane equation */ - plane[A] = vec0[Y] * vec1[Z] - vec0[Z] * vec1[Y]; - plane[B] = -(vec0[X] * vec1[Z] - vec0[Z] * vec1[X]); - plane[C] = vec0[X] * vec1[Y] - vec0[Y] * vec1[X]; - - plane[D] = -(plane[A] * v0[X] + plane[B] * v0[Y] + plane[C] * v0[Z]); -} - -void -extrudeSolidFromPolygon(GLfloat data[][2], unsigned int dataSize, - GLdouble thickness, GLuint side, GLuint edge, GLuint whole) -{ - static GLUtriangulatorObj *tobj = NULL; - GLdouble vertex[3], dx, dy, len; - int i; - int count = (int) (dataSize / (2 * sizeof(GLfloat))); - - if (tobj == NULL) { - tobj = gluNewTess(); /* create and initialize a GLU - polygon tesselation object */ - gluTessCallback(tobj, GLU_BEGIN, glBegin); - gluTessCallback(tobj, GLU_VERTEX, glVertex2fv); /* semi-tricky */ - gluTessCallback(tobj, GLU_END, glEnd); - } - glNewList(side, GL_COMPILE); - glShadeModel(GL_SMOOTH); /* smooth minimizes seeing - tessellation */ - gluBeginPolygon(tobj); - for (i = 0; i < count; i++) { - vertex[0] = data[i][0]; - vertex[1] = data[i][1]; - vertex[2] = 0; - gluTessVertex(tobj, vertex, data[i]); - } - gluEndPolygon(tobj); - glEndList(); - glNewList(edge, GL_COMPILE); - glShadeModel(GL_FLAT); /* flat shade keeps angular hands - from being "smoothed" */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= count; i++) { -#if 1 /* weird, but seems to be legal */ - /* mod function handles closing the edge */ - glVertex3f(data[i % count][0], data[i % count][1], 0.0); - glVertex3f(data[i % count][0], data[i % count][1], thickness); - /* Calculate a unit normal by dividing by Euclidean - distance. We * could be lazy and use - glEnable(GL_NORMALIZE) so we could pass in * arbitrary - normals for a very slight performance hit. */ - dx = data[(i + 1) % count][1] - data[i % count][1]; - dy = data[i % count][0] - data[(i + 1) % count][0]; - len = sqrt(dx * dx + dy * dy); - glNormal3f(dx / len, dy / len, 0.0); -#else /* the nice way of doing it */ - /* Calculate a unit normal by dividing by Euclidean - distance. We * could be lazy and use - glEnable(GL_NORMALIZE) so we could pass in * arbitrary - normals for a very slight performance hit. */ - dx = data[i % count][1] - data[(i - 1 + count) % count][1]; - dy = data[(i - 1 + count) % count][0] - data[i % count][0]; - len = sqrt(dx * dx + dy * dy); - glNormal3f(dx / len, dy / len, 0.0); - /* mod function handles closing the edge */ - glVertex3f(data[i % count][0], data[i % count][1], 0.0); - glVertex3f(data[i % count][0], data[i % count][1], thickness); -#endif - } - glEnd(); - glEndList(); - glNewList(whole, GL_COMPILE); - glFrontFace(GL_CW); - glCallList(edge); - glNormal3f(0.0, 0.0, -1.0); /* constant normal for side */ - glCallList(side); - glPushMatrix(); - glTranslatef(0.0, 0.0, thickness); - glFrontFace(GL_CCW); - glNormal3f(0.0, 0.0, 1.0); /* opposite normal for other side */ - glCallList(side); - glPopMatrix(); - glEndList(); -} - -/* Enumerants for refering to display lists. */ -typedef enum { - RESERVED, BODY_SIDE, BODY_EDGE, BODY_WHOLE, ARM_SIDE, ARM_EDGE, ARM_WHOLE, - LEG_SIDE, LEG_EDGE, LEG_WHOLE, EYE_SIDE, EYE_EDGE, EYE_WHOLE -} displayLists; - -static void -makeDinosaur(void) -{ - extrudeSolidFromPolygon(body, sizeof(body), bodyWidth, - BODY_SIDE, BODY_EDGE, BODY_WHOLE); - extrudeSolidFromPolygon(arm, sizeof(arm), bodyWidth / 4, - ARM_SIDE, ARM_EDGE, ARM_WHOLE); - extrudeSolidFromPolygon(leg, sizeof(leg), bodyWidth / 2, - LEG_SIDE, LEG_EDGE, LEG_WHOLE); - extrudeSolidFromPolygon(eye, sizeof(eye), bodyWidth + 0.2, - EYE_SIDE, EYE_EDGE, EYE_WHOLE); -} - -static void -drawDinosaur(void) - -{ - glPushMatrix(); - /* Translate the dinosaur to be at (0,8,0). */ - glTranslatef(-8, 0, -bodyWidth / 2); - glTranslatef(0.0, jump, 0.0); - glMaterialfv(GL_FRONT, GL_DIFFUSE, skinColor); - glCallList(BODY_WHOLE); - glTranslatef(0.0, 0.0, bodyWidth); - glCallList(ARM_WHOLE); - glCallList(LEG_WHOLE); - glTranslatef(0.0, 0.0, -bodyWidth - bodyWidth / 4); - glCallList(ARM_WHOLE); - glTranslatef(0.0, 0.0, -bodyWidth / 4); - glCallList(LEG_WHOLE); - glTranslatef(0.0, 0.0, bodyWidth / 2 - 0.1); - glMaterialfv(GL_FRONT, GL_DIFFUSE, eyeColor); - glCallList(EYE_WHOLE); - glPopMatrix(); -} - -static GLfloat floorVertices[4][3] = { - { -20.0, 0.0, 20.0 }, - { 20.0, 0.0, 20.0 }, - { 20.0, 0.0, -20.0 }, - { -20.0, 0.0, -20.0 }, -}; - -/* Draw a floor (possibly textured). */ -static void -drawFloor(void) -{ - glDisable(GL_LIGHTING); - - if (useTexture) { - glEnable(GL_TEXTURE_2D); - } - - glBegin(GL_QUADS); - glTexCoord2f(0.0, 0.0); - glVertex3fv(floorVertices[0]); - glTexCoord2f(0.0, 16.0); - glVertex3fv(floorVertices[1]); - glTexCoord2f(16.0, 16.0); - glVertex3fv(floorVertices[2]); - glTexCoord2f(16.0, 0.0); - glVertex3fv(floorVertices[3]); - glEnd(); - - if (useTexture) { - glDisable(GL_TEXTURE_2D); - } - - glEnable(GL_LIGHTING); -} - -static GLfloat floorPlane[4]; -static GLfloat floorShadow[4][4]; - -static void -redraw(void) -{ - int start, end; - - if (reportSpeed) { - start = glutGet(GLUT_ELAPSED_TIME); - } - - /* Clear; default stencil clears to zero. */ - if ((stencilReflection && renderReflection) || (stencilShadow && renderShadow)) { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - } else { - /* Avoid clearing stencil when not using it. */ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - } - - /* Reposition the light source. */ - lightPosition[0] = 12*cos(lightAngle); - lightPosition[1] = lightHeight; - lightPosition[2] = 12*sin(lightAngle); - if (directionalLight) { - lightPosition[3] = 0.0; - } else { - lightPosition[3] = 1.0; - } - - shadowMatrix(floorShadow, floorPlane, lightPosition); - - glPushMatrix(); - /* Perform scene rotations based on user mouse input. */ - glRotatef(angle2, 1.0, 0.0, 0.0); - glRotatef(angle, 0.0, 1.0, 0.0); - - /* Tell GL new light source position. */ - glLightfv(GL_LIGHT0, GL_POSITION, lightPosition); - - if (renderReflection) { - if (stencilReflection) { - /* We can eliminate the visual "artifact" of seeing the "flipped" - dinosaur underneath the floor by using stencil. The idea is - draw the floor without color or depth update but so that - a stencil value of one is where the floor will be. Later when - rendering the dinosaur reflection, we will only update pixels - with a stencil value of 1 to make sure the reflection only - lives on the floor, not below the floor. */ - - /* Don't update color or depth. */ - glDisable(GL_DEPTH_TEST); - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - - /* Draw 1 into the stencil buffer. */ - glEnable(GL_STENCIL_TEST); - glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); - glStencilFunc(GL_ALWAYS, 1, 0xffffffff); - - /* Now render floor; floor pixels just get their stencil set to 1. */ - drawFloor(); - - /* Re-enable update of color and depth. */ - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glEnable(GL_DEPTH_TEST); - - /* Now, only render where stencil is set to 1. */ - glStencilFunc(GL_EQUAL, 1, 0xffffffff); /* draw if ==1 */ - glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); - } - - glPushMatrix(); - - /* The critical reflection step: Reflect dinosaur through the floor - (the Y=0 plane) to make a relection. */ - glScalef(1.0, -1.0, 1.0); - - /* Reflect the light position. */ - glLightfv(GL_LIGHT0, GL_POSITION, lightPosition); - - /* To avoid our normals getting reversed and hence botched lighting - on the reflection, turn on normalize. */ - glEnable(GL_NORMALIZE); - glCullFace(GL_FRONT); - - /* Draw the reflected dinosaur. */ - drawDinosaur(); - - /* Disable noramlize again and re-enable back face culling. */ - glDisable(GL_NORMALIZE); - glCullFace(GL_BACK); - - glPopMatrix(); - - /* Switch back to the unreflected light position. */ - glLightfv(GL_LIGHT0, GL_POSITION, lightPosition); - - if (stencilReflection) { - glDisable(GL_STENCIL_TEST); - } - } - - /* Back face culling will get used to only draw either the top or the - bottom floor. This let's us get a floor with two distinct - appearances. The top floor surface is reflective and kind of red. - The bottom floor surface is not reflective and blue. */ - - /* Draw "bottom" of floor in blue. */ - glFrontFace(GL_CW); /* Switch face orientation. */ - glColor4f(0.1, 0.1, 0.7, 1.0); - drawFloor(); - glFrontFace(GL_CCW); - - if (renderShadow) { - if (stencilShadow) { - /* Draw the floor with stencil value 3. This helps us only - draw the shadow once per floor pixel (and only on the - floor pixels). */ - glEnable(GL_STENCIL_TEST); - glStencilFunc(GL_ALWAYS, 3, 0xffffffff); - glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - } - } - - /* Draw "top" of floor. Use blending to blend in reflection. */ - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4f(0.7, 0.0, 0.0, 0.3); - glColor4f(1.0, 1.0, 1.0, 0.3); - drawFloor(); - glDisable(GL_BLEND); - - if (renderDinosaur) { - /* Draw "actual" dinosaur, not its reflection. */ - drawDinosaur(); - } - - if (renderShadow) { - - /* Render the projected shadow. */ - - if (stencilShadow) { - - /* Now, only render where stencil is set above 2 (ie, 3 where - the top floor is). Update stencil with 2 where the shadow - gets drawn so we don't redraw (and accidently reblend) the - shadow). */ - glStencilFunc(GL_LESS, 2, 0xffffffff); /* draw if ==1 */ - glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); - } - - /* To eliminate depth buffer artifacts, we use polygon offset - to raise the depth of the projected shadow slightly so - that it does not depth buffer alias with the floor. */ - if (offsetShadow) { - switch (polygonOffsetVersion) { - case EXTENSION: -#ifdef GL_EXT_polygon_offset - glEnable(GL_POLYGON_OFFSET_EXT); - break; -#endif -#ifdef GL_VERSION_1_1 - case ONE_DOT_ONE: - glEnable(GL_POLYGON_OFFSET_FILL); - break; -#endif - case MISSING: - /* Oh well. */ - break; - } - } - - /* Render 50% black shadow color on top of whatever the - floor appareance is. */ - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glDisable(GL_LIGHTING); /* Force the 50% black. */ - glColor4f(0.0, 0.0, 0.0, 0.5); - - glPushMatrix(); - /* Project the shadow. */ - glMultMatrixf((GLfloat *) floorShadow); - drawDinosaur(); - glPopMatrix(); - - glDisable(GL_BLEND); - glEnable(GL_LIGHTING); - - if (offsetShadow) { - switch (polygonOffsetVersion) { -#ifdef GL_EXT_polygon_offset - case EXTENSION: - glDisable(GL_POLYGON_OFFSET_EXT); - break; -#endif -#ifdef GL_VERSION_1_1 - case ONE_DOT_ONE: - glDisable(GL_POLYGON_OFFSET_FILL); - break; -#endif - case MISSING: - /* Oh well. */ - break; - } - } - if (stencilShadow) { - glDisable(GL_STENCIL_TEST); - } - } - - glPushMatrix(); - glDisable(GL_LIGHTING); - glColor3f(1.0, 1.0, 0.0); - if (directionalLight) { - /* Draw an arrowhead. */ - glDisable(GL_CULL_FACE); - glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]); - glRotatef(lightAngle * -180.0 / M_PI, 0, 1, 0); - glRotatef(atan(lightHeight/12) * 180.0 / M_PI, 0, 0, 1); - glBegin(GL_TRIANGLE_FAN); - glVertex3f(0, 0, 0); - glVertex3f(2, 1, 1); - glVertex3f(2, -1, 1); - glVertex3f(2, -1, -1); - glVertex3f(2, 1, -1); - glVertex3f(2, 1, 1); - glEnd(); - /* Draw a white line from light direction. */ - glColor3f(1.0, 1.0, 1.0); - glBegin(GL_LINES); - glVertex3f(0, 0, 0); - glVertex3f(5, 0, 0); - glEnd(); - glEnable(GL_CULL_FACE); - } else { - /* Draw a yellow ball at the light source. */ - glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]); - glutSolidSphere(1.0, 5, 5); - } - glEnable(GL_LIGHTING); - glPopMatrix(); - - glPopMatrix(); - - if (reportSpeed) { - glFinish(); - end = glutGet(GLUT_ELAPSED_TIME); - printf("Speed %.3g frames/sec (%d ms)\n", 1000.0/(end-start), end-start); - } - - glutSwapBuffers(); -} - -/* ARGSUSED2 */ -static void -mouse(int button, int state, int x, int y) -{ - if (button == GLUT_LEFT_BUTTON) { - if (state == GLUT_DOWN) { - moving = 1; - startx = x; - starty = y; - } - if (state == GLUT_UP) { - moving = 0; - } - } - if (button == GLUT_MIDDLE_BUTTON) { - if (state == GLUT_DOWN) { - lightMoving = 1; - lightStartX = x; - lightStartY = y; - } - if (state == GLUT_UP) { - lightMoving = 0; - } - } -} - -/* ARGSUSED1 */ -static void -motion(int x, int y) -{ - if (moving) { - angle = angle + (x - startx); - angle2 = angle2 + (y - starty); - startx = x; - starty = y; - glutPostRedisplay(); - } - if (lightMoving) { - lightAngle += (x - lightStartX)/40.0; - lightHeight += (lightStartY - y)/20.0; - lightStartX = x; - lightStartY = y; - glutPostRedisplay(); - } -} - -/* Advance time varying state when idle callback registered. */ -static void -idle(void) -{ - static float time = 0.0; - - time = glutGet(GLUT_ELAPSED_TIME) / 500.0; - - jump = 4.0 * fabs(sin(time)*0.5); - if (!lightMoving) { - lightAngle += 0.03; - } - glutPostRedisplay(); -} - -enum { - M_NONE, M_MOTION, M_LIGHT, M_TEXTURE, M_SHADOWS, M_REFLECTION, M_DINOSAUR, - M_STENCIL_REFLECTION, M_STENCIL_SHADOW, M_OFFSET_SHADOW, - M_POSITIONAL, M_DIRECTIONAL, M_PERFORMANCE -}; - -static void -controlLights(int value) -{ - switch (value) { - case M_NONE: - return; - case M_MOTION: - animation = 1 - animation; - if (animation) { - glutIdleFunc(idle); - } else { - glutIdleFunc(NULL); - } - break; - case M_LIGHT: - lightSwitch = !lightSwitch; - if (lightSwitch) { - glEnable(GL_LIGHT0); - } else { - glDisable(GL_LIGHT0); - } - break; - case M_TEXTURE: - useTexture = !useTexture; - break; - case M_SHADOWS: - renderShadow = 1 - renderShadow; - break; - case M_REFLECTION: - renderReflection = 1 - renderReflection; - break; - case M_DINOSAUR: - renderDinosaur = 1 - renderDinosaur; - break; - case M_STENCIL_REFLECTION: - stencilReflection = 1 - stencilReflection; - break; - case M_STENCIL_SHADOW: - stencilShadow = 1 - stencilShadow; - break; - case M_OFFSET_SHADOW: - offsetShadow = 1 - offsetShadow; - break; - case M_POSITIONAL: - directionalLight = 0; - break; - case M_DIRECTIONAL: - directionalLight = 1; - break; - case M_PERFORMANCE: - reportSpeed = 1 - reportSpeed; - break; - } - glutPostRedisplay(); -} - -/* When not visible, stop animating. Restart when visible again. */ -static void -visible(int vis) -{ - if (vis == GLUT_VISIBLE) { - if (animation) - glutIdleFunc(idle); - } else { - if (!animation) - glutIdleFunc(NULL); - } -} - -/* Press any key to redraw; good when motion stopped and - performance reporting on. */ -/* ARGSUSED */ -static void -key(unsigned char c, int x, int y) -{ - if (c == 27) { - exit(0); /* IRIS GLism, Escape quits. */ - } - glutPostRedisplay(); -} - -/* Press any key to redraw; good when motion stopped and - performance reporting on. */ -/* ARGSUSED */ -static void -special(int k, int x, int y) -{ - glutPostRedisplay(); -} - -static int -supportsOneDotOne(void) -{ - const char *version; - int major, minor; - - version = (char *) glGetString(GL_VERSION); - if (sscanf(version, "%d.%d", &major, &minor) == 2) - return major >= 1 && minor >= 1; - return 0; /* OpenGL version string malformed! */ -} - -int -main(int argc, char **argv) -{ - int i; - - glutInit(&argc, argv); - - for (i=1; i<argc; i++) { - if (!strcmp("-linear", argv[i])) { - linearFiltering = 1; - } else if (!strcmp("-mipmap", argv[i])) { - useMipmaps = 1; - } else if (!strcmp("-ext", argv[i])) { - forceExtension = 1; - } - } - - glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL); - -#if 0 - /* In GLUT 4.0, you'll be able to do this an be sure to - get 2 bits of stencil if the machine has it for you. */ - glutInitDisplayString("samples stencil>=2 rgb double depth"); -#endif - - glutCreateWindow("Shadowy Leapin' Lizards"); - - if (glutGet(GLUT_WINDOW_STENCIL_SIZE) <= 1) { - printf("dinoshade: Sorry, I need at least 2 bits of stencil.\n"); - exit(1); - } - - /* Register GLUT callbacks. */ - glutDisplayFunc(redraw); - glutMouseFunc(mouse); - glutMotionFunc(motion); - glutVisibilityFunc(visible); - glutKeyboardFunc(key); - glutSpecialFunc(special); - - glutCreateMenu(controlLights); - - glutAddMenuEntry("Toggle motion", M_MOTION); - glutAddMenuEntry("-----------------------", M_NONE); - glutAddMenuEntry("Toggle light", M_LIGHT); - glutAddMenuEntry("Toggle texture", M_TEXTURE); - glutAddMenuEntry("Toggle shadows", M_SHADOWS); - glutAddMenuEntry("Toggle reflection", M_REFLECTION); - glutAddMenuEntry("Toggle dinosaur", M_DINOSAUR); - glutAddMenuEntry("-----------------------", M_NONE); - glutAddMenuEntry("Toggle reflection stenciling", M_STENCIL_REFLECTION); - glutAddMenuEntry("Toggle shadow stenciling", M_STENCIL_SHADOW); - glutAddMenuEntry("Toggle shadow offset", M_OFFSET_SHADOW); - glutAddMenuEntry("----------------------", M_NONE); - glutAddMenuEntry("Positional light", M_POSITIONAL); - glutAddMenuEntry("Directional light", M_DIRECTIONAL); - glutAddMenuEntry("-----------------------", M_NONE); - glutAddMenuEntry("Toggle performance", M_PERFORMANCE); - glutAttachMenu(GLUT_RIGHT_BUTTON); - makeDinosaur(); - -#ifdef GL_VERSION_1_1 - if (supportsOneDotOne() && !forceExtension) { - polygonOffsetVersion = ONE_DOT_ONE; - glPolygonOffset(-2.0, -9.0); - } else -#endif - { -#ifdef GL_EXT_polygon_offset - /* check for the polygon offset extension */ - if (glutExtensionSupported("GL_EXT_polygon_offset")) { - polygonOffsetVersion = EXTENSION; - glPolygonOffsetEXT(-2.0, -0.002); - } else -#endif - { - polygonOffsetVersion = MISSING; - printf("\ndinoshine: Missing polygon offset.\n"); - printf(" Expect shadow depth aliasing artifacts.\n\n"); - } - } - - glEnable(GL_CULL_FACE); - glEnable(GL_DEPTH_TEST); - glEnable(GL_TEXTURE_2D); - glLineWidth(3.0); - - glMatrixMode(GL_PROJECTION); - gluPerspective( /* field of view in degree */ 40.0, - /* aspect ratio */ 1.0, - /* Z near */ 20.0, /* Z far */ 100.0); - glMatrixMode(GL_MODELVIEW); - gluLookAt(0.0, 8.0, 60.0, /* eye is at (0,8,60) */ - 0.0, 8.0, 0.0, /* center is at (0,8,0) */ - 0.0, 1.0, 0.); /* up is in postivie Y direction */ - - glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1); - glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor); - glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.1); - glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.05); - glEnable(GL_LIGHT0); - glEnable(GL_LIGHTING); - - makeFloorTexture(); - - /* Setup floor plane for projected shadow calculations. */ - findPlane(floorPlane, floorVertices[1], floorVertices[2], floorVertices[3]); - - glutMainLoop(); - return 0; /* ANSI C requires main to return int. */ -} diff --git a/progs/tests/ext422square.c b/progs/tests/ext422square.c deleted file mode 100644 index 6533514d697..00000000000 --- a/progs/tests/ext422square.c +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Exercise the EXT_422_pixels extension, a less convenient - * alternative to MESA_ycbcr_texture. Requires ARB_fragment_program - * to perform the final YUV->RGB conversion. - * - * Brian Paul 13 September 2002 - * Keith Whitwell 30 November 2004 - */ - - -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include <assert.h> - -#include "../util/readtex.c" /* I know, this is a hack. */ - -#define TEXTURE_FILE "../images/tile.rgb" - -static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; -static GLint ImgWidth, ImgHeight; -static GLushort *ImageYUV = NULL; -static const GLuint yuvObj = 100; -static const GLuint rgbObj = 101; - -static void Init( int argc, char *argv[] ); - -static void DrawObject(void) -{ - glBegin(GL_QUADS); - - glTexCoord2f(0, 0); - glVertex2f(-1.0, -1.0); - - glTexCoord2f(1, 0); - glVertex2f(1.0, -1.0); - - glTexCoord2f(1, 1); - glVertex2f(1.0, 1.0); - - glTexCoord2f(0, 1); - glVertex2f(-1.0, 1.0); - - glEnd(); -} - -static void Display( void ) -{ - static int firsttime = 1; - - if (firsttime) { - firsttime = 0; - Init( 0, 0 ); /* don't ask */ - } - - glClear( GL_COLOR_BUFFER_BIT ); - glBindTexture(GL_TEXTURE_2D, yuvObj); - - glPushMatrix(); - glEnable(GL_FRAGMENT_PROGRAM_ARB); - glTranslatef( -1.1, 0.0, -15.0 ); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glBindTexture(GL_TEXTURE_2D, yuvObj); - DrawObject(); - glPopMatrix(); - - glPushMatrix(); - glDisable(GL_FRAGMENT_PROGRAM_ARB); - glTranslatef( 1.1, 0.0, -15.0 ); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glBindTexture(GL_TEXTURE_2D, rgbObj); - DrawObject(); - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -1.1, 1.1, -1.1, 1.1, 10.0, 100.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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(); -} - - - - -/* #define LINEAR_FILTER */ - -static void Init( int argc, char *argv[] ) -{ - const char *file; - const GLfloat yuvtorgb[16] = { - 1.164, 1.164, 1.164, 0, - 0, -.391, 2.018, 0, - 1.596, -.813, 0.0, 0, - (-.0625*1.164 + -.5*1.596), (-.0625*1.164 + -.5*-.813 + -.5*-.391), (-.0625*1.164 + -.5*2.018), 1 - }; - - if (!glutExtensionSupported("GL_ARB_fragment_program")) { - printf("Error: GL_ARB_fragment_program not supported!\n"); - exit(1); - } - - if (!glutExtensionSupported("GL_EXT_422_pixels")) { - printf("Error: GL_EXT_422_pixels not supported!\n"); - exit(1); - } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - file = TEXTURE_FILE; - - /* Load the texture as YCbCr. - */ - glBindTexture(GL_TEXTURE_2D, yuvObj); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - ImageYUV = LoadYUVImage(file, &ImgWidth, &ImgHeight ); - if (!ImageYUV) { - printf("Couldn't read %s\n", TEXTURE_FILE); - exit(0); - } - - glTexImage2D(GL_TEXTURE_2D, 0, - GL_RGB, - ImgWidth, ImgHeight, 0, - GL_422_EXT, - GL_UNSIGNED_BYTE, ImageYUV); - - glEnable(GL_TEXTURE_2D); - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - { - static const char *modulateYUV = - "!!ARBfp1.0\n" - "TEMP R0;\n" - "TEX R0, fragment.texcoord[0], texture[0], 2D; \n" - - "ADD R0, R0, {-0.0625, -0.5, -0.5, 0.0}; \n" - "DP3 result.color.x, R0, {1.164, 1.596, 0.0}; \n" - "DP3 result.color.y, R0, {1.164, -0.813, -0.391}; \n" - "DP3 result.color.z, R0, {1.164, 0.0, 2.018}; \n" - "MOV result.color.w, R0.w; \n" - - "END" - ; - - GLuint modulateProg; - - - /* Setup the fragment program */ - glGenProgramsARB(1, &modulateProg); - glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg); - glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(modulateYUV), (const GLubyte *)modulateYUV); - - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - assert(glIsProgramARB(modulateProg)); - - } - - /* Now the same, but use a color matrix to do the conversion at - * upload time: - */ - glBindTexture(GL_TEXTURE_2D, rgbObj); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - glMatrixMode( GL_COLOR_MATRIX ); - glLoadMatrixf( yuvtorgb ); - - glTexImage2D(GL_TEXTURE_2D, 0, - GL_RGB, - ImgWidth, ImgHeight, 0, - GL_422_EXT, - GL_UNSIGNED_BYTE, ImageYUV); - - glLoadIdentity(); - glMatrixMode( GL_MODELVIEW ); - - glEnable(GL_TEXTURE_2D); - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - - glShadeModel(GL_FLAT); - glClearColor(0.3, 0.3, 0.4, 1.0); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowSize( 300, 300 ); - glutInitWindowPosition( 0, 0 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0] ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/fbotest1.c b/progs/tests/fbotest1.c deleted file mode 100644 index ed72ab16dd8..00000000000 --- a/progs/tests/fbotest1.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Test GL_EXT_framebuffer_object - * - * Brian Paul - * 7 Feb 2005 - */ - - -#define GL_GLEXT_PROTOTYPES -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - -static int Width = 400, Height = 400; -static GLuint MyFB, MyRB; - - -static void -CheckError(int line) -{ - GLenum err = glGetError(); - if (err) { - printf("GL Error 0x%x at line %d\n", (int) err, line); - } -} - - -static void -Display( void ) -{ - GLubyte *buffer = malloc(Width * Height * 4); - GLenum status; - - /* draw to user framebuffer */ - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); - glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT); - glReadBuffer(GL_COLOR_ATTACHMENT1_EXT); - - status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); - if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - printf("Framebuffer incomplete!!!\n"); - } - - glClearColor(0.5, 0.5, 1.0, 0.0); - glClear( GL_COLOR_BUFFER_BIT ); - - glBegin(GL_POLYGON); - glColor3f(1, 0, 0); - glVertex2f(-1, -1); - glColor3f(0, 1, 0); - glVertex2f(1, -1); - glColor3f(0, 0, 1); - glVertex2f(0, 1); - glEnd(); - - /* read from user framebuffer */ - glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); - - /* draw to window */ - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - glWindowPos2iARB(0, 0); - glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); - - free(buffer); - glutSwapBuffers(); - CheckError(__LINE__); -} - - -static void -Reshape( int width, int height ) -{ -#if 0 - float ar = (float) width / (float) height; -#endif - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); -#if 0 - glFrustum( -ar, ar, -1.0, 1.0, 5.0, 25.0 ); -#else - glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0 ); -#endif - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); - Width = width; - Height = height; - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height); -} - - -static void -CleanUp(void) -{ - glDeleteFramebuffersEXT(1, &MyFB); - glDeleteRenderbuffersEXT(1, &MyRB); - assert(!glIsFramebufferEXT(MyFB)); - assert(!glIsRenderbufferEXT(MyRB)); - exit(0); -} - - -static void -Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - CleanUp(); - break; - } - glutPostRedisplay(); -} - - -static void -Init( void ) -{ - GLint i; - - if (!glutExtensionSupported("GL_EXT_framebuffer_object")) { - printf("GL_EXT_framebuffer_object not found!\n"); - /*exit(0);*/ - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - glGenFramebuffersEXT(1, &MyFB); - assert(MyFB); - assert(!glIsFramebufferEXT(MyFB)); - glDeleteFramebuffersEXT(1, &MyFB); - assert(!glIsFramebufferEXT(MyFB)); - /* Note, continue to use MyFB below */ - - glGenRenderbuffersEXT(1, &MyRB); - assert(MyRB); - assert(!glIsRenderbufferEXT(MyRB)); - glDeleteRenderbuffersEXT(1, &MyRB); - assert(!glIsRenderbufferEXT(MyRB)); - MyRB = 42; /* an arbitrary ID */ - - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); - assert(glIsFramebufferEXT(MyFB)); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, MyRB); - assert(glIsRenderbufferEXT(MyRB)); - - glGetIntegerv(GL_RENDERBUFFER_BINDING_EXT, &i); - assert(i == MyRB); - - glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i); - assert(i == MyFB); - - CheckError(__LINE__); - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, - GL_RENDERBUFFER_EXT, MyRB); - - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height); - - CheckError(__LINE__); - - { - GLint r, g, b, a; - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, - GL_RENDERBUFFER_RED_SIZE_EXT, &r); - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, - GL_RENDERBUFFER_GREEN_SIZE_EXT, &g); - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, - GL_RENDERBUFFER_BLUE_SIZE_EXT, &b); - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, - GL_RENDERBUFFER_ALPHA_SIZE_EXT, &a); - CheckError(__LINE__); - printf("renderbuffer RGBA sizes = %d %d %d %d\n", r, g, b, a); - - glGetIntegerv(GL_RED_BITS, &r); - glGetIntegerv(GL_GREEN_BITS, &g); - glGetIntegerv(GL_BLUE_BITS, &b); - glGetIntegerv(GL_ALPHA_BITS, &a); - printf("Visual RGBA sizes = %d %d %d %d\n", r, g, b, a); - } - - /* restore to default */ - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - CheckError(__LINE__); -} - - -int -main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize(Width, Height); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/fbotest2.c b/progs/tests/fbotest2.c deleted file mode 100644 index c3117b0f767..00000000000 --- a/progs/tests/fbotest2.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Test GL_EXT_framebuffer_object - * - * Brian Paul - * 19 Mar 2006 - */ - - -#define GL_GLEXT_PROTOTYPES -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - -static int Width = 400, Height = 400; -static GLuint MyFB, ColorRb, DepthRb; -static GLboolean Animate = GL_TRUE; -static GLfloat Rotation = 0.0; - - -static void -CheckError(int line) -{ - GLenum err = glGetError(); - if (err) { - printf("fbotest2: GL Error 0x%x at line %d\n", (int) err, line); - } -} - - -static void -Display( void ) -{ - GLubyte *buffer = malloc(Width * Height * 4); - GLenum status; - - CheckError(__LINE__); - - /* draw to user framebuffer */ - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); - glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT); - glReadBuffer(GL_COLOR_ATTACHMENT1_EXT); - - status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); - if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - printf("fbotest2: Error: Framebuffer is incomplete!!!\n"); - } - - CheckError(__LINE__); - - glClearColor(0.5, 0.5, 1.0, 0.0); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glEnable(GL_DEPTH_TEST); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - - glPushMatrix(); - glRotatef(30.0, 1, 0, 0); - glRotatef(Rotation, 0, 1, 0); - glutSolidTeapot(2.0); - glPopMatrix(); - - /* read from user framebuffer */ - glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); - - /* draw to window */ - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - glWindowPos2iARB(0, 0); - glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); - - free(buffer); - glutSwapBuffers(); - CheckError(__LINE__); -} - - -static void -Reshape( int width, int height ) -{ - float ar = (float) width / (float) height; - - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, 5.0, 25.0 ); - - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); - - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ColorRb); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, width, height); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRb); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, - width, height); - - Width = width; - Height = height; -} - - -static void -CleanUp(void) -{ - glDeleteFramebuffersEXT(1, &MyFB); - glDeleteRenderbuffersEXT(1, &ColorRb); - glDeleteRenderbuffersEXT(1, &DepthRb); - assert(!glIsFramebufferEXT(MyFB)); - assert(!glIsRenderbufferEXT(ColorRb)); - assert(!glIsRenderbufferEXT(DepthRb)); - exit(0); -} - - -static void -Idle(void) -{ - Rotation = glutGet(GLUT_ELAPSED_TIME) * 0.1; - glutPostRedisplay(); -} - - -static void -Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'a': - Animate = !Animate; - if (Animate) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 27: - CleanUp(); - break; - } - glutPostRedisplay(); -} - - -static void -Init( void ) -{ - if (!glutExtensionSupported("GL_EXT_framebuffer_object")) { - printf("fbotest2: GL_EXT_framebuffer_object not found!\n"); - exit(0); - } - printf("fbotest2: GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - glGenFramebuffersEXT(1, &MyFB); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); - assert(glIsFramebufferEXT(MyFB)); - - /* set color buffer */ - glGenRenderbuffersEXT(1, &ColorRb); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ColorRb); - assert(glIsRenderbufferEXT(ColorRb)); - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, - GL_RENDERBUFFER_EXT, ColorRb); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height); - - /* setup depth buffer */ - glGenRenderbuffersEXT(1, &DepthRb); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRb); - assert(glIsRenderbufferEXT(DepthRb)); - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, - GL_RENDERBUFFER_EXT, DepthRb); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, Width, Height); - - CheckError(__LINE__); - - /* restore to default */ - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - CheckError(__LINE__); -} - - -int -main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize(Width, Height); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - if (Animate) - glutIdleFunc(Idle); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/fbotexture.c b/progs/tests/fbotexture.c deleted file mode 100644 index 13a29db3f35..00000000000 --- a/progs/tests/fbotexture.c +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Test GL_EXT_framebuffer_object render-to-texture - * - * Draw a teapot into a texture image with stenciling. - * Then draw a textured quad using that texture. - * - * Brian Paul - * 18 Apr 2005 - */ - - -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> - -/* For debug */ -#define DEPTH 1 -#define STENCIL 1 -#define DRAW 1 - - -static int Width = 400, Height = 400; - -static GLenum TexTarget = GL_TEXTURE_2D; /*GL_TEXTURE_RECTANGLE_ARB;*/ -static int TexWidth = 512, TexHeight = 512; -/*static int TexWidth = 600, TexHeight = 600;*/ - -static GLuint MyFB; -static GLuint TexObj; -static GLuint DepthRB, StencilRB; -static GLboolean Anim = GL_FALSE; -static GLfloat Rot = 0.0; -static GLboolean UsePackedDepthStencil = GL_FALSE; -static GLuint TextureLevel = 1; /* which texture level to render to */ -static GLenum TexIntFormat = GL_RGB; /* either GL_RGB or GL_RGBA */ - - -static void -CheckError(int line) -{ - GLenum err = glGetError(); - if (err) { - printf("GL Error 0x%x at line %d\n", (int) err, line); - } -} - - -static void -Idle(void) -{ - Rot = glutGet(GLUT_ELAPSED_TIME) * 0.1; - glutPostRedisplay(); -} - - -static void -RenderTexture(void) -{ - GLenum status; - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0, 0.0, -15.0); - - /* draw to texture image */ - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); - - status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); - if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - printf("Framebuffer incomplete!!!\n"); - } - - glViewport(0, 0, TexWidth, TexHeight); - - glClearColor(0.5, 0.5, 1.0, 0.0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - CheckError(__LINE__); - -#if DEPTH - glEnable(GL_DEPTH_TEST); -#endif - -#if STENCIL - glEnable(GL_STENCIL_TEST); - glStencilFunc(GL_NEVER, 1, ~0); - glStencilOp(GL_REPLACE, GL_KEEP, GL_REPLACE); -#endif - - CheckError(__LINE__); - -#if DEPTH || STENCIL - /* draw diamond-shaped stencil pattern */ - glColor3f(0, 1, 0); - glBegin(GL_POLYGON); - glVertex2f(-0.2, 0.0); - glVertex2f( 0.0, -0.2); - glVertex2f( 0.2, 0.0); - glVertex2f( 0.0, 0.2); - glEnd(); -#endif - - /* draw teapot where stencil != 1 */ -#if STENCIL - glStencilFunc(GL_NOTEQUAL, 1, ~0); - glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); -#endif - - CheckError(__LINE__); - -#if 0 - glBegin(GL_POLYGON); - glColor3f(1, 0, 0); - glVertex2f(-1, -1); - glColor3f(0, 1, 0); - glVertex2f(1, -1); - glColor3f(0, 0, 1); - glVertex2f(0, 1); - glEnd(); -#else - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glPushMatrix(); - glRotatef(0.5 * Rot, 1.0, 0.0, 0.0); - glutSolidTeapot(0.5); - glPopMatrix(); - glDisable(GL_LIGHTING); - /* - PrintStencilHistogram(TexWidth, TexHeight); - */ -#endif - - glDisable(GL_DEPTH_TEST); - glDisable(GL_STENCIL_TEST); - -#if DRAW - /* Bind normal framebuffer */ - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); -#endif - - CheckError(__LINE__); -} - - - -static void -Display(void) -{ - float ar = (float) Width / (float) Height; - - RenderTexture(); - - /* draw textured quad in the window */ -#if DRAW - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0, 0.0, -7.0); - - glViewport(0, 0, Width, Height); - - glClearColor(0.25, 0.25, 0.25, 0); - glClear(GL_COLOR_BUFFER_BIT); - - glPushMatrix(); - glRotatef(Rot, 0, 1, 0); - glEnable(TexTarget); - glBindTexture(TexTarget, TexObj); - glBegin(GL_POLYGON); - glColor3f(0.25, 0.25, 0.25); - if (TexTarget == GL_TEXTURE_2D) { - glTexCoord2f(0, 0); - glVertex2f(-1, -1); - glTexCoord2f(1, 0); - glVertex2f(1, -1); - glColor3f(1.0, 1.0, 1.0); - glTexCoord2f(1, 1); - glVertex2f(1, 1); - glTexCoord2f(0, 1); - glVertex2f(-1, 1); - } - else { - assert(TexTarget == GL_TEXTURE_RECTANGLE_ARB); - glTexCoord2f(0, 0); - glVertex2f(-1, -1); - glTexCoord2f(TexWidth, 0); - glVertex2f(1, -1); - glColor3f(1.0, 1.0, 1.0); - glTexCoord2f(TexWidth, TexHeight); - glVertex2f(1, 1); - glTexCoord2f(0, TexHeight); - glVertex2f(-1, 1); - } - glEnd(); - glPopMatrix(); - glDisable(TexTarget); -#endif - - glutSwapBuffers(); - CheckError(__LINE__); -} - - -static void -Reshape(int width, int height) -{ - glViewport(0, 0, width, height); - Width = width; - Height = height; -} - - -static void -CleanUp(void) -{ -#if DEPTH - glDeleteRenderbuffersEXT(1, &DepthRB); -#endif -#if STENCIL - if (!UsePackedDepthStencil) - glDeleteRenderbuffersEXT(1, &StencilRB); -#endif - glDeleteFramebuffersEXT(1, &MyFB); - - glDeleteTextures(1, &TexObj); - - exit(0); -} - - -static void -Key(unsigned char key, int x, int y) -{ - (void) x; - (void) y; - switch (key) { - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 's': - Rot += 2.0; - break; - case 27: - CleanUp(); - break; - } - glutPostRedisplay(); -} - - -static void -Init(int argc, char *argv[]) -{ - static const GLfloat mat[4] = { 1.0, 0.5, 0.5, 1.0 }; - GLint i; - - if (!glutExtensionSupported("GL_EXT_framebuffer_object")) { - printf("GL_EXT_framebuffer_object not found!\n"); - exit(0); - } - - if (argc > 1 && strcmp(argv[1], "-ds") == 0) { - if (!glutExtensionSupported("GL_EXT_packed_depth_stencil")) { - printf("GL_EXT_packed_depth_stencil not found!\n"); - exit(0); - } - UsePackedDepthStencil = GL_TRUE; - printf("Using GL_EXT_packed_depth_stencil\n"); - } - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* gen framebuffer id, delete it, do some assertions, just for testing */ - glGenFramebuffersEXT(1, &MyFB); - assert(MyFB); - assert(!glIsFramebufferEXT(MyFB)); - glDeleteFramebuffersEXT(1, &MyFB); - assert(!glIsFramebufferEXT(MyFB)); - /* Note, continue to use MyFB below */ - - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); - assert(glIsFramebufferEXT(MyFB)); - glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i); - assert(i == MyFB); - - /* Make texture object/image */ - glGenTextures(1, &TexObj); - glBindTexture(TexTarget, TexObj); - /* make two image levels */ - glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); - glTexImage2D(TexTarget, 1, TexIntFormat, TexWidth/2, TexHeight/2, 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); - TexWidth = TexWidth >> TextureLevel; - TexHeight = TexHeight >> TextureLevel; - - glTexParameteri(TexTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(TexTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glTexParameteri(TexTarget, GL_TEXTURE_BASE_LEVEL, TextureLevel); - glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, TextureLevel); - - CheckError(__LINE__); - - /* Render color to texture */ - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, - TexTarget, TexObj, TextureLevel); - - -#if DEPTH - /* make depth renderbuffer */ - glGenRenderbuffersEXT(1, &DepthRB); - assert(DepthRB); - assert(!glIsRenderbufferEXT(DepthRB)); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB); - assert(glIsRenderbufferEXT(DepthRB)); - if (UsePackedDepthStencil) - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_STENCIL_EXT, - TexWidth, TexHeight); - else - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, - TexWidth, TexHeight); - CheckError(__LINE__); - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, - GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i); - CheckError(__LINE__); - printf("Depth renderbuffer size = %d bits\n", i); - assert(i > 0); - - /* attach DepthRB to MyFB */ - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, - GL_RENDERBUFFER_EXT, DepthRB); -#endif - - CheckError(__LINE__); - -#if STENCIL - if (UsePackedDepthStencil) { - /* DepthRb is a combined depth/stencil renderbuffer */ - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, - GL_STENCIL_ATTACHMENT_EXT, - GL_RENDERBUFFER_EXT, DepthRB); - } - else { - /* make stencil renderbuffer */ - glGenRenderbuffersEXT(1, &StencilRB); - assert(StencilRB); - assert(!glIsRenderbufferEXT(StencilRB)); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilRB); - assert(glIsRenderbufferEXT(StencilRB)); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX, - TexWidth, TexHeight); - /* attach StencilRB to MyFB */ - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, - GL_STENCIL_ATTACHMENT_EXT, - GL_RENDERBUFFER_EXT, StencilRB); - } - glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, - GL_RENDERBUFFER_STENCIL_SIZE_EXT, &i); - CheckError(__LINE__); - printf("Stencil renderbuffer size = %d bits\n", i); - assert(i > 0); -#endif - - CheckError(__LINE__); - - /* bind regular framebuffer */ - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - - - /* lighting */ - glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat); -} - - -int -main(int argc, char *argv[]) -{ - glutInit(&argc, argv); - glutInitWindowPosition(0, 0); - glutInitWindowSize(Width, Height); - glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); - glutCreateWindow(argv[0]); - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Display); - if (Anim) - glutIdleFunc(Idle); - Init(argc, argv); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/floattex.c b/progs/tests/floattex.c deleted file mode 100644 index 2345a49b270..00000000000 --- a/progs/tests/floattex.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Test floating point textures. - * No actual rendering, yet. - */ - - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - - -/* XXX - temporary */ -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#define GL_TEXTURE_RED_TYPE_ARB 0x9000 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x9001 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x9002 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x9003 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x9004 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x9005 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x9006 -#define GL_UNSIGNED_NORMALIZED_ARB 0x9007 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif - - -static GLboolean -CheckError( int line ) -{ - GLenum error = glGetError(); - if (error) { - char *err = (char *) gluErrorString( error ); - fprintf( stderr, "GL Error: %s at line %d\n", err, line ); - return GL_TRUE; - } - return GL_FALSE; -} - - -static void -Draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - - glutSolidCube(2.0); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -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.0, 0.0, -15.0); -} - - -static void -Key(unsigned char key, int x, int y) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - - -static void -Init(void) -{ - GLfloat tex[16][16][4]; - GLfloat tex2[16][16][4]; - GLint i, j, t; - - if (!glutExtensionSupported("GL_MESAX_texture_float")) { - printf("Sorry, this test requires GL_MESAX_texture_float\n"); - exit(1); - } - - for (i = 0; i < 16; i++) { - for (j = 0; j < 16; j++) { - GLfloat s = i / 15.0; - tex[i][j][0] = s; - tex[i][j][1] = 2.0 * s; - tex[i][j][2] = -3.0 * s; - tex[i][j][3] = 4.0 * s; - } - } - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_ARB, 16, 16, 0, GL_RGBA, - GL_FLOAT, tex); - CheckError(__LINE__); - - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_TYPE_ARB, &t); - assert(t == GL_FLOAT); - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_GREEN_TYPE_ARB, &t); - assert(t == GL_FLOAT); - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BLUE_TYPE_ARB, &t); - assert(t == GL_FLOAT); - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_TYPE_ARB, &t); - assert(t == GL_FLOAT); - - CheckError(__LINE__); - - /* read back the texture and make sure values are correct */ - glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, tex2); - CheckError(__LINE__); - for (i = 0; i < 16; i++) { - for (j = 0; j < 16; j++) { - if (tex[i][j][0] != tex2[i][j][0] || - tex[i][j][1] != tex2[i][j][1] || - tex[i][j][2] != tex2[i][j][2] || - tex[i][j][3] != tex2[i][j][3]) { - printf("tex[%d][%d] %g %g %g %g != tex2[%d][%d] %g %g %g %g\n", - i, j, - tex[i][j][0], tex[i][j][1], tex[i][j][2], tex[i][j][3], - i, j, - tex2[i][j][0], tex2[i][j][1], tex2[i][j][2], tex2[i][j][3]); - } - } - } - - -} - - -int -main(int argc, char *argv[]) -{ - glutInit(&argc, argv); - glutInitWindowPosition(0, 0); - glutInitWindowSize(400, 400); - glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); - glutCreateWindow(argv[0]); - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/fog.c b/progs/tests/fog.c deleted file mode 100644 index ecd9f533f99..00000000000 --- a/progs/tests/fog.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright 2005 Eric Anholt - * 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 (including the next - * paragraph) 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 - * THE AUTHORS OR COPYRIGHT HOLDERS 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. - * - * Authors: - * Eric Anholt <[email protected]> - * Brian Paul (fogcoord.c used as a skeleton) - */ - -/* - * Test to exercise fog modes and for comparison with GL_EXT_fog_coord. - */ - -#define GL_GLEXT_PROTOTYPES -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - -static int Width = 600; -static int Height = 600; -static GLfloat Near = 0.0, Far = 1.0; -GLboolean has_fogcoord; - -static void drawString( const char *string ) -{ - glRasterPos2f(0, .5); - while ( *string ) { - glutBitmapCharacter( GLUT_BITMAP_TIMES_ROMAN_10, *string ); - string++; - } -} - -static void Display( void ) -{ - GLint i, depthi; - GLfloat fogcolor[4] = {1, 1, 1, 1}; - - glEnable(GL_FOG); - glFogfv(GL_FOG_COLOR, fogcolor); - - glClearColor(0.2, 0.2, 0.8, 0); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - for (i = 0; i < 6; i++) { - if (i >= 3 && !has_fogcoord) - break; - - glPushMatrix(); - for (depthi = 0; depthi < 5; depthi++) { - GLfloat depth = Near + (Far - Near) * depthi / 4; - - switch (i % 3) { - case 0: - glFogi(GL_FOG_MODE, GL_LINEAR); - glFogf(GL_FOG_START, Near); - glFogf(GL_FOG_END, Far); - break; - case 1: - glFogi(GL_FOG_MODE, GL_EXP); - glFogf(GL_FOG_DENSITY, 2); - break; - case 2: - glFogi(GL_FOG_MODE, GL_EXP2); - glFogf(GL_FOG_DENSITY, 2); - break; - } - - glColor4f(0, 0, 0, 0); - if (i < 3) { - if (has_fogcoord) - glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT); - - glBegin(GL_POLYGON); - glVertex3f(0, 0, depth); - glVertex3f(1, 0, depth); - glVertex3f(1, 1, depth); - glVertex3f(0, 1, depth); - glEnd(); - } else { - glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); - glFogCoordfEXT(depth); - - glBegin(GL_POLYGON); - glVertex3f(0, 0, (Near + Far) / 2); - glVertex3f(1, 0, (Near + Far) / 2); - glVertex3f(1, 1, (Near + Far) / 2); - glVertex3f(0, 1, (Near + Far) / 2); - glEnd(); - } - glTranslatef(1.5, 0, 0); - } - - glTranslatef(.1, 0, 0); - switch (i) { - case 0: - drawString("GL_LINEAR"); - break; - case 1: - drawString("GL_EXP"); - break; - case 2: - drawString("GL_EXP2"); - break; - case 3: - drawString("GL_FOGCOORD GL_LINEAR"); - break; - case 4: - drawString("GL_FOGCOORD GL_EXP"); - break; - case 5: - drawString("GL_FOGCOORD GL_EXP2"); - break; - } - - glPopMatrix(); - glTranslatef(0, 1.5, 0); - } - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho( 0, 11, 9, 0, -Near, -Far ); - - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef(.25, .25, 0); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - /* setup lighting, etc */ - has_fogcoord = glutExtensionSupported("GL_EXT_fog_coord"); - if (!has_fogcoord) { - printf("Some output of this program requires GL_EXT_fog_coord\n"); - } -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/fogcoord.c b/progs/tests/fogcoord.c deleted file mode 100644 index 89355742aad..00000000000 --- a/progs/tests/fogcoord.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Exercise GL_EXT_fog_coord - */ - - -#define GL_GLEXT_PROTOTYPES -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - -static int Width = 600; -static int Height = 200; -static GLfloat Near = 5.0, Far = 25.0; - - -static void Display( void ) -{ - GLfloat t; - - glClearColor(0.2, 0.2, 0.8, 0); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - for (t = 0.0; t <= 1.0; t += 0.25) { - GLfloat f = Near + t * (Far - Near); - printf("glFogCoord(%4.1f)\n", f); - glFogCoordfEXT(f); - - glPushMatrix(); - glTranslatef(t * 10.0 - 5.0, 0, 0); - glBegin(GL_POLYGON); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - glPopMatrix(); - } - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / (float) height; - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, Near, Far ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - /* setup lighting, etc */ - if (!glutExtensionSupported("GL_EXT_fog_coord")) { - printf("Sorry, this program requires GL_EXT_fog_coord\n"); - exit(1); - } - glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); - glFogi(GL_FOG_MODE, GL_LINEAR); - glFogf(GL_FOG_START, Near); - glFogf(GL_FOG_END, Far); - glEnable(GL_FOG); - printf("Squares should be colored from white -> gray -> black.\n"); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/fptest1.c b/progs/tests/fptest1.c deleted file mode 100644 index 095190a8aef..00000000000 --- a/progs/tests/fptest1.c +++ /dev/null @@ -1,225 +0,0 @@ -/* Test GL_NV_fragment_program */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - - glColor4f(0, 0.5, 0, 1); - glColor4f(0, 1, 0, 1); - glBegin(GL_POLYGON); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 0, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -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.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - static const char *prog0 = - "!!FP1.0\n" - "MUL o[COLR], R0, f[WPOS]; \n" - "ADD o[COLH], H3, f[TEX0]; \n" - "ADD_SAT o[COLH], H3, f[TEX0]; \n" - "ADDX o[COLH], H3, f[TEX0]; \n" - "ADDHC o[COLH], H3, f[TEX0]; \n" - "ADDXC o[COLH], H3, f[TEX0]; \n" - "ADDXC_SAT o[COLH], H30, f[TEX0]; \n" - "MUL o[COLR].xy, R0.wzyx, f[WPOS]; \n" - "MUL o[COLR], H0, f[WPOS]; \n" - "MUL o[COLR], -H0, f[WPOS]; \n" - "MOV RC, H1; \n" - "MOV HC, H2; \n" - "END \n" - ; - - /* masked updates, defines, declarations */ - static const char *prog1 = - "!!FP1.0\n" - "DEFINE foo = {1, 2, 3, 4}; \n" - "DEFINE foo2 = 5; \n" - "DECLARE foo3 = {5, 6, 7, 8}; \n" - "DECLARE bar = 3; \n" - "DECLARE bar2; \n" - "DECLARE bar3 = bar; \n" - "#DECLARE bar4 = { a, b, c, d }; \n" - "MOV o[COLR].xy, R0; \n" - "MOV o[COLR] (NE), R0; \n" - "MOV o[COLR] (NE.wzyx), R0; \n" - "MOV o[COLR].xy (NE.wzyx), R0; \n" - "MOV RC.x (EQ), R1.x; \n" - "KIL NE; \n" - "KIL EQ.xyxy; \n" - "END \n" - ; - - /* texture instructions */ - static const char *prog2 = - "!!FP1.0\n" - "TEX R0, f[TEX0], TEX0, 2D; \n" - "TEX R1, f[TEX1], TEX1, CUBE; \n" - "TEX R2, f[TEX2], TEX2, 3D; \n" - "TXP R3, f[TEX3], TEX3, RECT; \n" - "TXD R3, R2, R1, f[TEX3], TEX3, RECT; \n" - "MUL o[COLR], R0, f[COL0]; \n" - "END \n" - ; - - /* test negation, absolute value */ - static const char *prog3 = - "!!FP1.0\n" - "MOV R0, -R1; \n" - "MOV R0, +R1; \n" - "MOV R0, |-R1|; \n" - "MOV R0, |+R1|; \n" - "MOV R0, -|R1|; \n" - "MOV R0, +|R1|; \n" - "MOV R0, -|-R1|; \n" - "MOV R0, -|+R1|; \n" - "MOV o[COLR], R0; \n" - "END \n" - ; - - /* literal constant sources */ - static const char *prog4 = - "!!FP1.0\n" - "DEFINE Pi = 3.14159; \n" - "MOV R0, {1, -2, +3, 4}; \n" - "MOV R0, 5; \n" - "MOV R0, -5; \n" - "MOV R0, +5; \n" - "MOV R0, Pi; \n" - "MOV o[COLR], R0; \n" - "END \n" - ; - - /* change the fragment color in a simple way */ - static const char *prog10 = - "!!FP1.0\n" - "DEFINE blue = {0, 0, 1, 0};\n" - "DECLARE color; \n" - "MOV R0, f[COL0]; \n" - "#ADD o[COLR], R0, f[COL0]; \n" - "#ADD o[COLR], blue, f[COL0]; \n" - "#ADD o[COLR], {1, 0, 0, 0}, f[COL0]; \n" - "ADD o[COLR], color, f[COL0]; \n" - "END \n" - ; - - GLuint progs[20]; - - if (!glutExtensionSupported ("GL_NV_fragment_program")) { - printf("Sorry, this program requires GL_NV_fragment_program\n"); - exit(1); - } - - glGenProgramsNV(20, progs); - assert(progs[0]); - assert(progs[1]); - assert(progs[0] != progs[1]); - -#if 0 - glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[0], - strlen(prog0), - (const GLubyte *) prog0); - assert(glIsProgramNV(progs[0])); -#endif - - glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[1], - strlen(prog1), - (const GLubyte *) prog1); - assert(glIsProgramNV(progs[1])); - - glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[2], - strlen(prog2), - (const GLubyte *) prog2); - assert(glIsProgramNV(progs[2])); - glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[2]); - - glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[3], - strlen(prog3), - (const GLubyte *) prog3); - assert(glIsProgramNV(progs[3])); - glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[3]); - - glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[4], - strlen(prog4), - (const GLubyte *) prog4); - assert(glIsProgramNV(progs[4])); - glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[4]); - - - /* a real program */ - glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[10], - strlen(prog10), - (const GLubyte *) prog10); - assert(glIsProgramNV(progs[10])); - glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, progs[10]); - - glProgramNamedParameter4fNV(progs[10], - strlen("color"), (const GLubyte *) "color", - 1, 0, 0, 1); - - glEnable(GL_FRAGMENT_PROGRAM_NV); - glEnable(GL_ALPHA_TEST); - glAlphaFunc(GL_ALWAYS, 0.0); - - printf("glGetError = %d\n", (int) glGetError()); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/fptexture.c b/progs/tests/fptexture.c deleted file mode 100644 index f57ad628282..00000000000 --- a/progs/tests/fptexture.c +++ /dev/null @@ -1,151 +0,0 @@ -/* GL_NV_fragment_program texture test */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -#include "../util/readtex.c" - - -#define TEXTURE_FILE "../images/girl.rgb" - -static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0; - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - - glBegin(GL_POLYGON); - glColor4f(1.0, 1.0, 1.0, 1); glTexCoord2f(0, 0); glVertex2f(-1, -1); - glColor4f(0.2, 0.2, 1.0, 1); glTexCoord2f(1, 0); glVertex2f( 1, -1); - glColor4f(0.2, 1.0, 0.2, 1); glTexCoord2f(1, 1); glVertex2f( 1, 1); - glColor4f(1.0, 0.2, 0.2, 1); glTexCoord2f(0, 1); glVertex2f(-1, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -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.0, 0.0, -8.0 ); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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 Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - static const char *modulate2D = - "!!FP1.0\n" - "TEX R0, f[TEX0], TEX0, 2D; \n" - "MUL o[COLR], R0, f[COL0]; \n" - "END" - ; - GLuint modulateProg; - GLuint Texture; - - if (!glutExtensionSupported("GL_NV_fragment_program")) { - printf("Error: GL_NV_fragment_program not supported!\n"); - exit(1); - } - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - /* Setup the fragment program */ - glGenProgramsNV(1, &modulateProg); - glLoadProgramNV(GL_FRAGMENT_PROGRAM_NV, modulateProg, - strlen(modulate2D), - (const GLubyte *) modulate2D); - printf("glGetError = 0x%x\n", (int) glGetError()); - printf("glError(GL_PROGRAM_ERROR_STRING_NV) = %s\n", - (char *) glGetString(GL_PROGRAM_ERROR_STRING_NV)); - assert(glIsProgramNV(modulateProg)); - - glBindProgramNV(GL_FRAGMENT_PROGRAM_NV, modulateProg); - glEnable(GL_FRAGMENT_PROGRAM_NV); - - /* Load texture */ - glGenTextures(1, &Texture); - glBindTexture(GL_TEXTURE_2D, Texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) { - printf("Error: couldn't load texture image file %s\n", TEXTURE_FILE); - exit(1); - } - /* XXX this enable shouldn't really be needed!!! */ - glEnable(GL_TEXTURE_2D); - - glClearColor(.3, .3, .3, 0); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/getprocaddress.c b/progs/tests/getprocaddress.c deleted file mode 100644 index 2480ed44cc7..00000000000 --- a/progs/tests/getprocaddress.c +++ /dev/null @@ -1,438 +0,0 @@ -/* - * Copyright (C) 1999-2002 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. - */ - -/* - * Test that glXGetProcAddress works. - */ - -#define GLX_GLXEXT_PROTOTYPES - -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <GL/gl.h> -#include <GL/glx.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> - - -typedef void (*generic_func)(); - -#define EQUAL(X, Y) (fabs((X) - (Y)) < 0.001) - -static GLboolean -test_ActiveTextureARB(generic_func func) -{ - PFNGLACTIVETEXTUREARBPROC activeTexture = (PFNGLACTIVETEXTUREARBPROC) func; - GLint t; - GLboolean pass; - (*activeTexture)(GL_TEXTURE1_ARB); - glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &t); - pass = (t == GL_TEXTURE1_ARB); - (*activeTexture)(GL_TEXTURE0_ARB); /* restore default */ - return pass; -} - - -static GLboolean -test_SecondaryColor3fEXT(generic_func func) -{ - PFNGLSECONDARYCOLOR3FEXTPROC secColor3f = (PFNGLSECONDARYCOLOR3FEXTPROC) func; - GLfloat color[4]; - GLboolean pass; - (*secColor3f)(1.0, 1.0, 0.0); - glGetFloatv(GL_CURRENT_SECONDARY_COLOR_EXT, color); - pass = (color[0] == 1.0 && color[1] == 1.0 && color[2] == 0.0); - (*secColor3f)(0.0, 0.0, 0.0); /* restore default */ - return pass; -} - - -static GLboolean -test_ActiveStencilFaceEXT(generic_func func) -{ - PFNGLACTIVESTENCILFACEEXTPROC activeFace = (PFNGLACTIVESTENCILFACEEXTPROC) func; - GLint face; - GLboolean pass; - (*activeFace)(GL_BACK); - glGetIntegerv(GL_ACTIVE_STENCIL_FACE_EXT, &face); - pass = (face == GL_BACK); - (*activeFace)(GL_FRONT); /* restore default */ - return pass; -} - - -static GLboolean -test_VertexAttrib1fvARB(generic_func func) -{ - PFNGLVERTEXATTRIB1FVARBPROC vertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC) func; - PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB"); - - const GLfloat v[1] = {25.0}; - const GLfloat def[1] = {0}; - GLfloat res[4]; - GLboolean pass; - (*vertexAttrib1fvARB)(6, v); - (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res); - pass = (res[0] == 25.0 && res[1] == 0.0 && res[2] == 0.0 && res[3] == 1.0); - (*vertexAttrib1fvARB)(6, def); - return pass; -} - -static GLboolean -test_VertexAttrib4NubvARB(generic_func func) -{ - PFNGLVERTEXATTRIB4NUBVARBPROC vertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC) func; - PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB"); - - const GLubyte v[4] = {255, 0, 255, 0}; - const GLubyte def[4] = {0, 0, 0, 255}; - GLfloat res[4]; - GLboolean pass; - (*vertexAttrib4NubvARB)(6, v); - (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res); - pass = (res[0] == 1.0 && res[1] == 0.0 && res[2] == 1.0 && res[3] == 0.0); - (*vertexAttrib4NubvARB)(6, def); - return pass; -} - - -static GLboolean -test_VertexAttrib4NuivARB(generic_func func) -{ - PFNGLVERTEXATTRIB4NUIVARBPROC vertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC) func; - PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB"); - - const GLuint v[4] = {0xffffffff, 0, 0xffffffff, 0}; - const GLuint def[4] = {0, 0, 0, 0xffffffff}; - GLfloat res[4]; - GLboolean pass; - (*vertexAttrib4NuivARB)(6, v); - (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res); - pass = (EQUAL(res[0], 1.0) && EQUAL(res[1], 0.0) && EQUAL(res[2], 1.0) && EQUAL(res[3], 0.0)); - (*vertexAttrib4NuivARB)(6, def); - return pass; -} - - -static GLboolean -test_VertexAttrib4ivARB(generic_func func) -{ - PFNGLVERTEXATTRIB4IVARBPROC vertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC) func; - PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB"); - - const GLint v[4] = {1, 2, -3, 4}; - const GLint def[4] = {0, 0, 0, 1}; - GLfloat res[4]; - GLboolean pass; - (*vertexAttrib4ivARB)(6, v); - (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res); - pass = (EQUAL(res[0], 1.0) && EQUAL(res[1], 2.0) && EQUAL(res[2], -3.0) && EQUAL(res[3], 4.0)); - (*vertexAttrib4ivARB)(6, def); - return pass; -} - - -static GLboolean -test_VertexAttrib4NsvARB(generic_func func) -{ - PFNGLVERTEXATTRIB4NSVARBPROC vertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC) func; - PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB"); - - const GLshort v[4] = {0, 32767, 32767, 0}; - const GLshort def[4] = {0, 0, 0, 32767}; - GLfloat res[4]; - GLboolean pass; - (*vertexAttrib4NsvARB)(6, v); - (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res); - pass = (EQUAL(res[0], 0.0) && EQUAL(res[1], 1.0) && EQUAL(res[2], 1.0) && EQUAL(res[3], 0.0)); - (*vertexAttrib4NsvARB)(6, def); - return pass; -} - - -static GLboolean -test_VertexAttrib4NusvARB(generic_func func) -{ - PFNGLVERTEXATTRIB4NUSVARBPROC vertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC) func; - PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB"); - - const GLushort v[4] = {0xffff, 0, 0xffff, 0}; - const GLushort def[4] = {0, 0, 0, 0xffff}; - GLfloat res[4]; - GLboolean pass; - (*vertexAttrib4NusvARB)(6, v); - (*getVertexAttribfvARB)(6, GL_CURRENT_VERTEX_ATTRIB_ARB, res); - pass = (EQUAL(res[0], 1.0) && EQUAL(res[1], 0.0) && EQUAL(res[2], 1.0) && EQUAL(res[3], 0.0)); - (*vertexAttrib4NusvARB)(6, def); - return pass; -} - - -static GLboolean -test_VertexAttrib4ubNV(generic_func func) -{ - PFNGLVERTEXATTRIB4UBNVPROC vertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC) func; - PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV"); - - const GLubyte v[4] = {255, 0, 255, 0}; - const GLubyte def[4] = {0, 0, 0, 255}; - GLfloat res[4]; - GLboolean pass; - (*vertexAttrib4ubNV)(6, v[0], v[1], v[2], v[3]); - (*getVertexAttribfvNV)(6, GL_CURRENT_ATTRIB_NV, res); - pass = (res[0] == 1.0 && res[1] == 0.0 && res[2] == 1.0 && res[3] == 0.0); - (*vertexAttrib4ubNV)(6, def[0], def[1], def[2], def[3]); - return pass; -} - - -static GLboolean -test_VertexAttrib2sNV(generic_func func) -{ - PFNGLVERTEXATTRIB2SNVPROC vertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC) func; - PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV"); - - const GLshort v[2] = {2, -4,}; - const GLshort def[2] = {0, 0}; - GLfloat res[4]; - GLboolean pass; - (*vertexAttrib2sNV)(6, v[0], v[1]); - (*getVertexAttribfvNV)(6, GL_CURRENT_ATTRIB_NV, res); - pass = (EQUAL(res[0], 2) && EQUAL(res[1], -4) && EQUAL(res[2], 0) && res[3] == 1.0); - (*vertexAttrib2sNV)(6, def[0], def[1]); - return pass; -} - - -static GLboolean -test_VertexAttrib3fNV(generic_func func) -{ - PFNGLVERTEXATTRIB3FNVPROC vertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC) func; - PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV"); - - const GLfloat v[3] = {0.2, 0.4, 0.8}; - const GLfloat def[3] = {0, 0, 0}; - GLfloat res[4]; - GLboolean pass; - (*vertexAttrib3fNV)(6, v[0], v[1], v[2]); - (*getVertexAttribfvNV)(6, GL_CURRENT_ATTRIB_NV, res); - pass = (EQUAL(res[0], 0.2) && EQUAL(res[1], 0.4) && EQUAL(res[2], 0.8) && res[3] == 1.0); - (*vertexAttrib3fNV)(6, def[0], def[1], def[2]); - return pass; -} - - -static GLboolean -test_VertexAttrib4dvNV(generic_func func) -{ - PFNGLVERTEXATTRIB4DVNVPROC vertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC) func; - PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV"); - - const GLdouble v[4] = {0.2, 0.4, 0.8, 1.2}; - const GLdouble def[4] = {0, 0, 0, 1}; - GLfloat res[4]; - GLboolean pass; - (*vertexAttrib4dvNV)(6, v); - (*getVertexAttribfvNV)(6, GL_CURRENT_ATTRIB_NV, res); - pass = (EQUAL(res[0], 0.2) && EQUAL(res[1], 0.4) && EQUAL(res[2], 0.8) && EQUAL(res[3], 1.2)); - (*vertexAttrib4dvNV)(6, def); - return pass; -} - - -/* - * The following header file is auto-generated with Python. The Python - * script looks in this file for functions named "test_*" as seen above. - */ -#include "getproclist.h" - - - -static int -extension_supported(const char *haystack, const char *needle) -{ - if (strstr(haystack, needle)) - return 1; - else - return 0; -} - - -static void -check_functions( const char *extensions ) -{ - struct name_test_pair *entry; - int failures = 0, passes = 0; - int totalFail = 0, totalPass = 0; - int doTests; - - for (entry = functions; entry->name; entry++) { - if (entry->name[0] == '-') { - /* XXX update for OpenGL 2.0 */ - 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] && - version[2] >= entry->name[3]) - doTests = 1; - else - doTests = 0; - } - else { - /* check if the named extension is available */ - doTests = extension_supported(extensions, entry->name+1); - } - if (doTests) - printf("Testing %s functions\n", entry->name + 1); - totalFail += failures; - totalPass += passes; - failures = 0; - passes = 0; - } - else if (doTests) { - generic_func funcPtr = (generic_func) glXGetProcAddressARB((const GLubyte *) entry->name); - if (funcPtr) { - if (entry->test) { - GLboolean b; - printf(" Validating %s:", entry->name); - b = (*entry->test)(funcPtr); - if (b) { - printf(" Pass\n"); - passes++; - } - else { - printf(" FAIL!!!\n"); - failures++; - } - } - else { - passes++; - } - } - else { - printf(" glXGetProcAddress(%s) failed!\n", entry->name); - failures++; - } - } - - if (doTests && (!(entry+1)->name || (entry+1)->name[0] == '-')) { - if (failures > 0) { - printf(" %d failed.\n", failures); - } - if (passes > 0) { - printf(" %d passed.\n", passes); - } - } - } - totalFail += failures; - totalPass += passes; - - printf("-----------------------------\n"); - printf("Total: %d pass %d fail\n", totalPass, totalFail); -} - - - -static void -print_screen_info(Display *dpy, int scrnum, Bool allowDirect) -{ - Window win; - int attribSingle[] = { - GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - None }; - int attribDouble[] = { - GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DOUBLEBUFFER, - None }; - - XSetWindowAttributes attr; - unsigned long mask; - Window root; - GLXContext ctx; - XVisualInfo *visinfo; - int width = 100, height = 100; - - root = RootWindow(dpy, scrnum); - - visinfo = glXChooseVisual(dpy, scrnum, attribSingle); - if (!visinfo) { - visinfo = glXChooseVisual(dpy, scrnum, attribDouble); - if (!visinfo) { - fprintf(stderr, "Error: couldn't find RGB GLX visual\n"); - return; - } - } - - attr.background_pixel = 0; - attr.border_pixel = 0; - attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone); - attr.event_mask = StructureNotifyMask | ExposureMask; - mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - win = XCreateWindow(dpy, root, 0, 0, width, height, - 0, visinfo->depth, InputOutput, - visinfo->visual, mask, &attr); - - ctx = glXCreateContext( dpy, visinfo, NULL, allowDirect ); - if (!ctx) { - fprintf(stderr, "Error: glXCreateContext failed\n"); - XDestroyWindow(dpy, win); - return; - } - - if (glXMakeCurrent(dpy, win, ctx)) { - check_functions( (const char *) glGetString(GL_EXTENSIONS) ); - } - else { - fprintf(stderr, "Error: glXMakeCurrent failed\n"); - } - - glXDestroyContext(dpy, ctx); - XDestroyWindow(dpy, win); -} - - -int -main(int argc, char *argv[]) -{ - char *displayName = NULL; - Display *dpy; - - dpy = XOpenDisplay(displayName); - if (!dpy) { - fprintf(stderr, "Error: unable to open display %s\n", displayName); - return -1; - } - - print_screen_info(dpy, 0, GL_TRUE); - - XCloseDisplay(dpy); - - return 0; -} diff --git a/progs/tests/getprocaddress.py b/progs/tests/getprocaddress.py deleted file mode 100644 index f3ed3192e1f..00000000000 --- a/progs/tests/getprocaddress.py +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env python - -# $Id: getprocaddress.py,v 1.7 2005-06-21 23:42:43 idr Exp $ - -# Helper for the getprocaddress.c test. - -import sys, getopt, re -sys.path.append("../../src/mesa/glapi/" ) -import gl_XML -import license - - -def FindTestFunctions(): - """Scan getprocaddress.c for lines that start with "test_" to find - extension function tests. Return a list of names found.""" - functions = [] - f = open("getprocaddress.c") - if not f: - return functions - for line in f.readlines(): - v = re.search("^test_([a-zA-Z0-9]+)", line) - if v: - func = v.group(1) - functions.append(func) - f.close - return functions - - -class PrintExports(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "getprocaddress.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") - - self.tests = FindTestFunctions() - self.prevCategory = "" - return - - - def printRealHeader(self): - print """ -struct name_test_pair { - const char *name; - GLboolean (*test)(generic_func); -}; - -static struct name_test_pair functions[] = {""" - - def printBody(self, api): - prev_category = None - - - for f in api.functionIterateByOffset(): - [category, num] = api.get_category_for_name( f.name ) - if category != prev_category: - print ' { "-%s", NULL},' % category - prev_category = category - - test = "NULL" - for name in f.entry_points: - if name in self.tests: - test = "test_%s" % name - break - - print ' { "gl%s", %s },' % (f.name, test) - - print '' - print ' { NULL, NULL }' - print '};' - print '' - return - - -if __name__ == '__main__': - file_name = "../../src/mesa/glapi/gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == "-f": - file_name = val - - printer = PrintExports() - - api = gl_XML.parse_GL_API( file_name, gl_XML.gl_item_factory() ) - - printer.Print( api ) diff --git a/progs/tests/interleave.c b/progs/tests/interleave.c deleted file mode 100644 index e98b3ed0469..00000000000 --- a/progs/tests/interleave.c +++ /dev/null @@ -1,406 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2005 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. - */ - -/** - * \file interleave.c - * - * Simple test of glInterleavedArrays functionality. For each mode, two - * meshes are drawn. One is drawn using interleaved arrays and the othe is - * drawn using immediate mode. Both should look identical. - * - * \author Ian Romanick <[email protected]> - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> -#include <GL/glut.h> - -static int Width = 400; -static int Height = 300; -static const GLfloat Near = 5.0, Far = 25.0; - -static const GLfloat t[][4] = { - { 0.5, 0.0, 0.0, 1.0 }, - - { 0.25, 0.5, 0.0, 1.0 }, - { 0.75, 0.5, 0.0, 1.0 }, - - { 0.0, 1.0, 0.0, 1.0 }, - { 0.5, 1.0, 0.0, 1.0 }, - { 1.0, 1.0, 0.0, 1.0 }, -}; - -static const GLfloat c_f[][4] = { - { 1.0, 0.0, 0.0, 1.0 }, - - { 0.0, 1.0, 0.0, 1.0 }, - { 0.0, 1.0, 0.0, 1.0 }, - - { 0.0, 0.0, 1.0, 1.0 }, - { 1.0, 0.0, 1.0, 1.0 }, - { 0.0, 0.0, 1.0, 1.0 }, -}; - -static const GLubyte c_ub[][4] = { - { 0xff, 0x00, 0x00, 0xff }, - - { 0x00, 0xff, 0x00, 0xff }, - { 0x00, 0xff, 0x00, 0xff }, - - { 0x00, 0x00, 0xff, 0xff }, - { 0xff, 0x00, 0xff, 0xff }, - { 0x00, 0x00, 0xff, 0xff }, -}; - -static const GLfloat n[][3] = { - { 0.0, 0.0, -1.0 }, - - { 0.0, 0.0, -1.0 }, - { 0.0, 0.0, -1.0 }, - - { 0.0, 0.0, -1.0 }, - { 0.0, 0.0, -1.0 }, - { 0.0, 0.0, -1.0 }, -}; - -static const GLfloat v[][4] = { - { 0.0, 1.0, 0.0, 1.0, }, - - { -0.5, 0.0, 0.0, 1.0, }, - { 0.5, 0.0, 0.0, 1.0, }, - - { -1.0, -1.0, 0.0, 1.0, }, - { 0.0, -1.0, 0.0, 1.0, }, - { 1.0, -1.0, 0.0, 1.0, }, -}; - -static const unsigned indicies[12] = { - 0, 1, 2, - 1, 3, 4, - 2, 4, 5, - 1, 4, 2 -}; - -#define NONE { NULL, 0, 0, 0 } -#define V2F { v, 2, 2 * sizeof( GLfloat ), GL_FLOAT, sizeof( v[0] ) } -#define V3F { v, 3, 3 * sizeof( GLfloat ), GL_FLOAT, sizeof( v[0] ) } -#define V4F { v, 4, 4 * sizeof( GLfloat ), GL_FLOAT, sizeof( v[0] ) } - -#define C4UB { c_ub, 4, 4 * sizeof( GLubyte ), GL_UNSIGNED_BYTE, sizeof( c_ub[0] ) } -#define C3F { c_f, 3, 3 * sizeof( GLfloat ), GL_FLOAT, sizeof( c_f[0] ) } -#define C4F { c_f, 4, 4 * sizeof( GLfloat ), GL_FLOAT, sizeof( c_f[0] ) } - -#define T2F { t, 2, 2 * sizeof( GLfloat ), GL_FLOAT, sizeof( t[0] ) } -#define T4F { t, 4, 4 * sizeof( GLfloat ), GL_FLOAT, sizeof( t[0] ) } - -#define N3F { n, 3, 3 * sizeof( GLfloat ), GL_FLOAT, sizeof( n[0] ) } - -struct interleave_info { - const void * data; - unsigned count; - unsigned size; - GLenum type; - unsigned stride; -}; - -#define NUM_MODES 14 -#define INVALID_MODE 14 -#define INVALID_STRIDE 15 - -struct interleave_info info[ NUM_MODES ][4] = { - { NONE, NONE, NONE, V2F }, - { NONE, NONE, NONE, V3F }, - { NONE, C4UB, NONE, V2F }, - { NONE, C4UB, NONE, V3F }, - { NONE, C3F, NONE, V3F }, - - { NONE, NONE, N3F, V3F }, - { NONE, C4F, N3F, V3F }, - - { T2F, NONE, NONE, V3F }, - { T4F, NONE, NONE, V4F }, - - { T2F, C4UB, NONE, V3F }, - { T2F, C3F, NONE, V3F }, - { T2F, NONE, N3F, V3F }, - { T2F, C4F, N3F, V3F }, - { T4F, C4F, N3F, V4F }, -}; - -const char * const mode_names[ NUM_MODES ] = { - "GL_V2F", - "GL_V3F", - "GL_C4UB_V2F", - "GL_C4UB_V3F", - "GL_C3F_V3F", - "GL_N3F_V3F", - "GL_C4F_N3F_V3F", - "GL_T2F_V3F", - "GL_T4F_V4F", - "GL_T2F_C4UB_V3F", - "GL_T2F_C3F_V3F", - "GL_T2F_N3F_V3F", - "GL_T2F_C4F_N3F_V3F", - "GL_T4F_C4F_N3F_V4F", -}; - -static unsigned interleave_mode = 0; -static GLboolean use_invalid_mode = GL_FALSE; -static GLboolean use_invalid_stride = GL_FALSE; - -#define DEREF(item,idx) (void *) & ((char *)curr_info[item].data)[idx * curr_info[item].stride] - -static void Display( void ) -{ - const struct interleave_info * const curr_info = info[ interleave_mode ]; - - /* 4 floats for 12 verticies for 4 data elements. - */ - char data[ (sizeof( GLfloat ) * 4) * 12 * 4 ]; - - unsigned i; - unsigned offset; - GLenum err; - GLenum format; - GLsizei stride; - - - glClearColor(0.2, 0.2, 0.8, 0); - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - - glTranslatef(-1.5, 0, 0); - - glColor3fv( c_f[0] ); - - if ( curr_info[0].data != NULL ) { - glEnable( GL_TEXTURE_2D ); - } - else { - glDisable( GL_TEXTURE_2D ); - } - - - offset = 0; - glBegin(GL_TRIANGLES); - for ( i = 0 ; i < 12 ; i++ ) { - const unsigned index = indicies[i]; - - - /* Handle the vertex texture coordinate. - */ - if ( curr_info[0].data != NULL ) { - if ( curr_info[0].count == 2 ) { - glTexCoord2fv( DEREF(0, index) ); - } - else { - glTexCoord4fv( DEREF(0, index) ); - } - - (void) memcpy( & data[ offset ], DEREF(0, index), - curr_info[0].size ); - offset += curr_info[0].size; - } - - - /* Handle the vertex color. - */ - if ( curr_info[1].data != NULL ) { - if ( curr_info[1].type == GL_FLOAT ) { - if ( curr_info[1].count == 3 ) { - glColor3fv( DEREF(1, index) ); - } - else { - glColor4fv( DEREF(1, index) ); - } - } - else { - glColor4ubv( DEREF(1, index) ); - } - - (void) memcpy( & data[ offset ], DEREF(1, index), - curr_info[1].size ); - offset += curr_info[1].size; - } - - - /* Handle the vertex normal. - */ - if ( curr_info[2].data != NULL ) { - glNormal3fv( DEREF(2, index) ); - - (void) memcpy( & data[ offset ], DEREF(2, index), - curr_info[2].size ); - offset += curr_info[2].size; - } - - - switch( curr_info[3].count ) { - case 2: - glVertex2fv( DEREF(3, index) ); - break; - case 3: - glVertex3fv( DEREF(3, index) ); - break; - case 4: - glVertex4fv( DEREF(3, index) ); - break; - } - - (void) memcpy( & data[ offset ], DEREF(3, index), - curr_info[3].size ); - offset += curr_info[3].size; - } - glEnd(); - - - glTranslatef(3.0, 0, 0); - - /* The masking with ~0x2A00 is a bit of a hack to make sure that format - * ends up with an invalid value no matter what rand() returns. - */ - format = (use_invalid_mode) - ? (rand() & ~0x2A00) : GL_V2F + interleave_mode; - stride = (use_invalid_stride) ? -abs(rand()) : 0; - - (void) glGetError(); - glInterleavedArrays( format, stride, data ); - err = glGetError(); - if ( err ) { - printf("glInterleavedArrays(0x%04x, %d, %p) generated the error 0x%04x\n", - format, stride, data, err ); - } - else { - glDrawArrays( GL_TRIANGLES, 0, 12 ); - } - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / (float) height; - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, Near, Far ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void ModeMenu( int entry ) -{ - if ( entry == INVALID_MODE ) { - use_invalid_mode = GL_TRUE; - use_invalid_stride = GL_FALSE; - } - else if ( entry == INVALID_STRIDE ) { - use_invalid_mode = GL_FALSE; - use_invalid_stride = GL_TRUE; - } - else { - use_invalid_mode = GL_FALSE; - use_invalid_stride = GL_FALSE; - interleave_mode = entry; - } -} - -static void Init( void ) -{ - const char * const ver_string = (const char * const) - glGetString( GL_VERSION ); - const GLubyte tex[16] = { - 0xff, 0x00, 0xff, 0x00, - 0x00, 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, 0x00, - 0x00, 0xff, 0x00, 0xff, - }; - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", ver_string); - - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); - glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0, - GL_LUMINANCE, GL_UNSIGNED_BYTE, tex ); - - printf("Use the context menu (right click) to select the interleaved array mode.\n"); - printf("Press ESCAPE to exit.\n\n"); - printf("NOTE: This is *NOT* a very good test of the modes that use normals.\n"); -} - - -int main( int argc, char *argv[] ) -{ - unsigned i; - - srand( time( NULL ) ); - - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "glInterleavedArrays test" ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - - glutCreateMenu( ModeMenu ); - for ( i = 0 ; i < NUM_MODES ; i++ ) { - glutAddMenuEntry( mode_names[i], i); - } - - glutAddMenuEntry( "Random invalid mode", INVALID_MODE); - glutAddMenuEntry( "Random invalid stride", INVALID_STRIDE); - - glutAttachMenu(GLUT_RIGHT_BUTTON); - - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/invert.c b/progs/tests/invert.c deleted file mode 100644 index 750592ed79f..00000000000 --- a/progs/tests/invert.c +++ /dev/null @@ -1,195 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2005 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. - */ - -/** - * \file invert.c - * - * Simple test of GL_MESA_pack_invert functionality. Three squares are - * drawn. The first two should look the same, and the third one should - * look inverted. - * - * \author Ian Romanick <[email protected]> - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <GL/glut.h> - -#include "readtex.h" - -#define IMAGE_FILE "../images/tree3.rgb" - -static int Width = 420; -static int Height = 150; -static const GLfloat Near = 5.0, Far = 25.0; - -static GLubyte * image = NULL; -static GLubyte * temp_image = NULL; -static GLuint img_width = 0; -static GLuint img_height = 0; -static GLuint img_format = 0; - -PFNGLWINDOWPOS2IPROC win_pos_2i = NULL; - - -static void Display( void ) -{ - GLint err; - - - glClearColor(0.2, 0.2, 0.8, 0); - glClear( GL_COLOR_BUFFER_BIT ); - - - /* This is the "reference" square. - */ - - (*win_pos_2i)( 5, 5 ); - glDrawPixels( img_width, img_height, img_format, GL_UNSIGNED_BYTE, image ); - - glPixelStorei( GL_PACK_INVERT_MESA, GL_FALSE ); - err = glGetError(); - if ( err != GL_NO_ERROR ) { - printf( "Setting PACK_INVERT_MESA to false generated an error (0x%04x).\n", - err ); - } - - glReadPixels( 5, 5, img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image ); - (*win_pos_2i)( 5 + 1 * (10 + img_width), 5 ); - glDrawPixels( img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image ); - - glPixelStorei( GL_PACK_INVERT_MESA, GL_TRUE ); - err = glGetError(); - if ( err != GL_NO_ERROR ) { - printf( "Setting PACK_INVERT_MESA to true generated an error (0x%04x).\n", - err ); - } - - glReadPixels( 5, 5, img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image ); - (*win_pos_2i)( 5 + 2 * (10 + img_width), 5 ); - glDrawPixels( img_width, img_height, img_format, GL_UNSIGNED_BYTE, temp_image ); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / (float) height; - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, Near, Far ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - const char * const ver_string = (const char * const) - glGetString( GL_VERSION ); - const float ver = strtof( ver_string, NULL ); - - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", ver_string); - - if ( !glutExtensionSupported("GL_MESA_pack_invert") ) { - printf("\nSorry, this program requires GL_MESA_pack_invert.\n"); - exit(1); - } - - if ( ver >= 1.4 ) { - win_pos_2i = (PFNGLWINDOWPOS2IPROC) glutGetProcAddress( "glWindowPos2i" ); - } - else if ( glutExtensionSupported("GL_ARB_window_pos") ) { - win_pos_2i = (PFNGLWINDOWPOS2IPROC) glutGetProcAddress( "glWindowPos2iARB" ); - } - else if ( glutExtensionSupported("GL_MESA_window_pos") ) { - win_pos_2i = (PFNGLWINDOWPOS2IPROC) glutGetProcAddress( "glWindowPos2iMESA" ); - } - - - /* Do this check as a separate if-statement instead of as an else in case - * one of the required extensions is supported but glutGetProcAddress - * returns NULL. - */ - - if ( win_pos_2i == NULL ) { - printf("\nSorry, this program requires either GL 1.4 (or higher),\n" - "GL_ARB_window_pos, or GL_MESA_window_pos.\n"); - exit(1); - } - - printf("\nThe left 2 squares should be the same color, and the right\n" - "square should look upside-down.\n"); - - - image = LoadRGBImage( IMAGE_FILE, & img_width, & img_height, - & img_format ); - if ( image == NULL ) { - printf( "Could not open image file \"%s\".\n", IMAGE_FILE ); - exit(1); - } - - temp_image = malloc( 3 * img_height * img_width ); - if ( temp_image == NULL ) { - printf( "Could not allocate memory for temporary image.\n" ); - exit(1); - } -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "GL_MESA_pack_invert test" ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/jkrahntest.c b/progs/tests/jkrahntest.c deleted file mode 100644 index 9392e1ab2b9..00000000000 --- a/progs/tests/jkrahntest.c +++ /dev/null @@ -1,181 +0,0 @@ -/* $Id: jkrahntest.c,v 1.2 2006-01-30 17:12:10 brianp Exp $ */ - -/* This is a good test for glXSwapBuffers on non-current windows, - * and the glXCopyContext function. Fixed several Mesa/DRI bugs with - * this program on 15 June 2002. - * - * Joe's comments follow: - * - * I have tried some different approaches for being able to - * draw to multiple windows using one context, or a copied - * context. Mesa/indirect rendering works to use one context - * for multiple windows, but crashes with glXCopyContext. - * DRI is badly broken, at least for ATI. - * - * I also noticed that glXMakeCurrent allows a window and context - * from different visuals to be attached (haven't tested recently). - * - * Joe Krahn <[email protected]> - */ - -#include <GL/glx.h> -#include <GL/gl.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <math.h> - -#ifndef M_PI -#define M_PI 3.14159 -#endif - -#define DEGTOR (M_PI/180.0) - -static int AttributeList[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None }; - -int main(int argc, char **argv) -{ - Window win1, win2; - XVisualInfo *vi; - XSetWindowAttributes swa; - Display *dpy; - GLXContext ctx1, ctx2; - float angle; - int test; - - if (argc < 2) { - fprintf(stderr, "This program tests GLX context switching.\n"); - fprintf(stderr, "Usage: cxbug <n>\n"); - fprintf(stderr, "Where n is:\n"); - fprintf(stderr, "\t1) Use two contexts and swap only when the context is current (typical case).\n"); - fprintf(stderr, "\t2) Use two contexts and swap at the same time.\n"); - fprintf(stderr, "\t\t Used to crash Mesa & nVidia, and DRI artifacts. Seems OK now.\n"); - fprintf(stderr, "\t3) Use one context, but only swap when a context is current.\n"); - fprintf(stderr, "\t\t Serious artifacts for DRI at least with ATI.\n"); - fprintf(stderr, "\t4) Use one context, swap both windows at the same time, so the left\n"); - fprintf(stderr, "\t\t window has no context at swap time. Severe artifacts for DRI.\n"); - fprintf(stderr, "\t5) Use two contexts, copying one to the other when switching windows.\n"); - fprintf(stderr, "\t\t DRI gives an error, indirect rendering crashes server.\n"); - - exit(1); - } - test = atoi(argv[1]); - - /* get a connection */ - dpy = XOpenDisplay(NULL); - - /* Get an appropriate visual */ - vi = glXChooseVisual(dpy, DefaultScreen(dpy), AttributeList); - if (vi == 0) { - fprintf(stderr, "No matching visuals found.\n"); - exit(-1); - } - - /* Create two GLX contexts, with list sharing */ - ctx1 = glXCreateContext(dpy, vi, 0, True); - ctx2 = glXCreateContext(dpy, vi, ctx1, True); - - /* create a colormap */ - swa.colormap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), - vi->visual, AllocNone); - swa.border_pixel = 0; - - /* Create two windows */ - win1 = XCreateWindow(dpy, RootWindow(dpy, vi->screen), - 10, 10, 200, 200, - 0, vi->depth, InputOutput, vi->visual, - CWBorderPixel | CWColormap, &swa); - XStoreName(dpy, win1, "Test [L]"); - XMapWindow(dpy, win1); - XMoveWindow(dpy, win1, 10, 10); /* Initial requested x,y may not be honored */ - { - XSizeHints sizehints; - static const char *name = "window"; - sizehints.x = 10; - sizehints.y = 10; - sizehints.width = 200; - sizehints.height = 200; - sizehints.flags = USSize | USPosition; - XSetNormalHints(dpy, win1, &sizehints); - XSetStandardProperties(dpy, win1, name, name, - None, (char **)NULL, 0, &sizehints); - } - - - win2 = XCreateWindow(dpy, RootWindow(dpy, vi->screen), - 250, 10, 200, 200, - 0, vi->depth, InputOutput, vi->visual, - CWBorderPixel | CWColormap, &swa); - XStoreName(dpy, win1, "Test [R]"); - XMapWindow(dpy, win2); - XMoveWindow(dpy, win2, 260, 10); - { - XSizeHints sizehints; - static const char *name = "window"; - sizehints.x = 10; - sizehints.y = 10; - sizehints.width = 200; - sizehints.height = 200; - sizehints.flags = USSize | USPosition; - XSetNormalHints(dpy, win2, &sizehints); - XSetStandardProperties(dpy, win2, name, name, - None, (char **)NULL, 0, &sizehints); - } - - - /* Now draw some spinning things */ - for (angle = 0; angle < 360*4; angle += 10.0) { - /* Connect the context to window 1 */ - glXMakeCurrent(dpy, win1, ctx1); - - /* Clear and draw in window 1 */ - glDrawBuffer(GL_BACK); - glClearColor(1, 1, 0, 1); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glColor3f(1, 0, 0); - glBegin(GL_TRIANGLES); - glVertex2f(0, 0); - glVertex2f(cos(angle * DEGTOR), sin(angle * DEGTOR)); - glVertex2f(cos((angle + 20.0) * DEGTOR), - sin((angle + 20.0) * DEGTOR)); - glEnd(); - glFlush(); - - if (test == 1 || test == 3 || test == 5) - glXSwapBuffers(dpy, win1); - - if (test == 5) - glXCopyContext(dpy, ctx1, ctx2, GL_ALL_ATTRIB_BITS); - /* Connect the context to window 2 */ - if (test == 3 || test == 4) { - glXMakeCurrent(dpy, win2, ctx1); - } else { - glXMakeCurrent(dpy, win2, ctx2); - } - - /* Clear and draw in window 2 */ - glDrawBuffer(GL_BACK); - glClearColor(0, 0, 1, 1); - glClear(GL_COLOR_BUFFER_BIT); - glColor3f(1, 1, 0); - glBegin(GL_TRIANGLES); - glVertex2f(0, 0); - glVertex2f(cos(angle * DEGTOR), sin(angle * DEGTOR)); - glVertex2f(cos((angle + 20.0) * DEGTOR), - sin((angle + 20.0) * DEGTOR)); - glEnd(); - glFlush(); - - /* Swap buffers */ - if (test == 2 || test == 4) - glXSwapBuffers(dpy, win1); - glXSwapBuffers(dpy, win2); - - /* wait a while */ - glXWaitX(); - usleep(20000); - } - - return 0; -} diff --git a/progs/tests/manytex.c b/progs/tests/manytex.c deleted file mode 100644 index 70ad4a767ec..00000000000 --- a/progs/tests/manytex.c +++ /dev/null @@ -1,382 +0,0 @@ -/* $Id: manytex.c,v 1.5 2005-09-15 01:58:39 brianp Exp $ */ - -/* - * test handling of many texture maps - * Also tests texture priority and residency. - * - * Brian Paul - * August 2, 2000 - */ - - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> -#include <GL/glut.h> - - -static GLint NumTextures = 20; -static GLuint *TextureID = NULL; -static GLint *TextureWidth = NULL, *TextureHeight = NULL; -static GLboolean *TextureResidency = NULL; -static GLint TexWidth = 128, TexHeight = 128; -static GLfloat Zrot = 0; -static GLboolean Anim = GL_TRUE; -static GLint WinWidth = 500, WinHeight = 400; -static GLboolean MipMap = GL_FALSE; -static GLboolean LinearFilter = GL_FALSE; -static GLboolean RandomSize = GL_FALSE; -static GLint Rows, Columns; -static GLint LowPriorityCount = 0; - - -static void Idle( void ) -{ - Zrot += 1.0; - glutPostRedisplay(); -} - - -static void Display( void ) -{ - GLfloat spacing = WinWidth / Columns; - GLfloat size = spacing * 0.4; - GLint i; - - /* test residency */ - if (0) - { - GLboolean b; - GLint i, resident; - b = glAreTexturesResident(NumTextures, TextureID, TextureResidency); - if (b) { - printf("all resident\n"); - } - else { - resident = 0; - for (i = 0; i < NumTextures; i++) { - if (TextureResidency[i]) { - resident++; - } - } - printf("%d of %d texture resident\n", resident, NumTextures); - } - } - - /* render the textured quads */ - glClear( GL_COLOR_BUFFER_BIT ); - for (i = 0; i < NumTextures; i++) { - GLint row = i / Columns; - GLint col = i % Columns; - GLfloat x = col * spacing + spacing * 0.5; - GLfloat y = row * spacing + spacing * 0.5; - - GLfloat maxDim = (TextureWidth[i] > TextureHeight[i]) - ? TextureWidth[i] : TextureHeight[i]; - GLfloat w = TextureWidth[i] / maxDim; - GLfloat h = TextureHeight[i] / maxDim; - - glPushMatrix(); - glTranslatef(x, y, 0.0); - glRotatef(Zrot, 0, 0, 1); - glScalef(size, size, 1); - - glBindTexture(GL_TEXTURE_2D, TextureID[i]); - glBegin(GL_POLYGON); -#if 0 - glTexCoord2f(0, 0); glVertex2f(-1, -1); - glTexCoord2f(1, 0); glVertex2f( 1, -1); - glTexCoord2f(1, 1); glVertex2f( 1, 1); - glTexCoord2f(0, 1); glVertex2f(-1, 1); -#else - glTexCoord2f(0, 0); glVertex2f(-w, -h); - glTexCoord2f(1, 0); glVertex2f( w, -h); - glTexCoord2f(1, 1); glVertex2f( w, h); - glTexCoord2f(0, 1); glVertex2f(-w, h); -#endif - glEnd(); - glPopMatrix(); - } - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - WinWidth = width; - WinHeight = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(0, width, 0, height, -1, 1); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -} - - -/* - * Return a random int in [min, max]. - */ -static int RandomInt(int min, int max) -{ - int i = rand(); - int j = i % (max - min + 1); - return min + j; -} - - - -static void Init( void ) -{ - GLint i; - - if (RandomSize) { - printf("Creating %d %s random-size textures, ", NumTextures, - MipMap ? "Mipmapped" : "non-Mipmapped"); - } - else { - printf("Creating %d %s %d x %d textures, ", NumTextures, - MipMap ? "Mipmapped" : "non-Mipmapped", - TexWidth, TexHeight); - } - - if (LinearFilter) { - printf("bilinear filtering\n"); - } - else { - printf("nearest filtering\n"); - } - - - /* compute number of rows and columns of rects */ - { - GLfloat area = (GLfloat) (WinWidth * WinHeight) / (GLfloat) NumTextures; - GLfloat edgeLen = sqrt(area); - - Columns = WinWidth / edgeLen; - Rows = (NumTextures + Columns - 1) / Columns; - printf("Rows: %d Cols: %d\n", Rows, Columns); - } - - - if (!TextureID) { - TextureID = (GLuint *) malloc(sizeof(GLuint) * NumTextures); - assert(TextureID); - glGenTextures(NumTextures, TextureID); - } - - if (!TextureResidency) { - TextureResidency = (GLboolean *) malloc(sizeof(GLboolean) * NumTextures); - assert(TextureResidency); - } - - if (!TextureWidth) { - TextureWidth = (GLint *) malloc(sizeof(GLint) * NumTextures); - assert(TextureWidth); - } - if (!TextureHeight) { - TextureHeight = (GLint *) malloc(sizeof(GLint) * NumTextures); - assert(TextureHeight); - } - - for (i = 0; i < NumTextures; i++) { - GLubyte color[4]; - GLubyte *texImage; - GLint j, row, col; - - row = i / Columns; - col = i % Columns; - - glBindTexture(GL_TEXTURE_2D, TextureID[i]); - - if (i < LowPriorityCount) - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 0.5F); - - if (RandomSize) { -#if 0 - int k = (glutGet(GLUT_ELAPSED_TIME) % 7) + 2; - TexWidth = 1 << k; - TexHeight = 1 << k; -#else - TexWidth = 1 << RandomInt(2, 7); - TexHeight = 1 << RandomInt(2, 7); - printf("Random size of %3d: %d x %d\n", i, TexWidth, TexHeight); -#endif - } - - TextureWidth[i] = TexWidth; - TextureHeight[i] = TexHeight; - - texImage = (GLubyte*) malloc(4 * TexWidth * TexHeight * sizeof(GLubyte)); - assert(texImage); - - /* determine texture color */ - color[0] = (GLint) (255.0 * ((float) col / (Columns - 1))); - color[1] = 127; - color[2] = (GLint) (255.0 * ((float) row / (Rows - 1))); - color[3] = 255; - - /* fill in solid-colored teximage */ - for (j = 0; j < TexWidth * TexHeight; j++) { - texImage[j*4+0] = color[0]; - texImage[j*4+1] = color[1]; - texImage[j*4+2] = color[2]; - texImage[j*4+3] = color[3]; - } - - if (MipMap) { - GLint level = 0; - GLint w = TexWidth, h = TexHeight; - while (1) { - glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, w, h, 0, - GL_RGBA, GL_UNSIGNED_BYTE, texImage); - if (w == 1 && h == 1) - break; - if (w > 1) - w /= 2; - if (h > 1) - h /= 2; - level++; - /*printf("%d: %d x %d\n", level, w, h);*/ - } - if (LinearFilter) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_LINEAR_MIPMAP_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_NEAREST_MIPMAP_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - } - else { - /* Set corners to white */ - int k = 0; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - k = (TexWidth - 1) * 4; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - k = (TexWidth * TexHeight - TexWidth) * 4; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - k = (TexWidth * TexHeight - 1) * 4; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0, - GL_RGBA, GL_UNSIGNED_BYTE, texImage); - if (LinearFilter) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - } - - free(texImage); - } - - glEnable(GL_TEXTURE_2D); -} - - -static void Key( unsigned char key, int x, int y ) -{ - const GLfloat step = 3.0; - (void) x; - (void) y; - switch (key) { - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 's': - Idle(); - break; - case 'z': - Zrot -= step; - break; - case 'Z': - Zrot += step; - break; - case ' ': - Init(); - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -int main( int argc, char *argv[] ) -{ - GLint i; - - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( WinWidth, WinHeight ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc(Idle); - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-n") == 0) { - NumTextures = atoi(argv[i+1]); - if (NumTextures <= 0) { - printf("Error, bad number of textures\n"); - return 1; - } - i++; - } - else if (strcmp(argv[i], "-mipmap") == 0) { - MipMap = GL_TRUE; - } - else if (strcmp(argv[i], "-linear") == 0) { - LinearFilter = GL_TRUE; - } - else if (strcmp(argv[i], "-size") == 0) { - TexWidth = atoi(argv[i+1]); - TexHeight = atoi(argv[i+2]); - assert(TexWidth >= 1); - assert(TexHeight >= 1); - i += 2; - } - else if (strcmp(argv[i], "-randomsize") == 0) { - RandomSize = GL_TRUE; - } - else if (strcmp(argv[i], "-lowpri") == 0) { - LowPriorityCount = atoi(argv[i+1]); - i++; - } - else { - printf("Usage:\n"); - printf(" manytex [options]\n"); - printf("Options:\n"); - printf(" -n <number of texture objects>\n"); - printf(" -size <width> <height> - specify texture size\n"); - printf(" -randomsize - use random size textures\n"); - printf(" -mipmap - generate mipmaps\n"); - printf(" -linear - use linear filtering instead of nearest\n"); - printf(" -lowpri <n> - Set lower priority on <n> textures\n"); - return 0; - } - } - - Init(); - - glutMainLoop(); - - return 0; -} diff --git a/progs/tests/mipmap_limits.c b/progs/tests/mipmap_limits.c deleted file mode 100644 index 6f6d893f77c..00000000000 --- a/progs/tests/mipmap_limits.c +++ /dev/null @@ -1,233 +0,0 @@ -/* Test GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL - * Brian Paul - * 10 May 2006 - */ - - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/* - * (c) Copyright 1993, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -/* mipmap.c - * This program demonstrates using mipmaps for texture maps. - * To overtly show the effect of mipmaps, each mipmap reduction - * level has a solidly colored, contrasting texture image. - * Thus, the quadrilateral which is drawn is drawn with several - * different colors. - */ -#include <stdlib.h> -#include <stdio.h> -#include <GL/glut.h> - -static GLint BaseLevel = 0, MaxLevel = 8; -static GLfloat LodBias = 0.0; -static GLboolean NearestFilter = GL_TRUE; - - -static void MakeImage(int level, int width, int height, const GLubyte color[4]) -{ - const int makeStripes = 0; - GLubyte img[256*256*3]; - int i, j; - for (i = 0; i < height; i++) { - for (j = 0; j < width; j++) { - int k = (i * width + j) * 3; - int p = (i/8) & makeStripes; - if (p == 0) { - img[k + 0] = color[0]; - img[k + 1] = color[1]; - img[k + 2] = color[2]; - } - else { - img[k + 0] = 0; - img[k + 1] = 0; - img[k + 2] = 0; - } - } - } - - glTexImage2D(GL_TEXTURE_2D, level, GL_RGB, width, height, 0, - GL_RGB, GL_UNSIGNED_BYTE, img); -} - - -static void makeImages(void) -{ - static const GLubyte colors[8][3] = { - {128, 128, 128 }, - { 0, 255, 255 }, - { 255, 255, 0 }, - { 255, 0, 255 }, - { 255, 0, 0 }, - { 0, 255, 0 }, - { 0, 0, 255 }, - { 255, 255, 255 } - }; - int i, sz = 128; - - for (i = 0; i < 8; i++) { - MakeImage(i, sz, sz, colors[i]); - sz /= 2; - } -} - -static void myinit(void) -{ - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LESS); - glShadeModel(GL_FLAT); - - glTranslatef(0.0, 0.0, -3.6); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - makeImages(); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); - glEnable(GL_TEXTURE_2D); -} - -static void display(void) -{ - GLfloat tcm = 4.0; - printf("GL_TEXTURE_BASE_LEVEL = %d GL_TEXTURE_MAX_LEVEL = %d Bias = %.2g filter = %s\n", - BaseLevel, MaxLevel, LodBias, - NearestFilter ? "LINEAR" : "NEAREST"); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel); - - if (NearestFilter) { - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_NEAREST_MIPMAP_NEAREST); - } - else { - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_LINEAR_MIPMAP_LINEAR); - } - - glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, LodBias); - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glBegin(GL_QUADS); - glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0); - glTexCoord2f(0.0, tcm); glVertex3f(-2.0, 1.0, 0.0); - glTexCoord2f(tcm, tcm); glVertex3f(3000.0, 1.0, -6000.0); - glTexCoord2f(tcm, 0.0); glVertex3f(3000.0, -1.0, -6000.0); - glEnd(); - glFlush(); -} - -static void myReshape(int w, int h) -{ - glViewport(0, 0, w, h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); -} - -static void -key(unsigned char k, int x, int y) -{ - (void) x; - (void) y; - switch (k) { - case 'b': - BaseLevel--; - if (BaseLevel < 0) - BaseLevel = 0; - break; - case 'B': - BaseLevel++; - if (BaseLevel > 10) - BaseLevel = 10; - break; - case 'm': - MaxLevel--; - if (MaxLevel < 0) - MaxLevel = 0; - break; - case 'M': - MaxLevel++; - if (MaxLevel > 10) - MaxLevel = 10; - break; - case 'l': - LodBias -= 0.02; - break; - case 'L': - LodBias += 0.02; - break; - case 'f': - NearestFilter = !NearestFilter; - break; - case 27: /* Escape */ - exit(0); - break; - default: - return; - } - glutPostRedisplay(); -} - - -static void usage(void) -{ - printf("usage:\n"); - printf(" b/B decrease/increase GL_TEXTURE_BASE_LEVEL\n"); - printf(" m/M decrease/increase GL_TEXTURE_MAX_LEVEL\n"); - printf(" f toggle nearest/linear filtering\n"); -} - - -int main(int argc, char** argv) -{ - glutInit(&argc, argv); - glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH); - glutInitWindowSize (600, 600); - glutCreateWindow (argv[0]); - myinit(); - glutReshapeFunc (myReshape); - glutDisplayFunc(display); - glutKeyboardFunc(key); - usage(); - glutMainLoop(); - return 0; /* ANSI C requires main to return int. */ -} diff --git a/progs/tests/multipal.c b/progs/tests/multipal.c deleted file mode 100644 index 6ae33d751a6..00000000000 --- a/progs/tests/multipal.c +++ /dev/null @@ -1,377 +0,0 @@ -/* $Id: multipal.c,v 1.6 2003-12-08 09:03:36 joukj Exp $ */ - -/* - * Test multitexture and paletted textures. - */ - -#include <assert.h> -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#ifdef __VMS -# include <stddef.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */ -#else -# include <malloc.h> /* for ptrdiff_t, referenced by GL.h when GL_GLEXT_LEGACY defined */ -#endif -#ifdef _WIN32 -#include <windows.h> -#endif -#define GL_GLEXT_LEGACY -#include <GL/glut.h> - -#include "../util/readtex.c" /* I know, this is a hack. */ - -#define TEXTURE_1_FILE "../images/tile.rgb" -#define TEXTURE_2_FILE "../images/reflect.rgb" - -#define TEX0 1 -#define TEX1 2 -#define TEXBOTH 3 -#define ANIMATE 10 -#define QUIT 100 - -static GLboolean Animate = GL_TRUE; - -static GLfloat Drift = 0.0; -static GLfloat Xrot = 20.0, Yrot = 30.0, Zrot = 0.0; - - - -static void Idle( void ) -{ - if (Animate) { - Drift += 0.05; - if (Drift >= 1.0) - Drift = 0.0; - -#ifdef GL_ARB_multitexture - glActiveTextureARB(GL_TEXTURE0_ARB); -#endif - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glTranslatef(Drift, 0.0, 0.0); - glMatrixMode(GL_MODELVIEW); - -#ifdef GL_ARB_multitexture - glActiveTextureARB(GL_TEXTURE1_ARB); -#endif - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glTranslatef(0.0, Drift, 0.0); - glMatrixMode(GL_MODELVIEW); - - glutPostRedisplay(); - } -} - - -static void DrawObject(void) -{ - glBegin(GL_QUADS); - -#ifdef GL_ARB_multitexture - glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 0.0); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 0.0); - glVertex2f(-1.0, -1.0); - - glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 2.0, 0.0); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, 0.0); - glVertex2f(1.0, -1.0); - - glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 2.0, 2.0); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, 1.0); - glVertex2f(1.0, 1.0); - - glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 2.0); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 1.0); - glVertex2f(-1.0, 1.0); -#else - glTexCoord2f(0.0, 0.0); - glVertex2f(-1.0, -1.0); - - glTexCoord2f(1.0, 0.0); - glVertex2f(1.0, -1.0); - - glTexCoord2f(1.0, 1.0); - glVertex2f(1.0, 1.0); - - glTexCoord2f(0.0, 1.0); - glVertex2f(-1.0, 1.0); -#endif - - glEnd(); -} - - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glScalef(5.0, 5.0, 5.0); - DrawObject(); - glPopMatrix(); - - glutSwapBuffers(); -} - - -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, 10.0, 100.0 ); - /*glOrtho( -6.0, 6.0, -6.0, 6.0, 10.0, 100.0 );*/ - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -70.0 ); -} - - -static void ModeMenu(int entry) -{ - GLboolean enable0 = GL_FALSE, enable1 = GL_FALSE; - if (entry==TEX0) { - enable0 = GL_TRUE; - } - else if (entry==TEX1) { - enable1 = GL_TRUE; - } - else if (entry==TEXBOTH) { - enable0 = GL_TRUE; - enable1 = GL_TRUE; - } - else if (entry==ANIMATE) { - Animate = !Animate; - } - else if (entry==QUIT) { - exit(0); - } - - if (entry != ANIMATE) { -#ifdef GL_ARB_multitexture - glActiveTextureARB(GL_TEXTURE0_ARB); -#endif - if (enable0) { - glEnable(GL_TEXTURE_2D); - } - else - glDisable(GL_TEXTURE_2D); - -#ifdef GL_ARB_multitexture - glActiveTextureARB(GL_TEXTURE1_ARB); -#endif - if (enable1) { - glEnable(GL_TEXTURE_2D); - } - else - glDisable(GL_TEXTURE_2D); - } - - glutPostRedisplay(); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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 load_tex(const char *fname, int channel) -{ - GLubyte *image; - GLenum format; - GLint w, h; - GLubyte *grayImage; - int i; - GLubyte table[256][4]; - - image = LoadRGBImage(fname, &w, &h, &format); - if (!image) - exit(1); - - printf("%s %d x %d\n", fname, w, h); - grayImage = malloc(w * h * 1); - assert(grayImage); - for (i = 0; i < w * h; i++) { - int g = (image[i*3+0] + image[i*3+1] + image[i*3+2]) / 3; - assert(g < 256); - grayImage[i] = g; - } - - glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX, w, h, 0, GL_COLOR_INDEX, - GL_UNSIGNED_BYTE, grayImage); - - for (i = 0; i < 256; i++) { - table[i][0] = channel ? i : 0; - table[i][1] = i; - table[i][2] = channel ? 0 : i; - table[i][3] = 255; - } - - glColorTableEXT(GL_TEXTURE_2D, /* target */ - GL_RGBA, /* internal format */ - 256, /* table size */ - GL_RGBA, /* table format */ - GL_UNSIGNED_BYTE, /* table type */ - table); /* the color table */ - - free(grayImage); - free(image); -} - - - -static void Init( int argc, char *argv[] ) -{ - GLuint texObj[2]; - GLint units; - - if (!glutExtensionSupported("GL_ARB_multitexture")) { - printf("Sorry, GL_ARB_multitexture not supported by this renderer.\n"); - exit(1); - } - if (!glutExtensionSupported("GL_EXT_paletted_texture")) { - printf("Sorry, GL_EXT_paletted_texture not supported by this renderer.\n"); - exit(1); - } - - glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &units); - printf("%d texture units supported\n", units); - - /* allocate two texture objects */ - glGenTextures(2, texObj); - - /* setup texture obj 0 */ - glBindTexture(GL_TEXTURE_2D, texObj[0]); -#ifdef LINEAR_FILTER - /* linear filtering looks much nicer but is much slower for Mesa */ - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -foo -#else - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); -#endif - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - load_tex(TEXTURE_1_FILE, 0); -#if 0 - if (!LoadRGBMipmaps(TEXTURE_1_FILE, GL_RGB)) { - printf("Error: couldn't load texture image\n"); - exit(1); - } -#endif - - /* setup texture obj 1 */ - glBindTexture(GL_TEXTURE_2D, texObj[1]); -#ifdef LINEAR_FILTER - /* linear filtering looks much nicer but is much slower for Mesa */ - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -foo -#else - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); -#endif - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - load_tex(TEXTURE_2_FILE, 1); -#if 0 - if (!LoadRGBMipmaps(TEXTURE_2_FILE, GL_RGB)) { - printf("Error: couldn't load texture image\n"); - exit(1); - } -#endif - - /* now bind the texture objects to the respective texture units */ -#ifdef GL_ARB_multitexture - glActiveTextureARB(GL_TEXTURE0_ARB); - glBindTexture(GL_TEXTURE_2D, texObj[0]); - glActiveTextureARB(GL_TEXTURE1_ARB); - glBindTexture(GL_TEXTURE_2D, texObj[1]); -#endif - - glShadeModel(GL_FLAT); - glClearColor(0.3, 0.3, 0.4, 1.0); - - ModeMenu(TEXBOTH); - - if (argc > 1 && strcmp(argv[1], "-info")==0) { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - } -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowSize( 300, 300 ); - glutInitWindowPosition( 0, 0 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0] ); - - Init( argc, argv ); - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - glutIdleFunc( Idle ); - - glutCreateMenu(ModeMenu); - glutAddMenuEntry("Texture 0", TEX0); - glutAddMenuEntry("Texture 1", TEX1); - glutAddMenuEntry("Multi-texture", TEXBOTH); - glutAddMenuEntry("Toggle Animation", ANIMATE); - glutAddMenuEntry("Quit", QUIT); - glutAttachMenu(GLUT_RIGHT_BUTTON); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/multitexarray.c b/progs/tests/multitexarray.c deleted file mode 100644 index b4fab004a63..00000000000 --- a/progs/tests/multitexarray.c +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Test vertex arrays and multitexture. - * Press 'a' to toggle vertex arrays on/off. - * When you run this program you should see a square with four colors: - * - * +------+------+ - * |yellow| pink | - * +------+------+ - * |green | blue | - * +------+------+ - */ - - -#include <assert.h> -#include <math.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include "GL/glut.h" - -static GLuint Window = 0; - -static GLuint TexObj[2]; -static GLfloat Angle = 0.0f; -static GLboolean UseArrays = 1, Anim = 0; - -static GLfloat VertArray[4][2] = { - {-1.2, -1.2}, {1.2, -1.2}, {1.2, 1.2}, {-1.2, 1.2} -}; - -static GLfloat Tex0Array[4][2] = { - {0, 0}, {1, 0}, {1, 1}, {0, 1} -}; - -static GLfloat Tex1Array[4][2] = { - {0, 0}, {1, 0}, {1, 1}, {0, 1} -}; - - -static void init_arrays(void) -{ - glVertexPointer(2, GL_FLOAT, 0, VertArray); - glEnableClientState(GL_VERTEX_ARRAY); - - glClientActiveTextureARB(GL_TEXTURE0_ARB); - glTexCoordPointer(2, GL_FLOAT, 0, Tex0Array); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - - glClientActiveTextureARB(GL_TEXTURE1_ARB); - glTexCoordPointer(2, GL_FLOAT, 0, Tex1Array); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); -} - - -static void draw( void ) -{ - glClear( GL_COLOR_BUFFER_BIT ); - - glColor3f( 0.0, 0.0, 0.0 ); - - /* draw first polygon */ - glPushMatrix(); - glRotatef( Angle, 0.0, 0.0, 1.0 ); - - if (UseArrays) { - glDrawArrays(GL_POLYGON, 0, 4); - } - else { - glBegin( GL_POLYGON ); - glTexCoord2f( 0.0, 0.0 ); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 0.0); - glVertex2f( -1.0, -1.0 ); - - glTexCoord2f( 1.0, 0.0 ); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, 0.0); - glVertex2f( 1.0, -1.0 ); - - glTexCoord2f( 1.0, 1.0 ); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, 1.0); - glVertex2f( 1.0, 1.0 ); - - glTexCoord2f( 0.0, 1.0 ); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 1.0); - glVertex2f( -1.0, 1.0 ); - glEnd(); - } - - glPopMatrix(); - - glutSwapBuffers(); -} - - - -static void idle( void ) -{ - Angle += 2.0; - glutPostRedisplay(); -} - - - -/* change view Angle, exit upon ESC */ -static void key(unsigned char k, int x, int y) -{ - (void) x; - (void) y; - switch (k) { - case 'a': - UseArrays = !UseArrays; - printf("UseArrays: %d\n", UseArrays); - break; - case ' ': - Anim = !Anim; - if (Anim) - glutIdleFunc(idle); - else - glutIdleFunc(NULL); - break; - case 27: - glDeleteTextures( 2, TexObj ); - glutDestroyWindow(Window); - exit(0); - } - glutPostRedisplay(); -} - - - -/* new window size or exposure */ -static void reshape( int width, int height ) -{ - glViewport(0, 0, (GLint)width, (GLint)height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - /* glOrtho( -3.0, 3.0, -3.0, 3.0, -10.0, 10.0 );*/ - glFrustum( -2.0, 2.0, -2.0, 2.0, 6.0, 20.0 ); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -8.0 ); -} - - -static void init( void ) -{ - static int width=8, height=8; - GLubyte tex[64][3]; - GLint i, j; - - /* generate texture object IDs */ - glGenTextures( 2, TexObj ); - - /* - * setup first texture object - */ - glActiveTextureARB(GL_TEXTURE0_ARB); - glEnable( GL_TEXTURE_2D ); - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD ); - - glBindTexture( GL_TEXTURE_2D, TexObj[0] ); - assert(glIsTexture(TexObj[0])); - - /* red over black */ - for (i=0;i<height;i++) { - for (j=0;j<width;j++) { - int p = i*width+j; - if (i < height / 2) { - tex[p][0] = 0; tex[p][1] = 0; tex[p][2] = 0; - } - else { - tex[p][0] = 255; tex[p][1] = 0; tex[p][2] = 0; - } - } - } - - glTexImage2D( GL_TEXTURE_2D, 0, 3, width, height, 0, - GL_RGB, GL_UNSIGNED_BYTE, tex ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); - - - /* - * setup second texture object - */ - glActiveTextureARB(GL_TEXTURE1_ARB); - glEnable( GL_TEXTURE_2D ); - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD ); - - glBindTexture( GL_TEXTURE_2D, TexObj[1] ); - assert(glIsTexture(TexObj[1])); - - /* left=green, right = blue */ - for (i=0;i<height;i++) { - for (j=0;j<width;j++) { - int p = i*width+j; - if (j < width / 2) { - tex[p][0] = 0; tex[p][1] = 255; tex[p][2] = 0; - } - else { - tex[p][0] = 0; tex[p][1] = 0; tex[p][2] = 255; - } - } - } - glTexImage2D( GL_TEXTURE_2D, 0, 3, width, height, 0, - GL_RGB, GL_UNSIGNED_BYTE, tex ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); -} - - - -int main( int argc, char *argv[] ) -{ - glutInit(&argc, argv); - glutInitWindowPosition(0, 0); - glutInitWindowSize(300, 300); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - - Window = glutCreateWindow("Texture Objects"); - if (!Window) { - exit(1); - } - - init(); - init_arrays(); - - glutReshapeFunc( reshape ); - glutKeyboardFunc( key ); - if (Anim) - glutIdleFunc( idle ); - glutDisplayFunc( draw ); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/multiwindow.c b/progs/tests/multiwindow.c deleted file mode 100644 index d4e11d316be..00000000000 --- a/progs/tests/multiwindow.c +++ /dev/null @@ -1,169 +0,0 @@ -/* $Id: multiwindow.c,v 1.1 2001-08-21 14:25:31 brianp Exp $ */ - -/* - * A skeleton/template GLUT program - * - * Written by Brian Paul and in the public domain. - */ - - -/* - * $Log: multiwindow.c,v $ - * Revision 1.1 2001-08-21 14:25:31 brianp - * simple multi-window GLUT test prog - * - * Revision 1.1.1.1 1999/08/19 00:55:42 jtg - * Imported sources - * - * Revision 1.2 1998/11/07 14:20:14 brianp - * added simple rotation, animation of cube - * - * Revision 1.1 1998/11/07 14:14:37 brianp - * Initial revision - * - */ - - -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - - -static GLint Window[2]; - -static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; -static GLboolean Anim = GL_TRUE; - - -static void Idle( void ) -{ - Xrot += 3.0; - Yrot += 4.0; - Zrot += 2.0; - - glutSetWindow(Window[0]); - glutPostRedisplay(); - glutSetWindow(Window[1]); - glutPostRedisplay(); -} - - -static void Display0( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - glPushMatrix(); - glRotatef(Xrot, 1, 0, 0); - glRotatef(Yrot, 0, 1, 0); - glRotatef(Zrot, 0, 0, 1); - - glColor3f(0, 1, 0); - glutSolidCube(2.0); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Display1( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1, 0, 0); - glRotatef(Yrot, 0, 1, 0); - glRotatef(Zrot, 0, 0, 1); - - glShadeModel(GL_FLAT); - - glBegin(GL_TRIANGLE_STRIP); - glColor3f(1, 0, 0); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glColor3f(1, 0, 0); - glVertex2f( -1, 1); - glColor3f(0, 0, 1); - glVertex2f( 1, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -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.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - const GLfloat step = 3.0; - (void) x; - (void) y; - switch (key) { - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 'z': - Zrot -= step; - break; - case 'Z': - Zrot += step; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 400, 400 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - Window[0] = glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display0 ); - glutIdleFunc(Idle); - printf("GL_RENDERER[0] = %s\n", (char *) glGetString(GL_RENDERER)); - - glutInitWindowPosition( 500, 0 ); - glutInitWindowSize( 400, 400 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - Window[1] = glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display1 ); - glutIdleFunc(Idle); - printf("GL_RENDERER[1] = %s\n", (char *) glGetString(GL_RENDERER)); - - glutMainLoop(); - - return 0; -} diff --git a/progs/tests/no_s3tc.c b/progs/tests/no_s3tc.c deleted file mode 100644 index d3383ff98af..00000000000 --- a/progs/tests/no_s3tc.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2004 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. - */ - -/** - * \file no_s3tc.c - * Test program to verify the behavior of an OpenGL implementation when - * an application calls \c glCompressedTexImage2D with an unsupported (but - * valid) compression format. The most common example is calling it with - * \c GL_COMPRESSED_RGBA_S3TC_DXT1_EXT when GL_EXT_texture_compression_s3tc - * is not supported. - * - * This tests Mesa bug #1028405. - * - * \author Ian Romanick <[email protected]> - */ - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <GL/glut.h> -#include <GL/glext.h> - -static unsigned data[16]; - -int -main( int argc, char ** argv ) -{ - float gl_version; - GLenum format; - GLuint size; - GLuint width; - GLenum err; - - - glutInit( & argc, argv ); - glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); - - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 300, 300 ); - glutCreateWindow( "No S3TC Test" ); - - gl_version = strtod( (const char *) glGetString( GL_VERSION ), NULL ); - if ( ! glutExtensionSupported( "GL_ARB_texture_compression" ) - && (gl_version < 1.3) ) { - fprintf( stderr, "Either OpenGL 1.3 or GL_ARB_texture_compression " - "must be supported.\n" ); - return( EXIT_SUCCESS ); - } - - - if ( ! glutExtensionSupported( "GL_EXT_texture_compression_s3tc" ) ) { - format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - width = 4; - size = 8; - } - else if ( ! glutExtensionSupported( "GL_3DFX_texture_compression_FXT1" ) ) { - format = GL_COMPRESSED_RGBA_FXT1_3DFX; - width = 8; - size = 16; - } - else { - fprintf( stderr, "Either GL_EXT_texture_compression_s3tc or " - "GL_3DFX_texture_compression_FXT1 must NOT be supported.\n" ); - return( EXIT_SUCCESS ); - } - - glCompressedTexImage2D( GL_TEXTURE_2D, 0, format, width, 4, 0, - size, data ); - err = glGetError(); - if ( err != GL_INVALID_ENUM ) { - fprintf( stderr, "GL error 0x%04x should have been generated, but " - "0x%04x was generated instead.\n", GL_INVALID_ENUM, err ); - } - - return (err == GL_INVALID_ENUM) ? EXIT_SUCCESS : EXIT_FAILURE; -} diff --git a/progs/tests/packedpixels.c b/progs/tests/packedpixels.c deleted file mode 100644 index 67ffe088259..00000000000 --- a/progs/tests/packedpixels.c +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Test packed pixel formats for textures. - * Brian Paul - * 12 May 2004 - */ - -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <string.h> -#include <GL/glut.h> - - -struct pixel_format { - const char *name; - GLenum format; - GLenum type; - GLint bytes; - GLuint redTexel, greenTexel; -}; - -static const struct pixel_format Formats[] = { - - { "GL_RGBA/GL_UNSIGNED_INT_8_8_8_8", - GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, 4, 0xff000000, 0x00ff0000 }, - { "GL_RGBA/GL_UNSIGNED_INT_8_8_8_8_REV", - GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, 4, 0x000000ff, 0x0000ff00 }, - { "GL_RGBA/GL_UNSIGNED_INT_10_10_10_2", - GL_RGBA, GL_UNSIGNED_INT_10_10_10_2, 4, 0xffc00000, 0x3ff000 }, - { "GL_RGBA/GL_UNSIGNED_INT_2_10_10_10_REV", - GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, 4, 0x3ff, 0xffc00 }, - { "GL_RGBA/GL_UNSIGNED_SHORT_4_4_4_4", - GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 2, 0xf000, 0x0f00 }, - { "GL_RGBA/GL_UNSIGNED_SHORT_4_4_4_4_REV", - GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 2, 0x000f, 0x00f0 }, - { "GL_RGBA/GL_UNSIGNED_SHORT_5_5_5_1", - GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 2, 0xf800, 0x7c0 }, - { "GL_RGBA/GL_UNSIGNED_SHORT_1_5_5_5_REV", - GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0x1f, 0x3e0 }, - - { "GL_BGRA/GL_UNSIGNED_INT_8_8_8_8", - GL_BGRA, GL_UNSIGNED_INT_8_8_8_8, 4, 0x0000ff00, 0x00ff0000 }, - { "GL_BGRA/GL_UNSIGNED_INT_8_8_8_8_REV", - GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 4, 0x00ff0000, 0x0000ff00 }, - { "GL_BGRA/GL_UNSIGNED_SHORT_4_4_4_4", - GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4, 2, 0x00f0, 0x0f00 }, - { "GL_BGRA/GL_UNSIGNED_SHORT_4_4_4_4_REV", - GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 2, 0x0f00, 0x00f0 }, - { "GL_BGRA/GL_UNSIGNED_SHORT_5_5_5_1", - GL_BGRA, GL_UNSIGNED_SHORT_5_5_5_1, 2, 0x3e, 0x7c0 }, - { "GL_BGRA/GL_UNSIGNED_SHORT_1_5_5_5_REV", - GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0x7c00, 0x3e0 }, - - { "GL_ABGR_EXT/GL_UNSIGNED_INT_8_8_8_8", - GL_ABGR_EXT, GL_UNSIGNED_INT_8_8_8_8, 4, 0x000000ff, 0x0000ff00 }, - { "GL_ABGR_EXT/GL_UNSIGNED_INT_8_8_8_8_REV", - GL_ABGR_EXT, GL_UNSIGNED_INT_8_8_8_8_REV, 4, 0xff000000, 0x00ff0000 }, - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_4_4_4_4", - GL_ABGR_EXT, GL_UNSIGNED_SHORT_4_4_4_4, 2, 0x000f, 0x00f0 }, - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_4_4_4_4_REV", - GL_ABGR_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV, 2, 0xf000, 0x0f00 }, - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_5_5_5_1", - GL_ABGR_EXT, GL_UNSIGNED_SHORT_5_5_5_1, 2, 0x1, 0x3e }, - { "GL_ABGR_EXT/GL_UNSIGNED_SHORT_1_5_5_5_REV", - GL_ABGR_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2, 0x8000, 0x7c00 }, - - { "GL_RGB/GL_UNSIGNED_SHORT_5_6_5", - GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 2, 0xf800, 0x7e0 }, - { "GL_RGB/GL_UNSIGNED_SHORT_5_6_5_REV", - GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV, 2, 0x1f, 0x7e0 }, - { "GL_RGB/GL_UNSIGNED_BYTE_3_3_2", - GL_RGB, GL_UNSIGNED_BYTE_3_3_2, 1, 0xe0, 0x1c }, - { "GL_RGB/GL_UNSIGNED_BYTE_2_3_3_REV", - GL_RGB, GL_UNSIGNED_BYTE_2_3_3_REV, 1, 0x7, 0x38 }, - - { NULL, 0, 0, 0, 0, 0 } -}; - - -struct name_format { - const char *name; - GLenum format; -}; - -static const struct name_format IntFormats[] = { - { "GL_RGBA", GL_RGBA }, - { "GL_RGBA2", GL_RGBA2 }, - { "GL_RGBA4", GL_RGBA4 }, - { "GL_RGB5_A1", GL_RGB5_A1 }, - { "GL_RGBA8", GL_RGBA8 }, - { "GL_RGBA12", GL_RGBA12 }, - { "GL_RGBA16", GL_RGBA16 }, - { "GL_RGB10_A2", GL_RGB10_A2 }, - - { "GL_RGB", GL_RGB }, - { "GL_R3_G3_B2", GL_R3_G3_B2 }, - { "GL_RGB4", GL_RGB4 }, - { "GL_RGB5", GL_RGB5 }, - { "GL_RGB8", GL_RGB8 }, - { "GL_RGB10", GL_RGB10 }, - { "GL_RGB12", GL_RGB12 }, - { "GL_RGB16", GL_RGB16 }, - -}; - -#define NUM_INT_FORMATS (sizeof(IntFormats) / sizeof(IntFormats[0])) -static GLuint CurFormat = 0; - -static GLboolean Test3D = GL_FALSE; - - - -static void -PrintString(const char *s) -{ - while (*s) { - glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); - s++; - } -} - - -static void -MakeTexture(const struct pixel_format *format, GLenum intFormat, GLboolean swap) -{ - GLubyte texBuffer[1000]; - int i; - - glPixelStorei(GL_UNPACK_SWAP_BYTES, swap); - - if (format->bytes == 1) { - for (i = 0; i < 8; i++) { - texBuffer[i] = format->redTexel; - } - for (i = 8; i < 16; i++) { - texBuffer[i] = format->greenTexel; - } - } - else if (format->bytes == 2) { - GLushort *us = (GLushort *) texBuffer; - for (i = 0; i < 8; i++) { - us[i] = format->redTexel; - } - for (i = 8; i < 16; i++) { - us[i] = format->greenTexel; - } - if (swap) { - for (i = 0; i < 16; i++) - us[i] = (us[i] << 8) | (us[i] >> 8); - } - } - else if (format->bytes == 4) { - GLuint *ui = (GLuint *) texBuffer; - for (i = 0; i < 8; i++) { - ui[i] = format->redTexel; - } - for (i = 8; i < 16; i++) { - ui[i] = format->greenTexel; - } - if (swap) { - for (i = 0; i < 16; i++) { - GLuint b = ui[i]; - ui[i] = (b >> 24) - | ((b >> 8) & 0xff00) - | ((b << 8) & 0xff0000) - | ((b << 24) & 0xff000000); - } - } - } - else { - abort(); - } - - if (Test3D) { - /* 4 x 4 x 4 texture, undefined data */ - glTexImage3D(GL_TEXTURE_3D, 0, intFormat, 4, 4, 4, 0, - format->format, format->type, NULL); - /* fill in Z=1 and Z=2 slices with the real texture data */ - glTexSubImage3D(GL_TEXTURE_3D, 0, - 0, 0, 1, /* offset */ - 4, 4, 1, /* size */ - format->format, format->type, texBuffer); - glTexSubImage3D(GL_TEXTURE_3D, 0, - 0, 0, 2, /* offset */ - 4, 4, 1, /* size */ - format->format, format->type, texBuffer); - } - else { - glTexImage2D(GL_TEXTURE_2D, 0, intFormat, 4, 4, 0, - format->format, format->type, texBuffer); - } - - if (glGetError()) { - printf("GL Error for %s\n", format->name); - memset(texBuffer, 255, 1000); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 0, - GL_RGB, GL_UNSIGNED_BYTE, texBuffer); - } -} - - - -static void -Draw(void) -{ - char s[1000]; - int w = 350, h = 20; - int i, swap; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - for (swap = 0; swap < 2; swap++) { - for (i = 0; Formats[i].name; i++) { - glPushMatrix(); - glTranslatef(swap * (w + 2), i * (h + 2), 0); - - MakeTexture(Formats + i, IntFormats[CurFormat].format, swap); - - if (Test3D) - glEnable(GL_TEXTURE_3D); - else - glEnable(GL_TEXTURE_2D); - glBegin(GL_POLYGON); - glTexCoord3f(0, 0, 0.5); glVertex2f(0, 0); - glTexCoord3f(1, 0, 0.5); glVertex2f(w, 0); - glTexCoord3f(1, 1, 0.5); glVertex2f(w, h); - glTexCoord3f(0, 1, 0.5); glVertex2f(0, h); - glEnd(); - - if (Test3D) - glDisable(GL_TEXTURE_3D); - else - glDisable(GL_TEXTURE_2D); - glColor3f(0, 0, 0); - glRasterPos2i(8, 6); - PrintString(Formats[i].name); - - glPopMatrix(); - } - } - - glPushMatrix(); - glTranslatef(2, i * (h + 2), 0); - glColor3f(1, 1, 1); - glRasterPos2i(8, 6); - PrintString("Normal"); - glRasterPos2i(w + 2, 6); - PrintString("Byte Swapped"); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(2, (i + 1) * (h + 2), 0); - glRasterPos2i(8, 6); - sprintf(s, "Internal Texture Format [f/F]: %s (%d of %d)", - IntFormats[CurFormat].name, CurFormat + 1, NUM_INT_FORMATS); - PrintString(s); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(2, (i + 2) * (h + 2), 0); - glRasterPos2i(8, 6); - if (Test3D) - PrintString("Target [2/3]: GL_TEXTURE_3D"); - else - PrintString("Target [2/3]: GL_TEXTURE_2D"); - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void -Reshape(int width, int height) -{ - glViewport(0, 0, width, height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0, width, 0, height, -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); -} - - -static void -Key(unsigned char key, int x, int y) -{ - (void) x; - (void) y; - switch (key) { - case 'F': - if (CurFormat == 0) - CurFormat = NUM_INT_FORMATS - 1; - else - CurFormat--; - break; - case 'f': - CurFormat++; - if (CurFormat == NUM_INT_FORMATS) - CurFormat = 0; - break; - case '2': - Test3D = GL_FALSE; - break; - case '3': - Test3D = GL_TRUE; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void -Init(void) -{ - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); -} - - -int -main(int argc, char *argv[]) -{ - glutInit(&argc, argv); - glutInitWindowPosition(0, 0); - glutInitWindowSize(700, 800); - glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); - glutCreateWindow(argv[0]); - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Draw); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/pbo.c b/progs/tests/pbo.c deleted file mode 100644 index b31b36cc121..00000000000 --- a/progs/tests/pbo.c +++ /dev/null @@ -1,296 +0,0 @@ -/* - * GL_EXT_pixel_buffer_object test - * - * Brian Paul - * 11 March 2004 - */ - -#define GL_GLEXT_PROTOTYPES - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - -#include "../util/readtex.c" /* a hack, I know */ - -#define IMAGE_FILE "../images/girl.rgb" - -static int ImgWidth, ImgHeight; -static GLenum ImgFormat; -static GLubyte *Image = NULL; - -static int APosX, APosY; /* simple drawpixels */ -static int BPosX, BPosY; /* read/draw pixels */ -static int CPosX, CPosY; /* copypixels */ - -static GLboolean DrawFront = GL_FALSE; -static GLboolean ScaleAndBias = GL_FALSE; -static GLboolean Benchmark = GL_FALSE; - -static GLuint DrawPBO, TempPBO; - - -static GLenum ReadFormat = GL_BGRA; -static GLenum ReadType = GL_UNSIGNED_INT_8_8_8_8_REV; - - - -static void -CheckError(int line) -{ - GLenum err = glGetError(); - if (err) { - printf("GL Error 0x%x at line %d\n", (int) err, line); - } -} - - -static void -Reset( void ) -{ - APosX = 5; APosY = 20; - BPosX = APosX + ImgWidth + 5; BPosY = 20; - CPosX = BPosX + ImgWidth + 5; CPosY = 20; -} - - -static void -PrintString(const char *s) -{ - while (*s) { - glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); - s++; - } -} - - -static void -SetupPixelTransfer(GLboolean invert) -{ - if (invert) { - glPixelTransferf(GL_RED_SCALE, -1.0); - glPixelTransferf(GL_RED_BIAS, 1.0); - glPixelTransferf(GL_GREEN_SCALE, -1.0); - glPixelTransferf(GL_GREEN_BIAS, 1.0); - glPixelTransferf(GL_BLUE_SCALE, -1.0); - glPixelTransferf(GL_BLUE_BIAS, 1.0); - } - else { - glPixelTransferf(GL_RED_SCALE, 1.0); - glPixelTransferf(GL_RED_BIAS, 0.0); - glPixelTransferf(GL_GREEN_SCALE, 1.0); - glPixelTransferf(GL_GREEN_BIAS, 0.0); - glPixelTransferf(GL_BLUE_SCALE, 1.0); - glPixelTransferf(GL_BLUE_BIAS, 0.0); - } -} - - -static void -Display( void ) -{ - glClearColor(.3, .3, .3, 1); - glClear( GL_COLOR_BUFFER_BIT ); - - CheckError(__LINE__); - - /** Unbind UNPACK pixel buffer before calling glBitmap */ - glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0); - - glRasterPos2i(5, ImgHeight+25); - PrintString("f = toggle front/back s = toggle scale/bias b = benchmark"); - - glRasterPos2i(5, ImgHeight+40); - PrintString("GL_EXT_pixel_buffer_object test"); - - /* draw original image */ - glRasterPos2i(APosX, 5); - PrintString("Original"); - glRasterPos2i(APosX, APosY); - glEnable(GL_DITHER); - SetupPixelTransfer(GL_FALSE); - /*** Draw from the DrawPBO */ - glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO); - glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, 0); - glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0); - - CheckError(__LINE__); - - /* do readpixels, drawpixels */ - glRasterPos2i(BPosX, 5); - PrintString("Read/DrawPixels"); - SetupPixelTransfer(ScaleAndBias); - /*** read into the Temp PBO */ - glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, TempPBO); - CheckError(__LINE__); - if (Benchmark) { - GLint reads = 0; - GLint endTime; - GLint startTime = glutGet(GLUT_ELAPSED_TIME); - GLdouble seconds, pixelsPerSecond; - printf("Benchmarking...\n"); - do { - glReadPixels(APosX, APosY, ImgWidth, ImgHeight, - ReadFormat, ReadType, 0); - reads++; - endTime = glutGet(GLUT_ELAPSED_TIME); - } while (endTime - startTime < 4000); /* 4 seconds */ - seconds = (double) (endTime - startTime) / 1000.0; - pixelsPerSecond = reads * ImgWidth * ImgHeight / seconds; - printf("Result: %d reads in %f seconds = %f pixels/sec\n", - reads, seconds, pixelsPerSecond); - Benchmark = GL_FALSE; - } - else { - glReadPixels(APosX, APosY, ImgWidth, ImgHeight, - ReadFormat, ReadType, 0); - } - CheckError(__LINE__); - glRasterPos2i(BPosX, BPosY); - glDisable(GL_DITHER); - SetupPixelTransfer(GL_FALSE); - - CheckError(__LINE__); - - /*** draw from the Temp PBO */ - glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, TempPBO); - glDrawPixels(ImgWidth, ImgHeight, ReadFormat, ReadType, 0); - glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0); - - CheckError(__LINE__); - - /* do copypixels */ - glRasterPos2i(CPosX, 5); - PrintString("CopyPixels"); - glRasterPos2i(CPosX, CPosY); - glDisable(GL_DITHER); - SetupPixelTransfer(ScaleAndBias); - glCopyPixels(APosX, APosY, ImgWidth, ImgHeight, GL_COLOR); - - CheckError(__LINE__); - - if (!DrawFront) - glutSwapBuffers(); - else - glFinish(); -} - - -static void -Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho( 0.0, width, 0.0, height, -1.0, 1.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -} - - -static void -Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'b': - Benchmark = GL_TRUE; - break; - case 's': - ScaleAndBias = !ScaleAndBias; - break; - case 'f': - DrawFront = !DrawFront; - if (DrawFront) { - glDrawBuffer(GL_FRONT); - glReadBuffer(GL_FRONT); - } - else { - glDrawBuffer(GL_BACK); - glReadBuffer(GL_BACK); - } - printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK"); - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void -Init(void) -{ - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - if (!glutExtensionSupported("GL_EXT_pixel_buffer_object")) { - printf("Sorry, this demo requires GL_EXT_pixel_buffer_object\n"); - exit(0); - } - - Image = LoadRGBImage( IMAGE_FILE, &ImgWidth, &ImgHeight, &ImgFormat ); - if (!Image) { - printf("Couldn't read %s\n", IMAGE_FILE); - exit(0); - } - - printf("Loaded %d by %d image\n", ImgWidth, ImgHeight ); - - if (ImgFormat == GL_RGB) { - /* convert to RGBA */ - int i; - GLubyte *image2 = (GLubyte *) malloc(ImgWidth * ImgHeight * 4); - printf("Converting RGB image to RGBA\n"); - for (i = 0; i < ImgWidth * ImgHeight; i++) { - image2[i*4+0] = Image[i*3+0]; - image2[i*4+1] = Image[i*3+1]; - image2[i*4+2] = Image[i*3+2]; - image2[i*4+3] = 255; - } - free(Image); - Image = image2; - ImgFormat = GL_RGBA; - } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glPixelStorei(GL_UNPACK_ROW_LENGTH, ImgWidth); - glPixelStorei(GL_PACK_ALIGNMENT, 1); - glPixelStorei(GL_PACK_ROW_LENGTH, ImgWidth); - - Reset(); - - /* put image into DrawPBO */ - glGenBuffersARB(1, &DrawPBO); - glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO); - glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, - ImgWidth * ImgHeight * 4, Image, GL_STATIC_DRAW); - - /* Setup TempPBO - used for glReadPixels & glDrawPixels */ - glGenBuffersARB(1, &TempPBO); - glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, TempPBO); - glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT, - ImgWidth * ImgHeight * 4, NULL, GL_DYNAMIC_COPY); - -} - - -int -main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 750, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0]); - Init(); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/projtex.c b/progs/tests/projtex.c deleted file mode 100644 index e3ef948ab6a..00000000000 --- a/progs/tests/projtex.c +++ /dev/null @@ -1,1028 +0,0 @@ - -/* projtex.c - by David Yu and David Blythe, SGI */ - -/** - ** Demonstrates simple projective texture mapping. - ** - ** Button1 changes view, Button2 moves texture. - ** - ** (See: Segal, Korobkin, van Widenfelt, Foran, and Haeberli - ** "Fast Shadows and Lighting Effects Using Texture Mapping", SIGGRAPH '92) - ** - ** 1994,1995 -- David G Yu - ** - ** cc -o projtex projtex.c texture.c -lglut -lGLU -lGL -lX11 -lm - **/ - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> -#if 0 -#include "texture.h" -#else -#include "../util/readtex.c" -#endif - - -/* Some <math.h> files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -#define MAX_TEX 4 -int NumTextures = 1; - -int winWidth, winHeight; - -GLboolean redrawContinuously = GL_FALSE; - -float angle, axis[3]; -enum MoveModes { - MoveNone, MoveView, MoveObject, MoveTexture -}; -enum MoveModes mode = MoveNone; - -GLfloat objectXform[4][4]; -GLfloat textureXform[MAX_TEX][4][4]; - -void (*drawObject) (void); -void (*loadTexture) (void); -GLboolean textureEnabled = GL_TRUE; -GLboolean showProjection = GL_TRUE; -GLboolean linearFilter = GL_TRUE; - -char *texFilename[MAX_TEX] = { - "../images/girl.rgb", - "../images/tile.rgb", - "../images/bw.rgb", - "../images/reflect.rgb" -}; - - -GLfloat zoomFactor = 1.0; - -/*****************************************************************/ - - -void ActiveTexture(int i) -{ - glActiveTextureARB(i); -} - - -/* matrix = identity */ -void -matrixIdentity(GLfloat matrix[16]) -{ - matrix[0] = 1.0; - matrix[1] = 0.0; - matrix[2] = 0.0; - matrix[3] = 0.0; - matrix[4] = 0.0; - matrix[5] = 1.0; - matrix[6] = 0.0; - matrix[7] = 0.0; - matrix[8] = 0.0; - matrix[9] = 0.0; - matrix[10] = 1.0; - matrix[11] = 0.0; - matrix[12] = 0.0; - matrix[13] = 0.0; - matrix[14] = 0.0; - matrix[15] = 1.0; -} - -/* matrix2 = transpose(matrix1) */ -void -matrixTranspose(GLfloat matrix2[16], GLfloat matrix1[16]) -{ - matrix2[0] = matrix1[0]; - matrix2[1] = matrix1[4]; - matrix2[2] = matrix1[8]; - matrix2[3] = matrix1[12]; - - matrix2[4] = matrix1[1]; - matrix2[5] = matrix1[5]; - matrix2[6] = matrix1[9]; - matrix2[7] = matrix1[13]; - - matrix2[8] = matrix1[2]; - matrix2[9] = matrix1[6]; - matrix2[10] = matrix1[10]; - matrix2[11] = matrix1[14]; - - matrix2[12] = matrix1[3]; - matrix2[13] = matrix1[7]; - matrix2[14] = matrix1[14]; - matrix2[15] = matrix1[15]; -} - -/*****************************************************************/ - -/* load SGI .rgb image (pad with a border of the specified width and color) */ -#if 0 -static void -imgLoad(char *filenameIn, int borderIn, GLfloat borderColorIn[4], - int *wOut, int *hOut, GLubyte ** imgOut) -{ - int border = borderIn; - int width, height; - int w, h; - GLubyte *image, *img, *p; - int i, j, components; - - image = (GLubyte *) read_texture(filenameIn, &width, &height, &components); - w = width + 2 * border; - h = height + 2 * border; - img = (GLubyte *) calloc(w * h, 4 * sizeof(unsigned char)); - - p = img; - for (j = -border; j < height + border; ++j) { - for (i = -border; i < width + border; ++i) { - if (0 <= j && j <= height - 1 && 0 <= i && i <= width - 1) { - p[0] = image[4 * (j * width + i) + 0]; - p[1] = image[4 * (j * width + i) + 1]; - p[2] = image[4 * (j * width + i) + 2]; - p[3] = 0xff; - } else { - p[0] = borderColorIn[0] * 0xff; - p[1] = borderColorIn[1] * 0xff; - p[2] = borderColorIn[2] * 0xff; - p[3] = borderColorIn[3] * 0xff; - } - p += 4; - } - } - free(image); - *wOut = w; - *hOut = h; - *imgOut = img; -} -#endif - - -/*****************************************************************/ - -/* Load the image file specified on the command line as the current texture */ -void -loadImageTextures(void) -{ - GLfloat borderColor[4] = - {1.0, 1.0, 1.0, 1.0}; - int tex; - - for (tex = 0; tex < NumTextures; tex++) { - GLubyte *image, *texData3, *texData4; - GLint imgWidth, imgHeight; - GLenum imgFormat; - int i, j; - - printf("loading %s\n", texFilename[tex]); - image = LoadRGBImage(texFilename[tex], &imgWidth, &imgHeight, &imgFormat); - if (!image) { - printf("can't find %s\n", texFilename[tex]); - exit(1); - } - assert(imgFormat == GL_RGB); - - /* scale to 256x256 */ - texData3 = malloc(256 * 256 * 4); - texData4 = malloc(256 * 256 * 4); - assert(texData3); - assert(texData4); - gluScaleImage(imgFormat, imgWidth, imgHeight, GL_UNSIGNED_BYTE, image, - 256, 256, GL_UNSIGNED_BYTE, texData3); - - /* convert to rgba */ - for (i = 0; i < 256 * 256; i++) { - texData4[i*4+0] = texData3[i*3+0]; - texData4[i*4+1] = texData3[i*3+1]; - texData4[i*4+2] = texData3[i*3+2]; - texData4[i*4+3] = 128; - } - - /* put transparent border around image */ - for (i = 0; i < 256; i++) { - texData4[i*4+0] = 255; - texData4[i*4+1] = 255; - texData4[i*4+2] = 255; - texData4[i*4+3] = 0; - } - j = 256 * 255 * 4; - for (i = 0; i < 256; i++) { - texData4[j + i*4+0] = 255; - texData4[j + i*4+1] = 255; - texData4[j + i*4+2] = 255; - texData4[j + i*4+3] = 0; - } - for (i = 0; i < 256; i++) { - j = i * 256 * 4; - texData4[j+0] = 255; - texData4[j+1] = 255; - texData4[j+2] = 255; - texData4[j+3] = 0; - } - for (i = 0; i < 256; i++) { - j = i * 256 * 4 + 255 * 4; - texData4[j+0] = 255; - texData4[j+1] = 255; - texData4[j+2] = 255; - texData4[j+3] = 0; - } - - ActiveTexture(GL_TEXTURE0_ARB + tex); - glBindTexture(GL_TEXTURE_2D, tex + 1); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, - GL_RGBA, GL_UNSIGNED_BYTE, texData4); - - if (linearFilter) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor); - } -} - -/* Create a simple spotlight pattern and make it the current texture */ -void -loadSpotlightTexture(void) -{ - static int texWidth = 64, texHeight = 64; - static GLubyte *texData; - GLfloat borderColor[4] = - {0.1, 0.1, 0.1, 1.0}; - - if (!texData) { - GLubyte *p; - int i, j; - - texData = (GLubyte *) malloc(texWidth * texHeight * 4 * sizeof(GLubyte)); - - p = texData; - for (j = 0; j < texHeight; ++j) { - float dy = (texHeight * 0.5 - j + 0.5) / (texHeight * 0.5); - - for (i = 0; i < texWidth; ++i) { - float dx = (texWidth * 0.5 - i + 0.5) / (texWidth * 0.5); - float r = cos(M_PI / 2.0 * sqrt(dx * dx + dy * dy)); - float c; - - r = (r < 0) ? 0 : r * r; - c = 0xff * (r + borderColor[0]); - p[0] = (c <= 0xff) ? c : 0xff; - c = 0xff * (r + borderColor[1]); - p[1] = (c <= 0xff) ? c : 0xff; - c = 0xff * (r + borderColor[2]); - p[2] = (c <= 0xff) ? c : 0xff; - c = 0xff * (r + borderColor[3]); - p[3] = (c <= 0xff) ? c : 0xff; - p += 4; - } - } - } - if (linearFilter) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor); - gluBuild2DMipmaps(GL_TEXTURE_2D, 4, texWidth, texHeight, - GL_RGBA, GL_UNSIGNED_BYTE, texData); -} - -/*****************************************************************/ - -void -checkErrors(void) -{ - GLenum error; - while ((error = glGetError()) != GL_NO_ERROR) { - fprintf(stderr, "Error: %s\n", (char *) gluErrorString(error)); - } -} - -void -drawCube(void) -{ - glBegin(GL_QUADS); - - glNormal3f(-1.0, 0.0, 0.0); - glColor3f(0.80, 0.50, 0.50); - glVertex3f(-0.5, -0.5, -0.5); - glVertex3f(-0.5, -0.5, 0.5); - glVertex3f(-0.5, 0.5, 0.5); - glVertex3f(-0.5, 0.5, -0.5); - - glNormal3f(1.0, 0.0, 0.0); - glColor3f(0.50, 0.80, 0.50); - glVertex3f(0.5, 0.5, 0.5); - glVertex3f(0.5, -0.5, 0.5); - glVertex3f(0.5, -0.5, -0.5); - glVertex3f(0.5, 0.5, -0.5); - - glNormal3f(0.0, -1.0, 0.0); - glColor3f(0.50, 0.50, 0.80); - glVertex3f(-0.5, -0.5, -0.5); - glVertex3f(0.5, -0.5, -0.5); - glVertex3f(0.5, -0.5, 0.5); - glVertex3f(-0.5, -0.5, 0.5); - - glNormal3f(0.0, 1.0, 0.0); - glColor3f(0.50, 0.80, 0.80); - glVertex3f(0.5, 0.5, 0.5); - glVertex3f(0.5, 0.5, -0.5); - glVertex3f(-0.5, 0.5, -0.5); - glVertex3f(-0.5, 0.5, 0.5); - - glNormal3f(0.0, 0.0, -1.0); - glColor3f(0.80, 0.50, 0.80); - glVertex3f(-0.5, -0.5, -0.5); - glVertex3f(-0.5, 0.5, -0.5); - glVertex3f(0.5, 0.5, -0.5); - glVertex3f(0.5, -0.5, -0.5); - - glNormal3f(0.0, 0.0, 1.0); - glColor3f(1.00, 0.80, 0.50); - glVertex3f(0.5, 0.5, 0.5); - glVertex3f(-0.5, 0.5, 0.5); - glVertex3f(-0.5, -0.5, 0.5); - glVertex3f(0.5, -0.5, 0.5); - glEnd(); -} - -void -drawDodecahedron(void) -{ -#define A (0.5 * 1.61803) /* (sqrt(5) + 1) / 2 */ -#define B (0.5 * 0.61803) /* (sqrt(5) - 1) / 2 */ -#define C (0.5 * 1.0) - GLfloat vertexes[20][3] = - { - {-A, 0.0, B}, - {-A, 0.0, -B}, - {A, 0.0, -B}, - {A, 0.0, B}, - {B, -A, 0.0}, - {-B, -A, 0.0}, - {-B, A, 0.0}, - {B, A, 0.0}, - {0.0, B, -A}, - {0.0, -B, -A}, - {0.0, -B, A}, - {0.0, B, A}, - {-C, -C, C}, - {-C, -C, -C}, - {C, -C, -C}, - {C, -C, C}, - {-C, C, C}, - {-C, C, -C}, - {C, C, -C}, - {C, C, C}, - }; -#undef A -#undef B -#undef C - GLint polygons[12][5] = - { - {0, 12, 10, 11, 16}, - {1, 17, 8, 9, 13}, - {2, 14, 9, 8, 18}, - {3, 19, 11, 10, 15}, - {4, 14, 2, 3, 15}, - {5, 12, 0, 1, 13}, - {6, 17, 1, 0, 16}, - {7, 19, 3, 2, 18}, - {8, 17, 6, 7, 18}, - {9, 14, 4, 5, 13}, - {10, 12, 5, 4, 15}, - {11, 19, 7, 6, 16}, - }; - int i; - - glColor3f(0.75, 0.75, 0.75); - for (i = 0; i < 12; ++i) { - GLfloat *p0, *p1, *p2, d; - GLfloat u[3], v[3], n[3]; - - p0 = &vertexes[polygons[i][0]][0]; - p1 = &vertexes[polygons[i][1]][0]; - p2 = &vertexes[polygons[i][2]][0]; - - u[0] = p2[0] - p1[0]; - u[1] = p2[1] - p1[1]; - u[2] = p2[2] - p1[2]; - - v[0] = p0[0] - p1[0]; - v[1] = p0[1] - p1[1]; - v[2] = p0[2] - p1[2]; - - n[0] = u[1] * v[2] - u[2] * v[1]; - n[1] = u[2] * v[0] - u[0] * v[2]; - n[2] = u[0] * v[1] - u[1] * v[0]; - - d = 1.0 / sqrt(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]); - n[0] *= d; - n[1] *= d; - n[2] *= d; - - glBegin(GL_POLYGON); - glNormal3fv(n); - glVertex3fv(p0); - glVertex3fv(p1); - glVertex3fv(p2); - glVertex3fv(vertexes[polygons[i][3]]); - glVertex3fv(vertexes[polygons[i][4]]); - glEnd(); - } -} - -void -drawSphere(void) -{ - int numMajor = 24; - int numMinor = 32; - float radius = 0.8; - double majorStep = (M_PI / numMajor); - double minorStep = (2.0 * M_PI / numMinor); - int i, j; - - glColor3f(0.50, 0.50, 0.50); - for (i = 0; i < numMajor; ++i) { - double a = i * majorStep; - double b = a + majorStep; - double r0 = radius * sin(a); - double r1 = radius * sin(b); - GLfloat z0 = radius * cos(a); - GLfloat z1 = radius * cos(b); - - glBegin(GL_TRIANGLE_STRIP); - for (j = 0; j <= numMinor; ++j) { - double c = j * minorStep; - GLfloat x = cos(c); - GLfloat y = sin(c); - - glNormal3f((x * r0) / radius, (y * r0) / radius, z0 / radius); - glTexCoord2f(j / (GLfloat) numMinor, i / (GLfloat) numMajor); - glVertex3f(x * r0, y * r0, z0); - - glNormal3f((x * r1) / radius, (y * r1) / radius, z1 / radius); - glTexCoord2f(j / (GLfloat) numMinor, (i + 1) / (GLfloat) numMajor); - glVertex3f(x * r1, y * r1, z1); - } - glEnd(); - } -} - -/*****************************************************************/ - -float xmin = -0.035, xmax = 0.035; -float ymin = -0.035, ymax = 0.035; -float nnear = 0.1; -float ffar = 1.9; -float distance = -1.0; - -static void -loadTextureProjection(int texUnit, GLfloat m[16]) -{ - GLfloat mInverse[4][4]; - - /* Should use true inverse, but since m consists only of rotations, we can - just use the transpose. */ - matrixTranspose((GLfloat *) mInverse, m); - - ActiveTexture(GL_TEXTURE0_ARB + texUnit); - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glTranslatef(0.5, 0.5, 0.0); - glScalef(0.5, 0.5, 1.0); - glFrustum(xmin, xmax, ymin, ymax, nnear, ffar); - glTranslatef(0.0, 0.0, distance); - glMultMatrixf((GLfloat *) mInverse); - glMatrixMode(GL_MODELVIEW); -} - -static void -drawTextureProjection(void) -{ - float t = ffar / nnear; - GLfloat n[4][3]; - GLfloat f[4][3]; - - n[0][0] = xmin; - n[0][1] = ymin; - n[0][2] = -(nnear + distance); - - n[1][0] = xmax; - n[1][1] = ymin; - n[1][2] = -(nnear + distance); - - n[2][0] = xmax; - n[2][1] = ymax; - n[2][2] = -(nnear + distance); - - n[3][0] = xmin; - n[3][1] = ymax; - n[3][2] = -(nnear + distance); - - f[0][0] = xmin * t; - f[0][1] = ymin * t; - f[0][2] = -(ffar + distance); - - f[1][0] = xmax * t; - f[1][1] = ymin * t; - f[1][2] = -(ffar + distance); - - f[2][0] = xmax * t; - f[2][1] = ymax * t; - f[2][2] = -(ffar + distance); - - f[3][0] = xmin * t; - f[3][1] = ymax * t; - f[3][2] = -(ffar + distance); - - glColor3f(1.0, 1.0, 0.0); - glBegin(GL_LINE_LOOP); - glVertex3fv(n[0]); - glVertex3fv(n[1]); - glVertex3fv(n[2]); - glVertex3fv(n[3]); - glVertex3fv(f[3]); - glVertex3fv(f[2]); - glVertex3fv(f[1]); - glVertex3fv(f[0]); - glVertex3fv(n[0]); - glVertex3fv(n[1]); - glVertex3fv(f[1]); - glVertex3fv(f[0]); - glVertex3fv(f[3]); - glVertex3fv(f[2]); - glVertex3fv(n[2]); - glVertex3fv(n[3]); - glEnd(); -} - -/*****************************************************************/ - -void -initialize(void) -{ - GLfloat light0Pos[4] = - {0.3, 0.3, 0.0, 1.0}; - GLfloat matAmb[4] = - {0.01, 0.01, 0.01, 1.00}; - GLfloat matDiff[4] = - {0.65, 0.65, 0.65, 1.00}; - GLfloat matSpec[4] = - {0.30, 0.30, 0.30, 1.00}; - GLfloat matShine = 10.0; - GLfloat eyePlaneS[] = - {1.0, 0.0, 0.0, 0.0}; - GLfloat eyePlaneT[] = - {0.0, 1.0, 0.0, 0.0}; - GLfloat eyePlaneR[] = - {0.0, 0.0, 1.0, 0.0}; - GLfloat eyePlaneQ[] = - {0.0, 0.0, 0.0, 1.0}; - int i; - - /* Setup Misc. */ - glClearColor(0.41, 0.41, 0.31, 0.0); - - glEnable(GL_DEPTH_TEST); - - /* glLineWidth(2.0);*/ - - glCullFace(GL_FRONT); - glEnable(GL_CULL_FACE); - - glMatrixMode(GL_PROJECTION); - glFrustum(-0.5, 0.5, -0.5, 0.5, 1, 3); - glMatrixMode(GL_MODELVIEW); - glTranslatef(0, 0, -2); - - matrixIdentity((GLfloat *) objectXform); - for (i = 0; i < NumTextures; i++) { - matrixIdentity((GLfloat *) textureXform[i]); - } - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glOrtho(0, 1, 0, 1, -1, 1); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - - glRasterPos2i(0, 0); - - glPopMatrix(); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - - /* Setup Lighting */ - glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, matAmb); - glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, matDiff); - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, matSpec); - glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, matShine); - - glEnable(GL_COLOR_MATERIAL); - - glLightfv(GL_LIGHT0, GL_POSITION, light0Pos); - glEnable(GL_LIGHT0); - - glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); - glEnable(GL_LIGHTING); - - /* Setup Texture */ - - (*loadTexture) (); - - - for (i = 0; i < NumTextures; i++) { - ActiveTexture(GL_TEXTURE0_ARB + i); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); - glTexGenfv(GL_S, GL_EYE_PLANE, eyePlaneS); - - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); - glTexGenfv(GL_T, GL_EYE_PLANE, eyePlaneT); - - glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); - glTexGenfv(GL_R, GL_EYE_PLANE, eyePlaneR); - - glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); - glTexGenfv(GL_Q, GL_EYE_PLANE, eyePlaneQ); - } -} - -void -display(void) -{ - int i; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - if (textureEnabled) { - if (mode == MoveTexture || mode == MoveView) { - /* Have OpenGL compute the new transformation (simple but slow). */ - for (i = 0; i < NumTextures; i++) { - glPushMatrix(); - glLoadIdentity(); -#if 0 - if (i & 1) - glRotatef(angle, axis[0], axis[1], axis[2]); - else -#endif - glRotatef(angle*(i+1), axis[0], axis[1], axis[2]); - - glMultMatrixf((GLfloat *) textureXform[i]); - glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat *) textureXform[i]); - glPopMatrix(); - } - } - for (i = 0; i < NumTextures; i++) { - loadTextureProjection(i, (GLfloat *) textureXform[i]); - } - - if (showProjection) { - for (i = 0; i < NumTextures; i++) { - ActiveTexture(GL_TEXTURE0_ARB + i); - glPushMatrix(); - glMultMatrixf((GLfloat *) textureXform[i]); - glDisable(GL_LIGHTING); - drawTextureProjection(); - glEnable(GL_LIGHTING); - glPopMatrix(); - } - } - for (i = 0; i < NumTextures; i++) { - ActiveTexture(GL_TEXTURE0_ARB + i); - glEnable(GL_TEXTURE_2D); - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - glEnable(GL_TEXTURE_GEN_R); - glEnable(GL_TEXTURE_GEN_Q); - } - } - if (mode == MoveObject || mode == MoveView) { - /* Have OpenGL compute the new transformation (simple but slow). */ - glPushMatrix(); - glLoadIdentity(); - glRotatef(angle, axis[0], axis[1], axis[2]); - glMultMatrixf((GLfloat *) objectXform); - glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat *) objectXform); - glPopMatrix(); - } - glPushMatrix(); - glMultMatrixf((GLfloat *) objectXform); - (*drawObject) (); - glPopMatrix(); - - for (i = 0; i < NumTextures; i++) { - ActiveTexture(GL_TEXTURE0_ARB + i); - glDisable(GL_TEXTURE_2D); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - glDisable(GL_TEXTURE_GEN_R); - glDisable(GL_TEXTURE_GEN_Q); - } - - if (zoomFactor > 1.0) { - glDisable(GL_DEPTH_TEST); - glCopyPixels(0, 0, winWidth / zoomFactor, winHeight / zoomFactor, GL_COLOR); - glEnable(GL_DEPTH_TEST); - } - glFlush(); - glutSwapBuffers(); - checkErrors(); -} - -/*****************************************************************/ - -/* simple trackball-like motion control */ -float lastPos[3]; -int lastTime; - -void -ptov(int x, int y, int width, int height, float v[3]) -{ - float d, a; - - /* project x,y onto a hemi-sphere centered within width, height */ - v[0] = (2.0 * x - width) / width; - v[1] = (height - 2.0 * y) / height; - d = sqrt(v[0] * v[0] + v[1] * v[1]); - v[2] = cos((M_PI / 2.0) * ((d < 1.0) ? d : 1.0)); - a = 1.0 / sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); - v[0] *= a; - v[1] *= a; - v[2] *= a; -} - -void -startMotion(int x, int y, int but, int time) -{ - if (but == GLUT_LEFT_BUTTON) { - mode = MoveView; - } else if (but == GLUT_MIDDLE_BUTTON) { - mode = MoveTexture; - } else { - return; - } - - lastTime = time; - ptov(x, y, winWidth, winHeight, lastPos); -} - -void -animate(void) -{ - glutPostRedisplay(); -} - -void -vis(int visible) -{ - if (visible == GLUT_VISIBLE) { - if (redrawContinuously) - glutIdleFunc(animate); - } else { - if (redrawContinuously) - glutIdleFunc(NULL); - } -} - -void -stopMotion(int but, int time) -{ - if ((but == GLUT_LEFT_BUTTON && mode == MoveView) || - (but == GLUT_MIDDLE_BUTTON && mode == MoveTexture)) { - } else { - return; - } - - if (time == lastTime) { - /* redrawContinuously = GL_TRUE;*/ - glutIdleFunc(animate); - } else { - angle = 0.0; - redrawContinuously = GL_FALSE; - glutIdleFunc(0); - } - if (!redrawContinuously) { - mode = MoveNone; - } -} - -void -trackMotion(int x, int y) -{ - float curPos[3], dx, dy, dz; - - ptov(x, y, winWidth, winHeight, curPos); - - dx = curPos[0] - lastPos[0]; - dy = curPos[1] - lastPos[1]; - dz = curPos[2] - lastPos[2]; - angle = 90.0 * sqrt(dx * dx + dy * dy + dz * dz); - - axis[0] = lastPos[1] * curPos[2] - lastPos[2] * curPos[1]; - axis[1] = lastPos[2] * curPos[0] - lastPos[0] * curPos[2]; - axis[2] = lastPos[0] * curPos[1] - lastPos[1] * curPos[0]; - - lastTime = glutGet(GLUT_ELAPSED_TIME); - lastPos[0] = curPos[0]; - lastPos[1] = curPos[1]; - lastPos[2] = curPos[2]; - glutPostRedisplay(); -} - -/*****************************************************************/ - -void -object(void) -{ - static int object; - - object++; - object %= 3; - switch (object) { - case 0: - drawObject = drawCube; - break; - case 1: - drawObject = drawDodecahedron; - break; - case 2: - drawObject = drawSphere; - break; - default: - break; - } -} - -static void -nop(void) -{ -} - -void -texture(void) -{ - static int texture = 0; - - texture++; - texture %= 3; - if (texture == 1 && texFilename == NULL) { - /* Skip file texture if not loaded. */ - texture++; - } - switch (texture) { - case 0: - loadTexture = nop; - textureEnabled = GL_FALSE; - break; - case 1: - loadTexture = loadImageTextures; - (*loadTexture) (); - textureEnabled = GL_TRUE; - break; - case 2: - loadTexture = loadSpotlightTexture; - (*loadTexture) (); - textureEnabled = GL_TRUE; - break; - default: - break; - } -} - -void -help(void) -{ - printf("'h' - help\n"); - printf("'l' - toggle linear/nearest filter\n"); - printf("'s' - toggle projection frustum\n"); - printf("'t' - toggle projected texture\n"); - printf("'o' - toggle object\n"); - printf("'z' - increase zoom factor\n"); - printf("'Z' - decrease zoom factor\n"); - printf("left mouse - move view\n"); - printf("middle mouse - move projection\n"); -} - -/* ARGSUSED1 */ -void -key(unsigned char key, int x, int y) -{ - switch (key) { - case '\033': - exit(0); - break; - case 'l': - linearFilter = !linearFilter; - (*loadTexture) (); - break; - case 's': - showProjection = !showProjection; - break; - case 't': - texture(); - break; - case 'o': - object(); - break; - case 'z': - zoomFactor += 1.0; - glPixelZoom(zoomFactor, zoomFactor); - glViewport(0, 0, winWidth / zoomFactor, winHeight / zoomFactor); - break; - case 'Z': - zoomFactor -= 1.0; - if (zoomFactor < 1.0) - zoomFactor = 1.0; - glPixelZoom(zoomFactor, zoomFactor); - glViewport(0, 0, winWidth / zoomFactor, winHeight / zoomFactor); - break; - case 'h': - help(); - break; - } - glutPostRedisplay(); -} - -void -mouse(int button, int state, int x, int y) -{ - if (state == GLUT_DOWN) - startMotion(x, y, button, glutGet(GLUT_ELAPSED_TIME)); - else if (state == GLUT_UP) - stopMotion(button, glutGet(GLUT_ELAPSED_TIME)); - glutPostRedisplay(); -} - -void -reshape(int w, int h) -{ - winWidth = w; - winHeight = h; - glViewport(0, 0, w / zoomFactor, h / zoomFactor); -} - - -void -menu(int selection) -{ - if (selection == 666) { - exit(0); - } - key((unsigned char) selection, 0, 0); -} - -int -main(int argc, char **argv) -{ - glutInit(&argc, argv); - - if (argc > 1) { - NumTextures = atoi(argv[1]); - } - assert(NumTextures <= MAX_TEX); - - glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE); - (void) glutCreateWindow("projtex"); - - loadTexture = loadImageTextures; - drawObject = drawCube; - initialize(); - glutDisplayFunc(display); - glutKeyboardFunc(key); - glutReshapeFunc(reshape); - glutMouseFunc(mouse); - glutMotionFunc(trackMotion); - glutVisibilityFunc(vis); - glutCreateMenu(menu); - glutAddMenuEntry("Toggle showing projection", 's'); - glutAddMenuEntry("Switch texture", 't'); - glutAddMenuEntry("Switch object", 'o'); - glutAddMenuEntry("Toggle filtering", 'l'); - glutAddMenuEntry("Quit", 666); - glutAttachMenu(GLUT_RIGHT_BUTTON); - texture(); - glutMainLoop(); - return 0; /* ANSI C requires main to return int. */ -} diff --git a/progs/tests/readrate.c b/progs/tests/readrate.c deleted file mode 100644 index 42ae62d48a9..00000000000 --- a/progs/tests/readrate.c +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Test glReadPixels speed - * Brian Paul - * 9 April 2004 - * - * Compile: - * gcc readrate.c -L/usr/X11R6/lib -lglut -lGLU -lGL -lX11 -o readrate - */ - -#define GL_GLEXT_PROTOTYPES -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - -/* Hack, to test drawing instead of reading */ -#define DRAW 0 - -#define MAX_WIDTH 1280 -#define MAX_HEIGHT 1024 - -#define NUM_WIDTHS 4 -#define NUM_HEIGHTS 4 -static const GLint Widths[] = {256, 512, 1024, 1280}; -static const GLint Heights[] = {4, 32, 256, 512, 768, 1024}; -static int WidthIndex = 1, HeightIndex = 3; -static GLubyte *Buffer = NULL; -static GLboolean Benchmark = GL_TRUE; - -#define NUM_PBO 2 - -static GLuint PBObjects[4]; - -static GLboolean HavePBO = GL_FALSE; - - -struct format_type { - const char *Name; - GLuint Bytes; - GLenum Format; - GLenum Type; -}; - -static struct format_type Formats[] = { - { "GL_RGB, GLubyte", 3, GL_RGB, GL_UNSIGNED_BYTE }, - { "GL_BGR, GLubyte", 3, GL_BGR, GL_UNSIGNED_BYTE }, - { "GL_RGBA, GLubyte", 4, GL_RGBA, GL_UNSIGNED_BYTE }, - { "GL_BGRA, GLubyte", 4, GL_BGRA, GL_UNSIGNED_BYTE }, - { "GL_ABGR, GLubyte", 4, GL_ABGR_EXT, GL_UNSIGNED_BYTE }, - { "GL_RGBA, GLuint_8_8_8_8", 4, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8 }, - { "GL_BGRA, GLuint_8_8_8_8", 4, GL_BGRA_EXT, GL_UNSIGNED_INT_8_8_8_8 }, - { "GL_BGRA, GLuint_8_8_8_8_rev", 4, GL_BGRA_EXT, GL_UNSIGNED_INT_8_8_8_8_REV }, -#ifdef GL_EXT_packed_depth_stencil - { "GL_DEPTH_STENCIL_EXT, GLuint24+8", 4, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT }, -#endif - { "GL_DEPTH_COMPONENT, GLfloat", 4, GL_DEPTH_COMPONENT, GL_FLOAT }, - { "GL_DEPTH_COMPONENT, GLuint", 4, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT } -}; - -#define NUM_FORMATS (sizeof(Formats) / sizeof(struct format_type)) - - -static void -PrintString(const char *s) -{ - while (*s) { - glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); - s++; - } -} - - -static void -MeasureFormat(struct format_type *fmt, GLint width, GLint height, GLuint pbo) -{ - double t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001; - double t1; - int j; - - for (j = 0; ; j++) { - - glBegin(GL_POINTS); - glVertex2f(1,1); - glEnd(); - -#if DRAW - glWindowPos2iARB(0,0); - glDrawPixels(width, height, - fmt->Format, fmt->Type, Buffer); - glFinish(); -#else - if (pbo) { - glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, PBObjects[j % NUM_PBO]); - glReadPixels(0, 0, width, height, - fmt->Format, fmt->Type, 0); - } - else { - glReadPixels(0, 0, width, height, - fmt->Format, fmt->Type, Buffer); - } -#endif - - t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001; - if (t1 - t0 > 2.0) { - GLdouble rate = width * height / (1024.0 * 1024.0) * j / (t1 - t0); -#if DRAW - printf("%-32s %.2f draws/sec %.2f MPixels/sec %.2f MBytes/sec\n", - fmt->Name, j / (t1-t0), rate, rate * fmt->Bytes); -#else - printf("%-32s %.2f reads/sec %.2f MPixels/sec %.2f MBytes/sec\n", - fmt->Name, j / (t1-t0), rate, rate * fmt->Bytes); -#endif - break; - } - - if (j == 0) { - /* check for error */ - GLenum err = glGetError(); - if (err) { - printf("GL Error 0x%x for %s\n", err, fmt->Name); - return; - } - } - } -} - - - -static void -Draw(void) -{ - char str[1000]; - int width = Widths[WidthIndex]; - int height = Heights[HeightIndex]; - int y = MAX_HEIGHT - 50; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glWindowPos2iARB(10, y); - sprintf(str, "ReadPixels size: %d x %d", width, height); - PrintString(str); - y -= 14; - - glWindowPos2iARB(10, y); - PrintString("Press up/down/left/right to change image size."); - y -= 14; - - glWindowPos2iARB(10, y); - PrintString("Press 'b' to run benchmark test."); - y -= 14; - - if (Benchmark) { - glWindowPos2iARB(10, y); - PrintString("Testing..."); - } - - glutSwapBuffers(); - - if (Benchmark) { - GLuint i, pbo; -#if DRAW - printf("Draw size: Width=%d Height=%d\n", width, height); -#else - printf("Read size: Width=%d Height=%d\n", width, height); -#endif - for (pbo = 0; pbo <= HavePBO; pbo++) { - printf("Pixel Buffer Object: %d\n", pbo); - - if (pbo == 0) { - glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, 0); - } - - for (i = 0; i < NUM_FORMATS; i++) { - MeasureFormat(Formats + i, width, height, pbo); - } - } - - Benchmark = GL_FALSE; - - /* redraw window text */ - glutPostRedisplay(); - } - -} - - -static void -Reshape(int width, int height) -{ - glViewport(0, 0, width, height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1, 1, -1, 1, -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); -} - - -static void -Key(unsigned char key, int x, int y) -{ - (void) x; - (void) y; - switch (key) { - case 'b': - Benchmark = 1; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void -SpecialKey(int key, int x, int y) -{ - (void) x; - (void) y; - switch (key) { - case GLUT_KEY_UP: - if (HeightIndex + 1 < NUM_WIDTHS) - HeightIndex++; - break; - case GLUT_KEY_DOWN: - if (HeightIndex > 0) - HeightIndex--; - break; - case GLUT_KEY_LEFT: - if (WidthIndex > 0) - WidthIndex--; - break; - case GLUT_KEY_RIGHT: - if (WidthIndex + 1 < NUM_HEIGHTS) - WidthIndex++; - break; - } - glutPostRedisplay(); -} - - -static void -Init(void) -{ - Buffer = malloc(MAX_WIDTH * MAX_HEIGHT * 4); - assert(Buffer); -#if DRAW - printf("glDrawPixels test report:\n"); -#else - printf("glReadPixels test report:\n"); -#endif - printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION: %s\n", (char *) glGetString(GL_VERSION)); - - if (glutExtensionSupported("GL_ARB_pixel_buffer_object")) { - int i; - HavePBO = 1; - glGenBuffersARB(NUM_PBO, PBObjects); - for (i = 0; i < NUM_PBO; i++) { - glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, PBObjects[i]); - glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT, - MAX_WIDTH * MAX_HEIGHT * 4, NULL, GL_STREAM_READ); - } - } -} - - -int -main(int argc, char *argv[]) -{ - glutInit(&argc, argv); - glutInitWindowPosition(0, 0); - glutInitWindowSize(MAX_WIDTH, MAX_HEIGHT); - glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL); - glutCreateWindow(argv[0]); - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutSpecialFunc(SpecialKey); - glutDisplayFunc(Draw); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/seccolor.c b/progs/tests/seccolor.c deleted file mode 100644 index 77fd40647ba..00000000000 --- a/progs/tests/seccolor.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Exercise GL_EXT_secondary_color - */ - - -#define GL_GLEXT_PROTOTYPES -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - -static int Width = 600; -static int Height = 200; -static GLfloat Near = 5.0, Far = 25.0; - - -static void Display( void ) -{ - GLfloat t; - - glClearColor(0.2, 0.2, 0.8, 0); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - for (t = 0.0; t <= 1.0; t += 0.25) { - GLfloat x = t * 10.0 - 5.0; - GLfloat g = t; - - /* top row: untextured */ - glColor3f(1, 0, 0); - glPushMatrix(); - glTranslatef(x, 1.2, 0); -#if defined(GL_EXT_secondary_color) - glSecondaryColor3fEXT(0, g, 0); -#endif - glBegin(GL_POLYGON); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - glPopMatrix(); - - /* bottom row: textured */ - glColor3f(1, 1, 1); - glEnable(GL_TEXTURE_2D); - glPushMatrix(); - glTranslatef(x, -1.2, 0); -#if defined(GL_EXT_secondary_color) - glSecondaryColor3fEXT(0, g, 0); -#endif - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); glVertex2f(-1, -1); - glTexCoord2f(1, 0); glVertex2f( 1, -1); - glTexCoord2f(1, 1); glVertex2f( 1, 1); - glTexCoord2f(0, 1); glVertex2f(-1, 1); - glEnd(); - glPopMatrix(); - glDisable(GL_TEXTURE_2D); - } - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / (float) height; - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, Near, Far ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - GLubyte image[4*4][3]; - GLint i; - if (!glutExtensionSupported("GL_EXT_secondary_color")) { - printf("Sorry, this program requires GL_EXT_secondary_color\n"); - exit(1); - } - - /* setup red texture with one back texel */ - for (i = 0; i < 4*4; i++) { - if (i == 0) { - image[i][0] = 0; - image[i][1] = 0; - image[i][2] = 0; - } - else { - image[i][0] = 255; - image[i][1] = 0; - image[i][2] = 0; - } - } - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 0, - GL_RGB, GL_UNSIGNED_BYTE, image); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - -#if defined(GL_EXT_secondary_color) - glEnable(GL_COLOR_SUM_EXT); -#endif - glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); - - printf("Squares should be colored from red -> orange -> yellow.\n"); - printf("Top row is untextured.\n"); - printf("Bottom row is textured (red texture with one black texel).\n"); - printf("Rows should be identical, except for lower-left texel.\n"); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/sharedtex.c b/progs/tests/sharedtex.c deleted file mode 100644 index c3eef95fb35..00000000000 --- a/progs/tests/sharedtex.c +++ /dev/null @@ -1,438 +0,0 @@ -/* $Id: sharedtex.c,v 1.2 2002-01-16 14:32:46 joukj Exp $ */ - -/* - * Test sharing of display lists and texture objects between GLX contests. - * Brian Paul - * Summer 2000 - * - * - * Copyright (C) 2000 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. - */ - - -#include <GL/gl.h> -#include <GL/glx.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> - - -struct window { - char DisplayName[1000]; - Display *Dpy; - Window Win; - GLXContext Context; - float Angle; - int Id; -}; - - -#define MAX_WINDOWS 20 -static struct window Windows[MAX_WINDOWS]; -static int NumWindows = 0; - - -static GLuint Textures[3]; -static GLuint CubeList; - - - -static void -Error(const char *display, const char *msg) -{ - fprintf(stderr, "Error on display %s - %s\n", display, msg); - exit(1); -} - - -static struct window * -AddWindow(const char *displayName, int xpos, int ypos, - const struct window *shareWindow) -{ - Display *dpy; - Window win; - GLXContext ctx; - int attrib[] = { GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DOUBLEBUFFER, - GLX_DEPTH_SIZE, 1, - None }; - int scrnum; - XSetWindowAttributes attr; - unsigned long mask; - Window root; - XVisualInfo *visinfo; - int width = 300, height = 300; - - if (NumWindows >= MAX_WINDOWS) - return NULL; - - dpy = XOpenDisplay(displayName); - if (!dpy) { - Error(displayName, "Unable to open display"); - return NULL; - } - - scrnum = DefaultScreen(dpy); - root = RootWindow(dpy, scrnum); - - visinfo = glXChooseVisual(dpy, scrnum, attrib); - if (!visinfo) { - Error(displayName, "Unable to find RGB, double-buffered visual"); - return NULL; - } - - /* window attributes */ - attr.background_pixel = 0; - attr.border_pixel = 0; - attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone); - attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask; - mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - - win = XCreateWindow(dpy, root, xpos, ypos, width, height, - 0, visinfo->depth, InputOutput, - visinfo->visual, mask, &attr); - if (!win) { - Error(displayName, "Couldn't create window"); - return NULL; - } - - { - XSizeHints sizehints; - sizehints.x = xpos; - sizehints.y = ypos; - sizehints.width = width; - sizehints.height = height; - sizehints.flags = USSize | USPosition; - XSetNormalHints(dpy, win, &sizehints); - XSetStandardProperties(dpy, win, displayName, displayName, - None, (char **)NULL, 0, &sizehints); - } - - - ctx = glXCreateContext(dpy, visinfo, - shareWindow ? shareWindow->Context : NULL, - True); - if (!ctx) { - Error(displayName, "Couldn't create GLX context"); - return NULL; - } - - XMapWindow(dpy, win); - - if (!glXMakeCurrent(dpy, win, ctx)) { - Error(displayName, "glXMakeCurrent failed"); - printf("glXMakeCurrent failed in Redraw()\n"); - return NULL; - } - - /* save the info for this window */ - { - static int id = 0; - struct window *h = &Windows[NumWindows]; - strcpy(h->DisplayName, displayName); - h->Dpy = dpy; - h->Win = win; - h->Context = ctx; - h->Angle = 0.0; - h->Id = id++; - NumWindows++; - return &Windows[NumWindows-1]; - } - -} - - -static void -InitGLstuff(struct window *h) -{ - if (!glXMakeCurrent(h->Dpy, h->Win, h->Context)) { - Error(h->DisplayName, "glXMakeCurrent failed in InitGLstuff"); - return; - } - - glGenTextures(3, Textures); - - /* setup first texture object */ - { - GLubyte image[16][16][4]; - GLint i, j; - glBindTexture(GL_TEXTURE_2D, Textures[0]); - - /* red/white checkerboard */ - for (i = 0; i < 16; i++) { - for (j = 0; j < 16; j++) { - if ((i ^ j) & 1) { - image[i][j][0] = 255; - image[i][j][1] = 255; - image[i][j][2] = 255; - image[i][j][3] = 255; - } - else { - image[i][j][0] = 255; - image[i][j][1] = 0; - image[i][j][2] = 0; - image[i][j][3] = 255; - } - } - } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, - GL_UNSIGNED_BYTE, image); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - - /* setup second texture object */ - { - GLubyte image[8][8][3]; - GLint i, j; - glBindTexture(GL_TEXTURE_2D, Textures[1]); - - /* green/yellow checkerboard */ - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) { - if ((i ^ j) & 1) { - image[i][j][0] = 0; - image[i][j][1] = 255; - image[i][j][2] = 0; - } - else { - image[i][j][0] = 255; - image[i][j][1] = 255; - image[i][j][2] = 0; - } - } - } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 2); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0, GL_RGB, - GL_UNSIGNED_BYTE, image); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - - /* setup second texture object */ - { - GLubyte image[4][4][3]; - GLint i, j; - glBindTexture(GL_TEXTURE_2D, Textures[2]); - - /* blue/gray checkerboard */ - for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - if ((i ^ j) & 1) { - image[i][j][0] = 0; - image[i][j][1] = 0; - image[i][j][2] = 255; - } - else { - image[i][j][0] = 200; - image[i][j][1] = 200; - image[i][j][2] = 200; - } - } - } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 2); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 0, GL_RGB, - GL_UNSIGNED_BYTE, image); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - - /* Now make the cube object display list */ - CubeList = glGenLists(1); - glNewList(CubeList, GL_COMPILE); - { - glBindTexture(GL_TEXTURE_2D, Textures[0]); - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); glVertex3f(-1, -1, -1); - glTexCoord2f(1, 0); glVertex3f(-1, 1, -1); - glTexCoord2f(1, 1); glVertex3f(-1, 1, 1); - glTexCoord2f(0, 1); glVertex3f(-1, -1, 1); - glEnd(); - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); glVertex3f(1, -1, -1); - glTexCoord2f(1, 0); glVertex3f(1, 1, -1); - glTexCoord2f(1, 1); glVertex3f(1, 1, 1); - glTexCoord2f(0, 1); glVertex3f(1, -1, 1); - glEnd(); - - glBindTexture(GL_TEXTURE_2D, Textures[1]); - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); glVertex3f(-1, -1, -1); - glTexCoord2f(1, 0); glVertex3f( 1, -1, -1); - glTexCoord2f(1, 1); glVertex3f( 1, -1, 1); - glTexCoord2f(0, 1); glVertex3f(-1, -1, 1); - glEnd(); - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); glVertex3f(-1, 1, -1); - glTexCoord2f(1, 0); glVertex3f( 1, 1, -1); - glTexCoord2f(1, 1); glVertex3f( 1, 1, 1); - glTexCoord2f(0, 1); glVertex3f(-1, 1, 1); - glEnd(); - - glBindTexture(GL_TEXTURE_2D, Textures[2]); - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); glVertex3f(-1, -1, -1); - glTexCoord2f(1, 0); glVertex3f( 1, -1, -1); - glTexCoord2f(1, 1); glVertex3f( 1, 1, -1); - glTexCoord2f(0, 1); glVertex3f(-1, 1, -1); - glEnd(); - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); glVertex3f(-1, -1, 1); - glTexCoord2f(1, 0); glVertex3f( 1, -1, 1); - glTexCoord2f(1, 1); glVertex3f( 1, 1, 1); - glTexCoord2f(0, 1); glVertex3f(-1, 1, 1); - glEnd(); - } - glEndList(); - - printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION: %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR: %s\n", (char *) glGetString(GL_VENDOR)); -} - - - -static void -Redraw(struct window *h) -{ - if (!glXMakeCurrent(h->Dpy, h->Win, h->Context)) { - Error(h->DisplayName, "glXMakeCurrent failed"); - printf("glXMakeCurrent failed in Redraw()\n"); - return; - } - - h->Angle += 1.0; - - glShadeModel(GL_FLAT); - glClearColor(0.25, 0.25, 0.25, 1.0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glEnable(GL_TEXTURE_2D); - glEnable(GL_DEPTH_TEST); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - - glColor3f(1, 1, 1); - - glPushMatrix(); - if (h->Id == 0) - glRotatef(h->Angle, 0, 1, -1); - else if (h->Id == 1) - glRotatef(-(h->Angle), 0, 1, -1); - else if (h->Id == 2) - glRotatef(h->Angle, 0, 1, 1); - else if (h->Id == 3) - glRotatef(-(h->Angle), 0, 1, 1); - glCallList(CubeList); - glPopMatrix(); - - glXSwapBuffers(h->Dpy, h->Win); -} - - - -static void -Resize(const struct window *h, unsigned int width, unsigned int height) -{ - if (!glXMakeCurrent(h->Dpy, h->Win, h->Context)) { - Error(h->DisplayName, "glXMakeCurrent failed in Resize()"); - return; - } - glViewport(0, 0, width, height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1, 1, -1, 1, 2, 10); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0, 0, -3.5); -} - - - -static void -EventLoop(void) -{ - while (1) { - int i; - for (i = 0; i < NumWindows; i++) { - struct window *h = &Windows[i]; - while (XPending(h->Dpy) > 0) { - XEvent event; - XNextEvent(h->Dpy, &event); - if (event.xany.window == h->Win) { - switch (event.type) { - case Expose: - Redraw(h); - break; - case ConfigureNotify: - Resize(h, event.xconfigure.width, event.xconfigure.height); - break; - case KeyPress: - return; - default: - /*no-op*/ ; - } - } - else { - printf("window mismatch\n"); - } - } - Redraw(h); - } - usleep(1); - } -} - - - -static void -PrintInfo(const struct window *h) -{ - printf("Name: %s\n", h->DisplayName); - printf(" Display: 0x%x\n", h->Dpy); - printf(" Window: 0x%x\n", h->Win); - printf(" Context: 0x%x\n", h->Context); -} - - -int -main(int argc, char *argv[]) -{ - int i; - struct window *h0, *h1, *h2, *h3; - - /* four windows and contexts sharing display lists and texture objects */ - h0 = AddWindow(":0", 10, 10, NULL); - h1 = AddWindow(":0", 330, 10, h0); - h2 = AddWindow(":0", 10, 350, h0); - h3 = AddWindow(":0", 330, 350, h0); - - InitGLstuff(h0); - - EventLoop(); - return 0; -} diff --git a/progs/tests/stencil_wrap.c b/progs/tests/stencil_wrap.c deleted file mode 100644 index 88cf3809caf..00000000000 --- a/progs/tests/stencil_wrap.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2004 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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. - */ - -/** - * \file stencil_wrap.c - * - * Simple test of GL_EXT_stencil_wrap functionality. Four squares are drawn - * with different stencil modes, but all should be rendered with the same - * final color. - * - * \author Ian Romanick <[email protected]> - */ - -#include <stdio.h> -#include <stdlib.h> -#include <GL/glut.h> - -static int Width = 550; -static int Height = 200; -static const GLfloat Near = 5.0, Far = 25.0; - - -static void Display( void ) -{ - GLint max_stencil; - GLint stencil_bits; - unsigned i; - - - glGetIntegerv( GL_STENCIL_BITS, & stencil_bits ); - max_stencil = (1U << stencil_bits) - 1; - printf( "Stencil bits = %u, maximum stencil value = 0x%08x\n", - stencil_bits, max_stencil ); - - glClearStencil( 0 ); - glClearColor( 0.2, 0.2, 0.8, 0 ); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT - | GL_STENCIL_BUFFER_BIT ); - - - glPushMatrix(); - - /* This is the "reference" square. - */ - - glDisable(GL_STENCIL_TEST); - glTranslatef(-6.0, 0, 0); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - glEnable(GL_STENCIL_TEST); - - /* Draw the first two squares using the two non-wrap (i.e., saturate) - * modes. - */ - - glStencilFunc(GL_ALWAYS, 0, ~0); - glStencilOp(GL_KEEP, GL_KEEP, GL_INCR); - - glTranslatef(3.0, 0, 0); - glBegin(GL_QUADS); - glColor3f( 0.9, 0.9, 0.9 ); - - for ( i = 0 ; i < (max_stencil + 5) ; i++ ) { - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - } - glEnd(); - - glStencilFunc(GL_EQUAL, max_stencil, ~0); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - glStencilFunc(GL_ALWAYS, 0, ~0); - glStencilOp(GL_KEEP, GL_KEEP, GL_DECR); - - glTranslatef(3.0, 0, 0); - glBegin(GL_QUADS); - glColor3f( 0.9, 0.9, 0.9 ); - - for ( i = 0 ; i < (max_stencil + 5) ; i++ ) { - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - } - glEnd(); - - glStencilFunc(GL_EQUAL, 0, ~0); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - - - /* Draw the last two squares using the two wrap modes. - */ - - glStencilFunc(GL_ALWAYS, 0, ~0); - glStencilOp(GL_KEEP, GL_KEEP, GL_INCR_WRAP); - - glTranslatef(3.0, 0, 0); - glBegin(GL_QUADS); - glColor3f( 0.9, 0.9, 0.9 ); - - for ( i = 0 ; i < (max_stencil + 5) ; i++ ) { - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - } - glEnd(); - - glStencilFunc(GL_EQUAL, 4, ~0); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - - glStencilFunc(GL_ALWAYS, 0, ~0); - glStencilOp(GL_KEEP, GL_KEEP, GL_DECR_WRAP); - - glTranslatef(3.0, 0, 0); - glBegin(GL_QUADS); - glColor3f( 0.9, 0.9, 0.9 ); - - for ( i = 0 ; i < 5 ; i++ ) { - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - } - glEnd(); - - glStencilFunc(GL_EQUAL, (max_stencil - 4), ~0); - glBegin(GL_QUADS); - glColor3f( 0.5, 0.5, 0.5 ); - glVertex2f(-1, -1); - glVertex2f( 1, -1); - glVertex2f( 1, 1); - glVertex2f(-1, 1); - glEnd(); - - - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / (float) height; - Width = width; - Height = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, Near, Far ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - const char * const ver_string = (const char * const) - glGetString( GL_VERSION ); - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", ver_string); - - if ( !glutExtensionSupported("GL_EXT_stencil_wrap") - && (atof( ver_string ) < 1.4) ) { - printf("Sorry, this program requires either GL_EXT_stencil_wrap or OpenGL 1.4.\n"); - exit(1); - } - - printf("\nAll 5 squares should be the same color.\n"); - glEnable( GL_BLEND ); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( Width, Height ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL ); - glutCreateWindow( "GL_EXT_stencil_wrap test" ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/stencilwrap.c b/progs/tests/stencilwrap.c deleted file mode 100644 index 753375d0f3a..00000000000 --- a/progs/tests/stencilwrap.c +++ /dev/null @@ -1,281 +0,0 @@ -/* Test GL_EXT_stencil_wrap extension. - * This is by no means complete, just a quick check. - * - * Brian Paul 30 October 2002 - */ - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - -GLboolean wrapping; - -static void RunTest(void) -{ - const GLenum prim = GL_QUAD_STRIP; - GLubyte val; - int bits, max, i; - int expected; - GLboolean failed; - - glGetIntegerv(GL_STENCIL_BITS, &bits); - max = (1 << bits) - 1; - - - glEnable(GL_STENCIL_TEST); - glStencilFunc(GL_ALWAYS, 0, ~0); - - /* test GL_KEEP */ - glClearStencil(max); - glClear(GL_STENCIL_BUFFER_BIT); - glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); - failed = GL_FALSE; - printf("Testing GL_KEEP...\n"); - expected = max; - glBegin(prim); - glVertex2f(0, 0); - glVertex2f(10, 0); - glVertex2f(0, 10); - glVertex2f(10, 10); - glEnd(); - glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val); - if (val != expected) { - printf("Failed GL_KEEP test(got %u, expected %u)\n", val, expected); - failed = GL_TRUE; - } - else - printf("OK!\n"); - - /* test GL_ZERO */ - glClearStencil(max); - glClear(GL_STENCIL_BUFFER_BIT); - glStencilOp(GL_KEEP, GL_KEEP, GL_ZERO); - failed = GL_FALSE; - printf("Testing GL_ZERO...\n"); - expected = 0; - glBegin(prim); - glVertex2f(0, 0); - glVertex2f(10, 0); - glVertex2f(0, 10); - glVertex2f(10, 10); - glEnd(); - glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val); - if (val != expected) { - printf("Failed GL_ZERO test(got %u, expected %u)\n", val, expected); - failed = GL_TRUE; - } - else - printf("OK!\n"); - - /* test GL_REPLACE */ - glClearStencil(max); - glClear(GL_STENCIL_BUFFER_BIT); - glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - failed = GL_FALSE; - printf("Testing GL_REPLACE...\n"); - expected = 0; - glBegin(prim); - glVertex2f(0, 0); - glVertex2f(10, 0); - glVertex2f(0, 10); - glVertex2f(10, 10); - glEnd(); - glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val); - if (val != expected) { - printf("Failed GL_REPLACE test(got %u, expected %u)\n", val, expected); - failed = GL_TRUE; - } - else - printf("OK!\n"); - - /* test GL_INCR (saturation) */ - glClearStencil(0); - glClear(GL_STENCIL_BUFFER_BIT); - glStencilOp(GL_KEEP, GL_KEEP, GL_INCR); - failed = GL_FALSE; - printf("Testing GL_INCR...\n"); - for (i = 1; i < max+10; i++) { - expected = (i > max) ? max : i; - glBegin(prim); - glVertex2f(0, 0); glVertex2f(10, 0); - glVertex2f(0, 10); glVertex2f(10, 10); - glEnd(); - - glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val); - if (val != expected) { - printf( "Failed GL_INCR test on iteration #%u " - "(got %u, expected %u)\n", i, val, expected ); - failed = GL_TRUE; - } - } - if ( !failed ) - printf("OK!\n"); - - /* test GL_DECR (saturation) */ - glClearStencil(max); - glClear(GL_STENCIL_BUFFER_BIT); - glStencilOp(GL_KEEP, GL_KEEP, GL_DECR); - failed = GL_FALSE; - printf("Testing GL_DECR...\n"); - for (i = max-1; i > -10; i--) { - expected = (i < 0) ? 0 : i; - glBegin(prim); - glVertex2f(0, 0); glVertex2f(10, 0); - glVertex2f(0, 10); glVertex2f(10, 10); - glEnd(); - glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val); - if (val != expected) { - printf( "Failed GL_DECR test on iteration #%u " - "(got %u, expected %u)\n", max - i, val, expected ); - failed = GL_TRUE; - } - } - if ( !failed ) - printf("OK!\n"); - - /* test GL_INVERT */ - glClearStencil(0); - glClear(GL_STENCIL_BUFFER_BIT); - glStencilOp(GL_KEEP, GL_KEEP, GL_INVERT); - failed = GL_FALSE; - printf("Testing GL_INVERT...\n"); - expected = max; - glBegin(prim); - glVertex2f(0, 0); - glVertex2f(10, 0); - glVertex2f(0, 10); - glVertex2f(10, 10); - glEnd(); - glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val); - if (val != expected) { - printf("Failed GL_INVERT test(got %u, expected %u)\n", val, expected); - failed = GL_TRUE; - } - else - printf("OK!\n"); - - if(wrapping) - { - /* test GL_INCR_WRAP_EXT (wrap around) */ - glClearStencil(0); - glClear(GL_STENCIL_BUFFER_BIT); - glStencilOp(GL_KEEP, GL_KEEP, GL_INCR_WRAP_EXT); - failed = GL_FALSE; - printf("Testing GL_INCR_WRAP_EXT...\n"); - for (i = 1; i < max+10; i++) { - expected = i % (max + 1); - glBegin(prim); - glVertex2f(0, 0); glVertex2f(10, 0); - glVertex2f(0, 10); glVertex2f(10, 10); - glEnd(); - glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val); - if (val != expected) { - printf( "Failed GL_INCR_WRAP test on iteration #%u " - "(got %u, expected %u)\n", i, val, expected ); - failed = GL_TRUE; - } - } - if ( !failed ) - printf("OK!\n"); - - /* test GL_DECR_WRAP_EXT (wrap-around) */ - glClearStencil(max); - glClear(GL_STENCIL_BUFFER_BIT); - glStencilOp(GL_KEEP, GL_KEEP, GL_DECR_WRAP_EXT); - failed = GL_FALSE; - printf("Testing GL_DECR_WRAP_EXT...\n"); - for (i = max-1; i > -10; i--) { - expected = (i < 0) ? max + i + 1: i; - glBegin(prim); - glVertex2f(0, 0); glVertex2f(10, 0); - glVertex2f(0, 10); glVertex2f(10, 10); - glEnd(); - glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &val); - if (val != expected) { - printf( "Failed GL_DECR_WRAP test on iteration #%u " - "(got %u, expected %u)\n", max - i, val, expected ); - failed = GL_TRUE; - } - } - if ( !failed ) - printf("OK!\n"); - } - - glDisable(GL_STENCIL_TEST); -} - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - RunTest(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(0, width, 0, height, -1, 1); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - const char * ver_str; - float version; - - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - - - /* Check for both the extension string and GL version 1.4 on the - * outside chance that some vendor exports version 1.4 but doesn't - * export the extension string. The stencil-wrap modes are a required - * part of GL 1.4. - */ - - ver_str = glGetString( GL_VERSION ); - version = (ver_str == NULL) ? 1.0 : atof( ver_str ); - - wrapping = (glutExtensionSupported("GL_EXT_stencil_wrap") || (version >= 1.4)); - if (!wrapping) - printf("GL_EXT_stencil_wrap not supported. Only testing the rest.\n"); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 400, 400 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_STENCIL ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/subtexrate.c b/progs/tests/subtexrate.c deleted file mode 100644 index 568b68d552d..00000000000 --- a/progs/tests/subtexrate.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Measure glTexSubImage and glCopyTexSubImage speed - * - * Brian Paul - * 26 Jan 2006 - */ - -#define GL_GLEXT_PROTOTYPES -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> -#include <GL/glut.h> - -static GLint WinWidth = 1024, WinHeight = 512; -static GLint TexWidth = 512, TexHeight = 512; - -static GLuint TexObj = 1; - -static GLenum IntFormat = GL_RGBA8; -static GLenum ReadFormat = GL_RGBA; /* for glReadPixels */ - -static GLboolean DrawQuad = GL_TRUE; - - -/** - * draw teapot image, size TexWidth by TexHeight - */ -static void -DrawTestImage(void) -{ - GLfloat ar; - - glViewport(0, 0, TexWidth, TexHeight); - glScissor(0, 0, TexWidth, TexHeight); - glEnable(GL_SCISSOR_TEST); - - glClearColor(0.5, 0.5, 0.5, 0.0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - ar = (float) TexWidth / TexHeight; - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0); - glMatrixMode(GL_MODELVIEW); - - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - glFrontFace(GL_CW); - glPushMatrix(); - glRotatef(45, 1, 0, 0); - glRotatef(45, 0, 1, 0); - glutSolidTeapot(2.3); - glPopMatrix(); - glFrontFace(GL_CCW); - glDisable(GL_DEPTH_TEST); - glDisable(GL_LIGHTING); - - glDisable(GL_SCISSOR_TEST); - - glViewport(0, 0, WinWidth, WinHeight); - glFinish(); -} - - -/** - * Do glCopyTexSubImage2D call (update texture with framebuffer data) - * If doSubRect is true, do the copy in four pieces instead of all at once. - */ -static void -DoCopyTex(GLboolean doSubRect) -{ - if (doSubRect) { - /* copy in four parts */ - int w = TexWidth / 2, h = TexHeight / 2; - int x0 = 0, y0 = 0; - int x1 = w, y1 = h; -#if 1 - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, x0, y0, w, h); - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, x1, y0, w, h); - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, x0, y1, w, h); - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y1, x1, y1, w, h); -#else - /* scramble */ - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, x1, y1, w, h); - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, x0, y1, w, h); - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, x1, y0, w, h); - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y1, x0, y0, w, h); -#endif - } - else { - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, TexWidth, TexHeight); - } -} - - -/** - * Do glTexSubImage2D (update texture w/ user data) - * If doSubRect, do update in four pieces, else all at once. - */ -static void -SubTex(GLboolean doSubRect, const GLubyte *image) -{ - if (doSubRect) { - /* four pieces */ - int w = TexWidth / 2, h = TexHeight / 2; - int x0 = 0, y0 = 0; - int x1 = w, y1 = h; - glPixelStorei(GL_UNPACK_ROW_LENGTH, TexWidth); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - glPixelStorei(GL_UNPACK_SKIP_ROWS, y0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0); - glTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, w, h, - ReadFormat, GL_UNSIGNED_BYTE, image); - - glPixelStorei(GL_UNPACK_SKIP_ROWS, y0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1); - glTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, w, h, - ReadFormat, GL_UNSIGNED_BYTE, image); - - glPixelStorei(GL_UNPACK_SKIP_ROWS, y1); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0); - glTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, w, h, - ReadFormat, GL_UNSIGNED_BYTE, image); - - glPixelStorei(GL_UNPACK_SKIP_ROWS, y1); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1); - glTexSubImage2D(GL_TEXTURE_2D, 0, x1, y1, w, h, - ReadFormat, GL_UNSIGNED_BYTE, image); - } - else { - /* all at once */ - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, TexWidth, TexHeight, - ReadFormat, GL_UNSIGNED_BYTE, image); - } -} - - -/** - * Measure gl[Copy]TexSubImage rate. - * This actually also includes time to render a quad and SwapBuffers. - */ -static void -RunTest(GLboolean copyTex, GLboolean doSubRect) -{ - double t0, t1; - int iters = 0; - float copyRate, mbRate; - float rot = 0.0; - int bpp, r, g, b, a; - int w, h; - GLubyte *image = NULL; - - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_SIZE, &r); - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_GREEN_SIZE, &g); - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BLUE_SIZE, &b); - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &a); - bpp = (r + g + b + a) / 8; - - if (!copyTex) { - /* read image from frame buffer */ - image = (GLubyte *) malloc(TexWidth * TexHeight * bpp); - glPixelStorei(GL_PACK_ALIGNMENT, 1); - glReadPixels(0, 0, TexWidth, TexHeight, - ReadFormat, GL_UNSIGNED_BYTE, image); - } - - glEnable(GL_TEXTURE_2D); - glViewport(WinWidth / 2, 0, WinWidth / 2, WinHeight); - - t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0; - - do { - if (copyTex) - /* Framebuffer -> Texture */ - DoCopyTex(doSubRect); - else { - /* Main Mem -> Texture */ - SubTex(doSubRect, image); - } - - /* draw textured quad */ - if (DrawQuad) { - glPushMatrix(); - glRotatef(rot, 0, 0, 1); - glTranslatef(1, 0, 0); - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); glVertex2f(-1, -1); - glTexCoord2f(1, 0); glVertex2f( 1, -1); - glTexCoord2f(1, 1); glVertex2f( 1, 1); - glTexCoord2f(0, 1); glVertex2f(-1, 1); - glEnd(); - glPopMatrix(); - } - - iters++; - rot += 2.0; - - t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0; - if (DrawQuad) { - glutSwapBuffers(); - } - } while (t1 - t0 < 5.0); - - glDisable(GL_TEXTURE_2D); - if (image) - free(image); - - if (doSubRect) { - w = TexWidth / 2; - h = TexHeight / 2; - iters *= 4; - } - else { - w = TexWidth; - h = TexHeight; - } - - copyRate = iters / (t1 - t0); - mbRate = w * h * bpp * copyRate / (1024 * 1024); - - if (copyTex) - printf("glCopyTexSubImage: %d x %d, %d Bpp:\n", w, h, bpp); - else - printf("glTexSubImage: %d x %d, %d Bpp:\n", w, h, bpp); - printf(" %d calls in %.2f = %.2f calls/sec, %.2f MB/s\n", - iters, t1-t0, copyRate, mbRate); -} - - -static void -Draw(void) -{ - glClearColor(0.2, 0.2, 0.8, 0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - DrawTestImage(); - if (!DrawQuad) { - glutSwapBuffers(); - } - - RunTest(GL_FALSE, GL_FALSE); - RunTest(GL_FALSE, GL_TRUE); - RunTest(GL_TRUE, GL_FALSE); - RunTest(GL_TRUE, GL_TRUE); - - glutSwapBuffers(); - - printf("exiting\n"); - exit(0); -} - - -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.0, 0.0, -15.0); -} - - -static void -Key(unsigned char key, int x, int y) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void -SpecialKey(int key, int x, int y) -{ - (void) x; - (void) y; - switch (key) { - case GLUT_KEY_UP: - break; - case GLUT_KEY_DOWN: - break; - case GLUT_KEY_LEFT: - break; - case GLUT_KEY_RIGHT: - break; - } - glutPostRedisplay(); -} - - -static void -Init(void) -{ - /* create initial, empty teximage */ - glBindTexture(GL_TEXTURE_2D, TexObj); - glTexImage2D(GL_TEXTURE_2D, 0, IntFormat, TexWidth, TexHeight, 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); -} - - - -static void -ParseArgs(int argc, char *argv[]) -{ - int i; - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-nodraw") == 0) - DrawQuad = GL_FALSE; - } -} - - -int -main(int argc, char *argv[]) -{ - GLint mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE | GLUT_DEPTH; - glutInit(&argc, argv); - - ParseArgs(argc, argv); - - glutInitWindowPosition(0, 0); - glutInitWindowSize(WinWidth, WinHeight); - glutInitDisplayMode(mode); - glutCreateWindow(argv[0]); - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutSpecialFunc(SpecialKey); - glutDisplayFunc(Draw); - - printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER)); - Init(); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/tex1d.c b/progs/tests/tex1d.c deleted file mode 100644 index 1fab849dd3e..00000000000 --- a/progs/tests/tex1d.c +++ /dev/null @@ -1,139 +0,0 @@ - -/* Exercise 1D textures - */ - -#include <assert.h> -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "GL/glut.h" - -static GLuint Window = 0; -static GLuint TexObj[2]; -static GLfloat Angle = 0.0f; - - -static void draw( void ) -{ - glClear( GL_COLOR_BUFFER_BIT ); - - glColor3f( 1.0, 1.0, 1.0 ); - - /* draw first polygon */ - glPushMatrix(); - glTranslatef( -1.0, 0.0, 0.0 ); - glRotatef( Angle, 0.0, 0.0, 1.0 ); - glBindTexture( GL_TEXTURE_1D, TexObj[0] ); - glBegin( GL_POLYGON ); - glTexCoord1f( 0.0 ); glVertex2f( -1.0, -1.0 ); - glTexCoord1f( 1.0 ); glVertex2f( 1.0, -1.0 ); - glTexCoord1f( 1.0 ); glVertex2f( 1.0, 1.0 ); - glTexCoord1f( 0.0 ); glVertex2f( -1.0, 1.0 ); - glEnd(); - glPopMatrix(); - - glutSwapBuffers(); -} - - - -static void idle( void ) -{ - Angle += 2.0; - glutPostRedisplay(); -} - - - -/* change view Angle, exit upon ESC */ -static void key(unsigned char k, int x, int y) -{ - (void) x; - (void) y; - switch (k) { - case 27: - exit(0); - } -} - - - -/* new window size or exposure */ -static void reshape( int width, int height ) -{ - glViewport(0, 0, (GLint)width, (GLint)height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - /* glOrtho( -3.0, 3.0, -3.0, 3.0, -10.0, 10.0 );*/ - glFrustum( -2.0, 2.0, -2.0, 2.0, 6.0, 20.0 ); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -8.0 ); -} - - -static void init( void ) -{ - GLubyte tex[256][3]; - GLint i; - - - glDisable( GL_DITHER ); - - /* Setup texturing */ - glEnable( GL_TEXTURE_1D ); - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL ); - - - /* generate texture object IDs */ - glGenTextures( 2, TexObj ); - - /* setup first texture object */ - glBindTexture( GL_TEXTURE_1D, TexObj[0] ); - - - for (i = 0; i < 256; i++) { - GLfloat f; - - /* map 0..255 to -PI .. PI */ - f = ((i / 255.0) - .5) * (3.141592 * 2); - - f = sin(f); - - /* map -1..1 to 0..255 */ - tex[i][0] = (f+1.0)/2.0 * 255.0; - tex[i][1] = 0; - tex[i][2] = 0; - } - - glTexImage1D( GL_TEXTURE_1D, 0, 3, 256, 0, GL_RGB, GL_UNSIGNED_BYTE, tex ); - glTexParameteri( GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT ); - glTexParameteri( GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_REPEAT ); -} - - - -int main( int argc, char *argv[] ) -{ - glutInit(&argc, argv); - glutInitWindowPosition(0, 0); - glutInitWindowSize(300, 300); - glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); - - Window = glutCreateWindow("Texture Objects"); - if (!Window) { - exit(1); - } - - init(); - - glutReshapeFunc( reshape ); - glutKeyboardFunc( key ); -/* glutIdleFunc( idle ); */ - glutDisplayFunc( draw ); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c deleted file mode 100644 index 6e822fb6895..00000000000 --- a/progs/tests/texcmp.c +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Compressed texture demo. Written by Daniel Borca. - * This program is in the public domain. - */ - -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <string.h> -#define GL_GLEXT_PROTOTYPES 1 -#include <GL/glut.h> - -#include "readtex.c" /* I know, this is a hack. */ -#define TEXTURE_FILE "../images/tree2.rgba" - - -static float Rot = 0.0; -static GLboolean Anim = 1; - -typedef struct { - GLubyte *data; - GLuint size; - GLenum format; - GLuint w, h; - - GLenum TC; - - GLubyte *cData; - GLuint cSize; - GLenum cFormat; -} TEXTURE; - -static TEXTURE *Tx, t1, t2, t3; -static GLboolean fxt1, dxtc, s3tc; - - -static const char *TextureName (GLenum TC) -{ - switch (TC) { - case GL_RGB: - return "RGB"; - case GL_RGBA: - return "RGBA"; - case GL_COMPRESSED_RGB: - return "COMPRESSED_RGB"; - case GL_COMPRESSED_RGBA: - return "COMPRESSED_RGBA"; - case GL_COMPRESSED_RGB_FXT1_3DFX: - return "GL_COMPRESSED_RGB_FXT1_3DFX"; - case GL_COMPRESSED_RGBA_FXT1_3DFX: - return "GL_COMPRESSED_RGBA_FXT1_3DFX"; - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return "GL_COMPRESSED_RGB_S3TC_DXT1_EXT"; - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT"; - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT"; - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT"; - case GL_RGB_S3TC: - return "GL_RGB_S3TC"; - case GL_RGB4_S3TC: - return "GL_RGB4_S3TC"; - case GL_RGBA_S3TC: - return "GL_RGBA_S3TC"; - case GL_RGBA4_S3TC: - return "GL_RGBA4_S3TC"; - case 0: - return "Invalid format"; - default: - return "Unknown format"; - } -} - - -static void -PrintString(const char *s) -{ - while (*s) { - glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); - s++; - } -} - - -static void Idle( void ) -{ - float t = glutGet(GLUT_ELAPSED_TIME) * 0.001; /* in seconds */ - Rot = t * 360 / 4; /* 1 rotation per 4 seconds */ - glutPostRedisplay(); -} - - -static void Display( void ) -{ - /* draw background gradient */ - glDisable(GL_TEXTURE_2D); - glBegin(GL_POLYGON); - glColor3f(1.0, 0.0, 0.2); glVertex2f(-1.5, -1.0); - glColor3f(1.0, 0.0, 0.2); glVertex2f( 1.5, -1.0); - glColor3f(0.0, 0.0, 1.0); glVertex2f( 1.5, 1.0); - glColor3f(0.0, 0.0, 1.0); glVertex2f(-1.5, 1.0); - glEnd(); - - glPushMatrix(); - glRotatef(Rot, 0, 0, 1); - - glEnable(GL_TEXTURE_2D); - glBegin(GL_POLYGON); - glTexCoord2f(0, 1); glVertex2f(-1, -0.5); - glTexCoord2f(1, 1); glVertex2f( 1, -0.5); - glTexCoord2f(1, 0); glVertex2f( 1, 0.5); - glTexCoord2f(0, 0); glVertex2f(-1, 0.5); - glEnd(); - - glPopMatrix(); - - /* info */ - glColor4f(1, 1, 1, 1); - - glRasterPos3f(-1.2, -0.7, 0); - PrintString("Selected: "); - PrintString(TextureName(Tx->TC)); - if (Tx->cData) { - char tmp[64]; - glRasterPos3f(-1.2, -0.8, 0); - PrintString("Internal: "); - PrintString(TextureName(Tx->cFormat)); - glRasterPos3f(-1.2, -0.9, 0); - PrintString("Size : "); - sprintf(tmp, "%d (%d%% of %d)", Tx->cSize, Tx->cSize * 100 / Tx->size, Tx->size); - PrintString(tmp); - } - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho( -1.5, 1.5, -1.0, 1.0, -1.0, 1.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -} - - -static void ReInit( GLenum TC, TEXTURE *Tx ) -{ - GLint rv; - - if ((Tx->TC == TC) && (Tx->cData != NULL)) { - glCompressedTexImage2DARB(GL_TEXTURE_2D, /* target */ - 0, /* level */ - Tx->cFormat, /* real format */ - Tx->w, /* original width */ - Tx->h, /* original height */ - 0, /* border */ - Tx->cSize, /* compressed size*/ - Tx->cData); /* compressed data*/ - } else { - glTexImage2D(GL_TEXTURE_2D, /* target */ - 0, /* level */ - TC, /* internal format */ - Tx->w, Tx->h, /* width, height */ - 0, /* border */ - Tx->format, /* texture format */ - GL_UNSIGNED_BYTE, /* texture type */ - Tx->data); /* the texture */ - - /* okay, now cache the compressed texture */ - Tx->TC = TC; - if (Tx->cData != NULL) { - free(Tx->cData); - Tx->cData = NULL; - } - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_ARB, &rv); - if (rv) { - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, (GLint *)&Tx->cFormat); - glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, (GLint *)&Tx->cSize); - if ((Tx->cData = malloc(Tx->cSize)) != NULL) { - glGetCompressedTexImageARB(GL_TEXTURE_2D, 0, Tx->cData); - } - } - } -} - - -static void Init( void ) -{ - /* HEIGHT * WIDTH + 1 (for trailing '\0') */ - static char pattern[8 * 32 + 1] = {"\ - \ - MMM EEEE SSS AAA \ - M M M E S S A A \ - M M M EEEE SS A A \ - M M M E SS AAAAA \ - M M E S S A A \ - M M EEEE SSS A A \ - " - }; - - GLuint i, j; - - GLubyte (*texture1)[8 * 32][4]; - GLubyte (*texture2)[256][256][4]; - - t1.w = 32; - t1.h = 8; - t1.size = t1.w * t1.h * 4; - t1.data = malloc(t1.size); - t1.format = GL_RGBA; - t1.TC = GL_RGBA; - - texture1 = (GLubyte (*)[8 * 32][4])t1.data; - for (i = 0; i < sizeof(pattern) - 1; i++) { - switch (pattern[i]) { - default: - case ' ': - (*texture1)[i][0] = 255; - (*texture1)[i][1] = 255; - (*texture1)[i][2] = 255; - (*texture1)[i][3] = 64; - break; - case 'M': - (*texture1)[i][0] = 255; - (*texture1)[i][1] = 0; - (*texture1)[i][2] = 0; - (*texture1)[i][3] = 255; - break; - case 'E': - (*texture1)[i][0] = 0; - (*texture1)[i][1] = 255; - (*texture1)[i][2] = 0; - (*texture1)[i][3] = 255; - break; - case 'S': - (*texture1)[i][0] = 0; - (*texture1)[i][1] = 0; - (*texture1)[i][2] = 255; - (*texture1)[i][3] = 255; - break; - case 'A': - (*texture1)[i][0] = 255; - (*texture1)[i][1] = 255; - (*texture1)[i][2] = 0; - (*texture1)[i][3] = 255; - break; - } - } - - t2.w = 256; - t2.h = 256; - t2.size = t2.w * t2.h * 4; - t2.data = malloc(t2.size); - t2.format = GL_RGBA; - t2.TC = GL_RGBA; - - texture2 = (GLubyte (*)[256][256][4])t2.data; - for (j = 0; j < t2.h; j++) { - for (i = 0; i < t2.w; i++) { - (*texture2)[j][i][0] = sqrt(i * j * 255 * 255 / (t2.w * t2.h)); - (*texture2)[j][i][1] = 0; - (*texture2)[j][i][2] = 0; - (*texture2)[j][i][3] = 255; - } - } - - t3.data = LoadRGBImage(TEXTURE_FILE, (GLint *)&t3.w, (GLint *)&t3.h, &t3.format); - t3.size = t3.w * t3.h * ((t3.format == GL_RGB) ? 3 : 4); - t3.TC = GL_RGBA; - - ReInit(GL_RGBA, Tx = &t1); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glEnable(GL_TEXTURE_2D); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - case ' ': - Anim = !Anim; - if (Anim) - glutIdleFunc( Idle ); - else - glutIdleFunc( NULL ); - break; - case 't': - if (Tx == &t1) { - Tx = &t2; - } else if (Tx == &t2) { - Tx = &t3; - } else { - Tx = &t1; - } - ReInit(Tx->TC, Tx); - break; - case '9': - ReInit(GL_RGB, Tx); - break; - case '0': - ReInit(GL_RGBA, Tx); - break; - case '1': - ReInit(GL_COMPRESSED_RGB, Tx); - break; - case '2': - ReInit(GL_COMPRESSED_RGBA, Tx); - break; - case '3': - if (fxt1) ReInit(GL_COMPRESSED_RGB_FXT1_3DFX, Tx); - break; - case '4': - if (fxt1) ReInit(GL_COMPRESSED_RGBA_FXT1_3DFX, Tx); - break; - case '5': - if (dxtc) ReInit(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, Tx); - break; - case '6': - if (dxtc) ReInit(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, Tx); - break; - case '7': - if (dxtc) ReInit(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, Tx); - break; - case '8': - if (dxtc) ReInit(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, Tx); - break; - case 'a': - if (s3tc) ReInit(GL_RGB_S3TC, Tx); - break; - case 's': - if (s3tc) ReInit(GL_RGB4_S3TC, Tx); - break; - case 'd': - if (s3tc) ReInit(GL_RGBA_S3TC, Tx); - break; - case 'f': - if (s3tc) ReInit(GL_RGBA4_S3TC, Tx); - break; - } - glutPostRedisplay(); -} - - -int main( int argc, char *argv[] ) -{ - float gl_version; - GLint num_formats; - GLint i; - GLint formats[64]; - - - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 400, 300 ); - - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - - if (glutCreateWindow(argv[0]) <= 0) { - printf("Couldn't create window\n"); - exit(0); - } - - gl_version = atof( (const char *) glGetString( GL_VERSION ) ); - if ( (gl_version < 1.3) - && !glutExtensionSupported("GL_ARB_texture_compression") ) { - printf("Sorry, GL_ARB_texture_compression not supported\n"); - exit(0); - } - if (glutExtensionSupported("GL_3DFX_texture_compression_FXT1")) { - fxt1 = GL_TRUE; - } - if (glutExtensionSupported("GL_EXT_texture_compression_s3tc")) { - dxtc = GL_TRUE; - } - if (glutExtensionSupported("GL_S3_s3tc")) { - s3tc = GL_TRUE; - } - - glGetIntegerv( GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB, & num_formats ); - - (void) memset( formats, 0, sizeof( formats ) ); - glGetIntegerv( GL_COMPRESSED_TEXTURE_FORMATS_ARB, formats ); - - printf( "The following texture formats are supported:\n" ); - for ( i = 0 ; i < num_formats ; i++ ) { - printf( "\t%s\n", TextureName( formats[i] ) ); - } - - Init(); - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc( Idle ); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/texcompress2.c b/progs/tests/texcompress2.c deleted file mode 100644 index e2eed756b62..00000000000 --- a/progs/tests/texcompress2.c +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Test texture compression. - */ - - -#define GL_GLEXT_PROTOTYPES -#include <assert.h> -#include <stdio.h> -#include <GL/glut.h> -#include <GL/glx.h> -#include "readtex.c" - -#define IMAGE_FILE "../images/arch.rgb" - -static int ImgWidth, ImgHeight; -static GLenum ImgFormat; -static GLenum CompFormat; -static GLfloat EyeDist = 5.0; -static GLfloat Rot = 0.0; -const GLenum Target = GL_TEXTURE_2D; - - -static void -CheckError(int line) -{ - GLenum err = glGetError(); - if (err) { - printf("GL Error %d at line %d\n", (int) err, line); - } -} - - -static const char * -LookupFormat(GLenum format) -{ - switch (format) { - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return "GL_COMPRESSED_RGB_S3TC_DXT1_EXT"; - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT"; - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT"; - default: - return "other"; - } -} - - -static void -TestSubTex(void) -{ - GLboolean all = 0*GL_TRUE; - GLubyte *buffer; - GLint size, fmt; - int i; - - glGetTexLevelParameteriv(Target, 0, - GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &size); - glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_INTERNAL_FORMAT, &fmt); - - buffer = (GLubyte *) malloc(size); - glGetCompressedTexImageARB(Target, 0, buffer); - - printf("Testing sub-texture replacement\n"); - if (all) - glCompressedTexImage2DARB(Target, 0, - fmt, ImgWidth, ImgHeight, 0, - size, buffer); - else { - /* bottom half */ - glCompressedTexSubImage2DARB(Target, 0, - 0, 0, /* pos */ - ImgWidth, ImgHeight / 2, - fmt, size/2, buffer); - /* top half */ - glCompressedTexSubImage2DARB(Target, 0, - 0, ImgHeight / 2, /* pos */ - ImgWidth, ImgHeight / 2, - fmt, size/2, buffer + size / 2); - } - - free(buffer); -} - - -static void -LoadCompressedImage(const char *file) -{ - const GLenum filter = GL_LINEAR; - GLubyte *image; - GLint p; - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glPixelStorei(GL_PACK_ALIGNMENT, 1); - - /* - * Load image and scale if needed. - */ - image = LoadRGBImage( file, &ImgWidth, &ImgHeight, &ImgFormat ); - if (!image) { - printf("Couldn't read %s\n", IMAGE_FILE); - exit(0); - } - printf("Image is %d x %d\n", ImgWidth, ImgHeight); - - /* power of two */ - assert(ImgWidth == 128 || ImgWidth == 256 || ImgWidth == 512); - assert(ImgWidth == 128 || ImgHeight == 256 || ImgHeight == 512); - - if (ImgFormat == GL_RGB) - CompFormat = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; - else - CompFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - - if (ImgFormat == GL_RGBA) { - int i, numAlpha = 0; - for (i = 0; i < ImgWidth * ImgHeight; i++) { - if (image[i*4+3] != 0 && image[i*4+3] != 0xff) { - numAlpha++; - } - if (image[i*4+3] == 0) - image[i*4+3] = 4 * i / ImgWidth; - } - printf("Num Alpha !=0,255: %d\n", numAlpha); - } - - CompFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - - - /* - * Give image to OpenGL and have it compress it. - */ - glTexImage2D(Target, 0, CompFormat, ImgWidth, ImgHeight, 0, - ImgFormat, GL_UNSIGNED_BYTE, image); - CheckError(__LINE__); - - free(image); - - glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_INTERNAL_FORMAT, &p); - printf("Compressed Internal Format: %s (0x%x)\n", LookupFormat(p), p); - assert(p == CompFormat); - - printf("Original size: %d bytes\n", ImgWidth * ImgHeight * 3); - glGetTexLevelParameteriv(Target, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &p); - printf("Compressed size: %d bytes\n", p); - - glTexParameteri(Target, GL_TEXTURE_MIN_FILTER, filter); - glTexParameteri(Target, GL_TEXTURE_MAG_FILTER, filter); - - TestSubTex(); - -} - - -static void -Init(const char *file) -{ - GLint numFormats, formats[100]; - GLint p; - - if (!glutExtensionSupported("GL_ARB_texture_compression")) { - printf("Sorry, GL_ARB_texture_compression is required.\n"); - exit(1); - } - if (!glutExtensionSupported("GL_EXT_texture_compression_s3tc")) { - printf("Sorry, GL_EXT_texture_compression_s3tc is required.\n"); - exit(1); - } - - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB, &numFormats); - glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS_ARB, formats); - printf("%d supported compression formats: ", numFormats); - for (p = 0; p < numFormats; p++) - printf("0x%x ", formats[p]); - printf("\n"); - - LoadCompressedImage(file); - - glEnable(GL_TEXTURE_2D); - - if (ImgFormat == GL_RGBA) { - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - } -} - - -static void -Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum(-1, 1, -1, 1, 4, 100); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -} - - -static void -Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'd': - EyeDist -= 1.0; - if (EyeDist < 4.0) - EyeDist = 4.0; - break; - case 'D': - EyeDist += 1.0; - break; - case 'z': - Rot += 5.0; - break; - case 'Z': - Rot -= 5.0; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void -Draw( void ) -{ - glClearColor(0.3, 0.3, .8, 0); - glClear(GL_COLOR_BUFFER_BIT); - - glPushMatrix(); - glTranslatef(0, 0, -(EyeDist+0.01)); - glRotatef(Rot, 0, 0, 1); - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); glVertex2f(-1, -1); - glTexCoord2f(1, 0); glVertex2f( 1, -1); - glTexCoord2f(1, 1); glVertex2f( 1, 1); - glTexCoord2f(0, 1); glVertex2f(-1, 1); - glEnd(); - glPopMatrix(); - - glutSwapBuffers(); -} - - -int -main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowSize( 600, 600 ); - - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE); - - glutCreateWindow(argv[0]); - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Draw ); - - if (argc > 1) - Init(argv[1]); - else - Init(IMAGE_FILE); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/texfilt.c b/progs/tests/texfilt.c deleted file mode 100644 index 6ee4bc4eae3..00000000000 --- a/progs/tests/texfilt.c +++ /dev/null @@ -1,398 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2005 - * 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 - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, 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 (including the next - * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * IBM AND/OR THEIR SUPPLIERS 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. - */ - - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> -#include <GL/glut.h> - -const GLenum filter_modes[] = { - GL_NEAREST, - GL_LINEAR, - GL_NEAREST_MIPMAP_NEAREST, - GL_NEAREST_MIPMAP_LINEAR, - GL_LINEAR_MIPMAP_NEAREST, - GL_LINEAR_MIPMAP_LINEAR, -}; - -static GLenum min_filter = GL_LINEAR_MIPMAP_LINEAR; -static GLenum mag_filter = GL_LINEAR; - -static unsigned segments = 64; -static GLfloat * position_data = NULL; -static GLfloat * texcoord_data = NULL; -static GLfloat max_anisotropy = 0.0; -static GLfloat anisotropy = 1.0; - -static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data, - GLfloat ** tex_data ); -static void generate_textures( unsigned mode ); - -#define min(a,b) ( (a) < (b) ) ? (a) : (b) -#define max(a,b) ( (a) > (b) ) ? (a) : (b) - - -static void Display( void ) -{ - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter ); - - if ( max_anisotropy > 0.0 ) { - glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, - anisotropy ); - } - - glClear( GL_COLOR_BUFFER_BIT ); - glLoadIdentity(); - glTranslatef( 0.0f, 0.0f, -19.0f ); - - glVertexPointer( 4, GL_FLOAT, 0, position_data ); - glTexCoordPointer( 2, GL_FLOAT, 0, texcoord_data ); - glEnableClientState( GL_VERTEX_ARRAY ); - glEnableClientState( GL_TEXTURE_COORD_ARRAY ); - glDrawArrays( GL_QUADS, 0, 4 * segments ); - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport(0, 0, width, height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(45.0f, (GLfloat)(width)/(GLfloat)(height), 0.1f, 100.0f); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); -} - - -static void Key( unsigned char key, int x, int y ) -{ - GLfloat new_anisotropy = anisotropy; - - (void) x; - (void) y; - - - switch( key ) { - case 'a': { - new_anisotropy = anisotropy - 1.0; - break; - } - - case 'A': { - new_anisotropy = anisotropy + 1.0; - break; - } - - case 's': { - segments--; - if ( segments < 3 ) { - segments = 3; - } - generate_tunnel( segments, & position_data, & texcoord_data ); - break; - } - - case 'S': { - segments++; - if ( segments > 128 ) { - segments = 128; - } - generate_tunnel( segments, & position_data, & texcoord_data ); - break; - } - case 'q': - case 'Q': - case 27: - exit(0); - break; - } - - new_anisotropy = max( new_anisotropy, 1.0 ); - new_anisotropy = min( new_anisotropy, max_anisotropy ); - if ( new_anisotropy != anisotropy ) { - anisotropy = new_anisotropy; - printf( "Texture anisotropy: %f%s\n", anisotropy, - (anisotropy == 1.0) ? " (disabled)" : "" ); - } - - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - (void) x; - (void) y; - (void) key; - glutPostRedisplay(); -} - - -static void menu_handler( int selection ) -{ - switch( selection >> 3 ) { - case 0: - glBindTexture( GL_TEXTURE_2D, selection ); - break; - - case 1: - min_filter = filter_modes[ selection & 7 ]; - break; - - case 2: - mag_filter = filter_modes[ selection & 7 ]; - break; - } - - glutPostRedisplay(); -} - - -static void Init( void ) -{ - glDisable(GL_CULL_FACE); - glEnable(GL_TEXTURE_2D); - glClearColor(0.0f, 0.0f, 0.4f, 0.0f); - glShadeModel(GL_SMOOTH); - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); - - generate_tunnel( segments, & position_data, & texcoord_data ); - - glBindTexture( GL_TEXTURE_2D, 1 ); - generate_textures(1); - - glBindTexture( GL_TEXTURE_2D, 2 ); - generate_textures(2); - - glBindTexture( GL_TEXTURE_2D, 3 ); - generate_textures(3); - - if ( glutExtensionSupported( "GL_EXT_texture_filter_anisotropic" ) ) { - glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, & max_anisotropy ); - } - - printf("Maximum texture anisotropy: %f\n", max_anisotropy ); - - /* Create the menus. */ - - glutCreateMenu( menu_handler ); - glutAddMenuEntry( "Min filter: GL_NEAREST", 8 + 0 ); - glutAddMenuEntry( "Min filter: GL_LINEAR", 8 + 1 ); - glutAddMenuEntry( "Min filter: GL_NEAREST_MIMMAP_NEAREST", 8 + 2 ); - glutAddMenuEntry( "Min filter: GL_NEAREST_MIMMAP_LINEAR", 8 + 3 ); - glutAddMenuEntry( "Min filter: GL_LINEAR_MIMMAP_NEAREST", 8 + 4 ); - glutAddMenuEntry( "Min filter: GL_LINEAR_MIMMAP_LINEAR", 8 + 5 ); - glutAddMenuEntry( "Mag filter: GL_NEAREST", 16 + 0 ); - glutAddMenuEntry( "Mag filter: GL_LINEAR", 16 + 1 ); - glutAddMenuEntry( "Texture: regular mipmaps", 1 ); - glutAddMenuEntry( "Texture: blended mipmaps", 2 ); - glutAddMenuEntry( "Texture: color mipmaps", 3 ); - glutAttachMenu( GLUT_RIGHT_BUTTON ); -} - - -static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data, - GLfloat ** tex_data ) -{ - const GLfloat far = 20.0f; - const GLfloat near = -90.0f; - const GLfloat far_tex = 30.0f; - const GLfloat near_tex = 0.0f; - const GLfloat angle_step = (2 * M_PI) / num_segs; - const GLfloat tex_coord_step = 2.0 / num_segs; - GLfloat angle = 0.0f; - GLfloat tex_coord = 0.0f; - unsigned i; - GLfloat * position; - GLfloat * texture; - - - position = realloc( *pos_data, sizeof( GLfloat ) * num_segs * 4 * 4 ); - texture = realloc( *tex_data, sizeof( GLfloat ) * num_segs * 4 * 2 ); - - *pos_data = position; - *tex_data = texture; - - for ( i = 0 ; i < num_segs ; i++ ) { - position[0] = 2.5 * sinf( angle ); - position[1] = 2.5 * cosf( angle ); - position[2] = (i & 1) ? far : near; - position[3] = 1.0f; - - position[4] = position[0]; - position[5] = position[1]; - position[6] = (i & 1) ? near : far; - position[7] = 1.0f; - - position += 8; - - texture[0] = tex_coord; - texture[1] = (i & 1) ? far_tex : near_tex; - texture += 2; - - texture[0] = tex_coord; - texture[1] = (i & 1) ? near_tex : far_tex; - texture += 2; - - angle += angle_step; - tex_coord += tex_coord_step; - - position[0] = 2.5 * sinf( angle ); - position[1] = 2.5 * cosf( angle ); - position[2] = (i & 1) ? near : far; - position[3] = 1.0f; - - position[4] = position[0]; - position[5] = position[1]; - position[6] = (i & 1) ? far : near; - position[7] = 1.0f; - - position += 8; - - texture[0] = tex_coord; - texture[1] = (i & 1) ? near_tex : far_tex; - texture += 2; - - texture[0] = tex_coord; - texture[1] = (i & 1) ? far_tex : near_tex; - texture += 2; - } -} - - -static void generate_textures( unsigned mode ) -{ -#define LEVEL_COLORS 6 - const GLfloat colors[LEVEL_COLORS][3] = { - { 1.0, 0.0, 0.0 }, /* 32 x 32 */ - { 0.0, 1.0, 0.0 }, /* 16 x 16 */ - { 0.0, 0.0, 1.0 }, /* 8 x 8 */ - { 1.0, 0.0, 1.0 }, /* 4 x 4 */ - { 1.0, 1.0, 1.0 }, /* 2 x 2 */ - { 1.0, 1.0, 0.0 } /* 1 x 1 */ - }; - const unsigned checkers_per_level = 2; - GLfloat * tex; - unsigned level; - unsigned size; - GLint max_size; - - - glGetIntegerv( GL_MAX_TEXTURE_SIZE, & max_size ); - if ( max_size > 512 ) { - max_size = 512; - } - - tex = malloc( sizeof( GLfloat ) * 3 * max_size * max_size ); - - level = 0; - for ( size = max_size ; size > 0 ; size >>= 1 ) { - unsigned divisor = size / checkers_per_level; - unsigned i; - unsigned j; - GLfloat checkers[2][3]; - - - if ((level == 0) || (mode == 1)) { - checkers[0][0] = 1.0; - checkers[0][1] = 1.0; - checkers[0][2] = 1.0; - checkers[1][0] = 0.0; - checkers[1][1] = 0.0; - checkers[1][2] = 0.0; - } - else if (mode == 2) { - checkers[0][0] = colors[level % LEVEL_COLORS][0]; - checkers[0][1] = colors[level % LEVEL_COLORS][1]; - checkers[0][2] = colors[level % LEVEL_COLORS][2]; - checkers[1][0] = colors[level % LEVEL_COLORS][0] * 0.5; - checkers[1][1] = colors[level % LEVEL_COLORS][1] * 0.5; - checkers[1][2] = colors[level % LEVEL_COLORS][2] * 0.5; - } - else { - checkers[0][0] = colors[level % LEVEL_COLORS][0]; - checkers[0][1] = colors[level % LEVEL_COLORS][1]; - checkers[0][2] = colors[level % LEVEL_COLORS][2]; - checkers[1][0] = colors[level % LEVEL_COLORS][0]; - checkers[1][1] = colors[level % LEVEL_COLORS][1]; - checkers[1][2] = colors[level % LEVEL_COLORS][2]; - } - - if ( divisor == 0 ) { - divisor = 1; - - checkers[0][0] = (checkers[0][0] + checkers[1][0]) / 2; - checkers[0][1] = (checkers[0][0] + checkers[1][0]) / 2; - checkers[0][2] = (checkers[0][0] + checkers[1][0]) / 2; - checkers[1][0] = checkers[0][0]; - checkers[1][1] = checkers[0][1]; - checkers[1][2] = checkers[0][2]; - } - - - for ( i = 0 ; i < size ; i++ ) { - for ( j = 0 ; j < size ; j++ ) { - const unsigned idx = ((i ^ j) / divisor) & 1; - - tex[ ((i * size) + j) * 3 + 0] = checkers[ idx ][0]; - tex[ ((i * size) + j) * 3 + 1] = checkers[ idx ][1]; - tex[ ((i * size) + j) * 3 + 2] = checkers[ idx ][2]; - } - } - - glTexImage2D( GL_TEXTURE_2D, level, GL_RGB, size, size, 0, - GL_RGB, GL_FLOAT, tex ); - level++; - } - - free( tex ); -} - - -int main( int argc, char ** argv ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 800, 600 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow( "Texture Filter Test" ); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - - Init(); - - printf("\nUse the right-button menu to select the texture and filter mode.\n"); - printf("Use 'A' and 'a' to increase and decrease the aniotropy.\n"); - printf("Use 'S' and 's' to increase and decrease the number of cylinder segments.\n"); - printf("Use 'q' to exit.\n\n"); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/texgenmix.c b/progs/tests/texgenmix.c deleted file mode 100644 index be8f6775c70..00000000000 --- a/progs/tests/texgenmix.c +++ /dev/null @@ -1,640 +0,0 @@ - -/* - * Demonstrates mixed texgen/non-texgen texture coordinates. - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <GL/glut.h> - -#undef max -#undef min -#define max( a, b ) ((a) >= (b) ? (a) : (b)) -#define min( a, b ) ((a) <= (b) ? (a) : (b)) - -GLfloat labelColor0[4] = { 1.0, 1.0, 1.0, 1.0 }; -GLfloat labelColor1[4] = { 1.0, 1.0, 0.4, 1.0 }; -GLfloat *labelInfoColor = labelColor0; - -GLboolean doubleBuffered = GL_TRUE; -GLboolean drawTextured = GL_TRUE; - -int textureWidth = 64; -int textureHeight = 64; - -int winWidth = 580, winHeight = 720; - -const GLfloat texmat_swap_rq[16] = { 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 1.0, - 0.0, 0.0, 1.0, 0.0}; - -const GLfloat nullPlane[4] = { 0.0, 0.0, 0.0, 0.0 }; -const GLfloat ObjPlaneS1[4] = { 1.0, 0.0, 1.0, 0.0 }; -const GLfloat ObjPlaneS2[4] = { 0.5, 0.0, 0.0, 0.0 }; -const GLfloat ObjPlaneS3[4] = { 1.0, 0.0, 0.0, 0.0 }; -const GLfloat ObjPlaneT[4] = { 0.0, 1.0, 0.0, 0.0 }; -const GLfloat ObjPlaneT2[4] = { 0.0, 0.5, 0.0, 0.0 }; -const GLfloat ObjPlaneT3[4] = { 0.0, 1.0, 0.0, 0.0 }; -const GLfloat ObjPlaneR[4] = { 0.0, 0.0, 1.0, 0.0 }; -const GLfloat ObjPlaneQ[4] = { 0.0, 0.0, 0.0, 0.5 }; - - -static void checkErrors( void ) -{ - GLenum error; - - while ( (error = glGetError()) != GL_NO_ERROR ) { - fprintf( stderr, "Error: %s\n", (char *) gluErrorString( error ) ); - } -} - -static void drawString( const char *string, GLfloat x, GLfloat y, - const GLfloat color[4] ) -{ - glColor4fv( color ); - glRasterPos2f( x, y ); - - while ( *string ) { - glutBitmapCharacter( GLUT_BITMAP_TIMES_ROMAN_10, *string ); - string++; - } -} - -static void begin2D( int width, int height ) -{ - glMatrixMode( GL_PROJECTION ); - - glPushMatrix(); - glLoadIdentity(); - - glOrtho( 0, width, 0, height, -1, 1 ); - glMatrixMode( GL_MODELVIEW ); - - glPushMatrix(); - glLoadIdentity(); -} - -static void end2D( void ) -{ - glMatrixMode( GL_PROJECTION ); - glPopMatrix(); - glMatrixMode( GL_MODELVIEW ); - glPopMatrix(); -} - -static void initialize( void ) -{ - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - - glOrtho( -1.5, 1.5, -1.5, 1.5, -1.5, 1.5 ); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - glShadeModel( GL_FLAT ); -} - -/* ARGSUSED1 */ -static void keyboard( unsigned char c, int x, int y ) -{ - switch ( c ) { - case 't': - drawTextured = !drawTextured; - break; - case 27: /* Escape key should force exit. */ - exit(0); - break; - default: - break; - } - glutPostRedisplay(); -} - -/* ARGSUSED1 */ -static void special( int key, int x, int y ) -{ - switch ( key ) { - case GLUT_KEY_DOWN: - break; - case GLUT_KEY_UP: - break; - case GLUT_KEY_LEFT: - break; - case GLUT_KEY_RIGHT: - break; - default: - break; - } - glutPostRedisplay(); -} - -static void -reshape( int w, int h ) -{ - winWidth = w; - winHeight = h; - /* No need to call glViewPort here since "draw" calls it! */ -} - -static void loadTexture( int width, int height ) -{ - int alphaSize = 1; - int rgbSize = 3; - GLubyte *texImage, *p; - int elementsPerGroup, elementSize, groupSize, rowSize; - int i, j; - - - elementsPerGroup = alphaSize + rgbSize; - elementSize = sizeof(GLubyte); - groupSize = elementsPerGroup * elementSize; - rowSize = width * groupSize; - - if ( (texImage = (GLubyte *) malloc( height * rowSize ) ) == NULL ) { - fprintf( stderr, "texture malloc failed\n" ); - return; - } - - for ( i = 0 ; i < height ; i++ ) - { - p = texImage + i * rowSize; - - for ( j = 0 ; j < width ; j++ ) - { - if ( rgbSize > 0 ) - { - /** - ** +-----+-----+ - ** | | | - ** | R | G | - ** | | | - ** +-----+-----+ - ** | | | - ** | Y | B | - ** | | | - ** +-----+-----+ - **/ - if ( i > height / 2 ) { - if ( j < width / 2 ) { - p[0] = 0xff; - p[1] = 0x00; - p[2] = 0x00; - } else { - p[0] = 0x00; - p[1] = 0xff; - p[2] = 0x00; - } - } else { - if ( j < width / 2 ) { - p[0] = 0xff; - p[1] = 0xff; - p[2] = 0x00; - } else { - p[0] = 0x00; - p[1] = 0x00; - p[2] = 0xff; - } - } - p += 3 * elementSize; - } - - if ( alphaSize > 0 ) - { - /** - ** +-----------+ - ** | W | - ** | +-----+ | - ** | | | | - ** | | B | | - ** | | | | - ** | +-----+ | - ** | | - ** +-----------+ - **/ - int i2 = i - height / 2; - int j2 = j - width / 2; - int h8 = height / 8; - int w8 = width / 8; - if ( -h8 <= i2 && i2 <= h8 && -w8 <= j2 && j2 <= w8 ) { - p[0] = 0x00; - } else if ( -2 * h8 <= i2 && i2 <= 2 * h8 && -2 * w8 <= j2 && j2 <= 2 * w8 ) { - p[0] = 0x55; - } else if ( -3 * h8 <= i2 && i2 <= 3 * h8 && -3 * w8 <= j2 && j2 <= 3 * w8 ) { - p[0] = 0xaa; - } else { - p[0] = 0xff; - } - p += elementSize; - } - } - } - - glTexImage2D( GL_TEXTURE_2D, 0, - GL_RGBA, width, height, 0, - GL_RGBA, GL_UNSIGNED_BYTE, texImage ); - - free( texImage ); -} - - -static void drawSample( int x, int y, int w, int h, - int texgenenabled, int coordnr ) -{ - char buf[255]; - - glViewport( x, y, w, h ); - glScissor( x, y, w, h ); - - glClearColor( 0.1, 0.1, 0.1, 1.0 ); - glClear( GL_COLOR_BUFFER_BIT ); - - begin2D( w, h ); - if (texgenenabled == 2) { - sprintf( buf, "TexCoord%df", coordnr); - drawString( buf, 10, h - 15, labelInfoColor ); - sprintf( buf, "texgen enabled for %s coordinate(s)", coordnr == 2 ? "S" : "S/T"); - drawString( buf, 10, 5, labelInfoColor ); - } - else if (texgenenabled == 0) { - sprintf( buf, "TexCoord%df", coordnr); - drawString( buf, 10, h - 15, labelInfoColor ); - drawString( "no texgen", 10, 5, labelInfoColor ); - } - else if (texgenenabled == 1) { - drawString( "no TexCoord", 10, h - 15, labelInfoColor ); - sprintf( buf, "texgen enabled for %s coordinate(s)", - coordnr == 2 ? "S/T" : (coordnr == 3 ? "S/T/R" : "S/T/R/Q")); - drawString( buf, 10, 5, labelInfoColor ); - } - - end2D(); - - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); - - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); - - loadTexture( textureWidth, textureHeight ); - - if ( drawTextured ) { - glEnable( GL_TEXTURE_2D ); - } - - glDisable( GL_TEXTURE_GEN_S ); - glDisable( GL_TEXTURE_GEN_T ); - glDisable( GL_TEXTURE_GEN_R ); - glDisable( GL_TEXTURE_GEN_Q ); - - glMatrixMode( GL_TEXTURE ); - glLoadIdentity(); - glMatrixMode( GL_MODELVIEW ); - glPushMatrix(); - - switch (coordnr) { - case 2: - switch (texgenenabled) { - case 0: - glBegin( GL_QUADS ); - glTexCoord2f( 0.0, 0.0 ); - glVertex2f( -0.8, -0.8 ); - - glTexCoord2f( 1.0, 0.0 ); - glVertex2f( 0.8, -0.8 ); - - glTexCoord2f( 1.0, 1.0 ); - glVertex2f( 0.8, 0.8 ); - - glTexCoord2f( 0.0, 1.0 ); - glVertex2f( -0.8, 0.8 ); - glEnd(); - break; - case 1: - glTranslatef( -0.8, -0.8, 0.0 ); - glScalef( 1.6, 1.6, 1.0 ); - glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS3); - glTexGenfv(GL_T, GL_OBJECT_PLANE, ObjPlaneT3); - glTexGenfv(GL_R, GL_OBJECT_PLANE, nullPlane); - glTexGenfv(GL_Q, GL_OBJECT_PLANE, nullPlane); - - glEnable( GL_TEXTURE_GEN_S ); - glEnable( GL_TEXTURE_GEN_T ); - - /* Issue a texcoord here to be sure Q isn't left over from a - * previous sample. - */ - glTexCoord1f( 0.0 ); - glBegin( GL_QUADS ); - glVertex2f( 0.0, 0.0 ); - glVertex2f( 1.0, 0.0 ); - glVertex2f( 1.0, 1.0 ); - glVertex2f( 0.0, 1.0 ); - glEnd(); - break; - case 2: - /* make sure that texgen T and non-texgen S coordinate are wrong */ - glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS1); - glTexGenfv(GL_T, GL_OBJECT_PLANE, nullPlane); - glTexGenfv(GL_R, GL_OBJECT_PLANE, nullPlane); - glTexGenfv(GL_Q, GL_OBJECT_PLANE, nullPlane); - - glEnable( GL_TEXTURE_GEN_S ); - - glBegin( GL_QUADS ); - /* use z coordinate to get correct texgen values... */ - glTexCoord2f( 0.0, 0.0 ); - glVertex3f( -0.8, -0.8, 0.8 ); - - glTexCoord2f( 0.0, 0.0 ); - glVertex3f( 0.8, -0.8, 0.2 ); - - glTexCoord2f( 0.0, 1.0 ); - glVertex3f( 0.8, 0.8, 0.2 ); - - glTexCoord2f( 0.0, 1.0 ); - glVertex3f( -0.8, 0.8, 0.8 ); - glEnd(); - break; - } - break; - case 3: - glMatrixMode( GL_TEXTURE ); - glLoadMatrixf( texmat_swap_rq ); - glMatrixMode( GL_MODELVIEW ); - glTranslatef( -0.8, -0.8, 0.0 ); - glScalef( 1.6, 1.6, 1.0 ); - switch (texgenenabled) { - case 0: - glBegin( GL_QUADS ); - glTexCoord3f( 0.0, 0.0, 0.5 ); - glVertex2f( 0.0, 0.0 ); - - glTexCoord3f( 0.5, 0.0, 0.5 ); - glVertex2f( 1.0, 0.0 ); - - glTexCoord3f( 0.5, 0.5, 0.5 ); - glVertex2f( 1.0, 1.0 ); - - glTexCoord3f( 0.0, 0.5, 0.5 ); - glVertex2f( 0.0, 1.0 ); - glEnd(); - break; - case 1: - glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS2); - glTexGenfv(GL_T, GL_OBJECT_PLANE, ObjPlaneT2); - glTexGenfv(GL_R, GL_OBJECT_PLANE, ObjPlaneR); - glTexGenfv(GL_Q, GL_OBJECT_PLANE, nullPlane); - - glEnable( GL_TEXTURE_GEN_S ); - glEnable( GL_TEXTURE_GEN_T ); - glEnable( GL_TEXTURE_GEN_R ); - - glTexCoord1f( 0.0 ); /* to make sure Q is 1.0 */ - glBegin( GL_QUADS ); - glVertex3f( 0.0, 0.0, 0.5 ); - glVertex3f( 1.0, 0.0, 0.5 ); - glVertex3f( 1.0, 1.0, 0.5 ); - glVertex3f( 0.0, 1.0, 0.5 ); - glEnd(); - break; - case 2: - /* make sure that texgen R/Q and non-texgen S/T coordinates are wrong */ - glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS2); - glTexGenfv(GL_T, GL_OBJECT_PLANE, ObjPlaneT2); - glTexGenfv(GL_R, GL_OBJECT_PLANE, nullPlane); - glTexGenfv(GL_Q, GL_OBJECT_PLANE, nullPlane); - - glEnable( GL_TEXTURE_GEN_S ); - glEnable( GL_TEXTURE_GEN_T ); - - glBegin( GL_QUADS ); - glTexCoord3f( 0.0, 0.0, 0.5 ); - glVertex2f( 0.0, 0.0); - - glTexCoord3f( 0.0, 0.0, 0.5 ); - glVertex2f( 1.0, 0.0); - - glTexCoord3f( 0.0, 0.0, 0.5 ); - glVertex2f( 1.0, 1.0); - - glTexCoord3f( 0.0, 0.0, 0.5 ); - glVertex2f( 0.0, 1.0); - glEnd(); - break; - } - break; - case 4: - switch (texgenenabled) { - case 0: - glBegin( GL_QUADS ); - /* don't need r coordinate but still setting it I'm mean */ - glTexCoord4f( 0.0, 0.0, 0.0, 0.5 ); - glVertex2f( -0.8, -0.8 ); - - glTexCoord4f( 0.5, 0.0, 0.2, 0.5 ); - glVertex2f( 0.8, -0.8 ); - - glTexCoord4f( 0.5, 0.5, 0.5, 0.5 ); - glVertex2f( 0.8, 0.8 ); - - glTexCoord4f( 0.0, 0.5, 0.5, 0.5 ); - glVertex2f( -0.8, 0.8 ); - glEnd(); - break; - case 1: - glTranslatef( -0.8, -0.8, 0.0 ); - glScalef( 1.6, 1.6, 1.0 ); - /* make sure that texgen R/Q and non-texgen S/T coordinates are wrong */ - glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS2); - glTexGenfv(GL_T, GL_OBJECT_PLANE, ObjPlaneT2); - glTexGenfv(GL_R, GL_OBJECT_PLANE, ObjPlaneR); - glTexGenfv(GL_Q, GL_OBJECT_PLANE, ObjPlaneQ); - - glEnable( GL_TEXTURE_GEN_S ); - glEnable( GL_TEXTURE_GEN_T ); - glEnable( GL_TEXTURE_GEN_R ); - glEnable( GL_TEXTURE_GEN_Q ); - - glBegin( GL_QUADS ); - glVertex2f( 0.0, 0.0 ); - glVertex2f( 1.0, 0.0 ); - glVertex2f( 1.0, 1.0 ); - glVertex2f( 0.0, 1.0 ); - glEnd(); - break; - case 2: - glTranslatef( -0.8, -0.8, 0.0 ); - glScalef( 1.6, 1.6, 1.0 ); - /* make sure that texgen R/Q and non-texgen S/T coordinates are wrong */ - glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGeni( GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR ); - glTexGenfv(GL_S, GL_OBJECT_PLANE, ObjPlaneS2); - glTexGenfv(GL_T, GL_OBJECT_PLANE, ObjPlaneT2); - glTexGenfv(GL_R, GL_OBJECT_PLANE, nullPlane); - glTexGenfv(GL_Q, GL_OBJECT_PLANE, nullPlane); - - glEnable( GL_TEXTURE_GEN_S ); - glEnable( GL_TEXTURE_GEN_T ); - - glBegin( GL_QUADS ); - glTexCoord4f( 0.0, 0.0, 0.0, 0.5 ); - glVertex2f( 0.0, 0.0 ); - - glTexCoord4f( 0.0, 0.0, 0.2, 0.5 ); - glVertex2f( 1.0, 0.0 ); - - glTexCoord4f( 0.0, 0.0, 0.5, 0.5 ); - glVertex2f( 1.0, 1.0 ); - - glTexCoord4f( 0.0, 0.0, 0.75, 0.5 ); - glVertex2f( 0.0, 1.0 ); - glEnd(); - break; - } - break; - } - - glPopMatrix(); - glDisable( GL_TEXTURE_2D ); - -} - -static void display( void ) -{ - int numX = 3, numY = 3; - float xBase = (float) winWidth * 0.01; - float xOffset = (winWidth - xBase) / numX; - float xSize = max( xOffset - xBase, 1 ); - float yBase = (float) winHeight * 0.01; - float yOffset = (winHeight - yBase) / numY; - float ySize = max( yOffset - yBase, 1 ); - float x, y; - int i, j; - - glViewport( 0, 0, winWidth, winHeight ); - glDisable( GL_SCISSOR_TEST ); - glClearColor( 0.0, 0.0, 0.0, 0.0 ); - glClear( GL_COLOR_BUFFER_BIT ); - glEnable( GL_SCISSOR_TEST ); - - x = xBase; - y = (winHeight - 1) - yOffset; - - for ( i = 0 ; i < numY ; i++ ) - { - - labelInfoColor = labelColor1; - - - for ( j = 0 ; j < numX ; j++ ) { - drawSample( x, y, xSize, ySize, i, j+2 ); - x += xOffset; - } - - x = xBase; - y -= yOffset; - } - - if ( doubleBuffered ) { - glutSwapBuffers(); - } else { - glFlush(); - } - - checkErrors(); -} - -static void usage( char *name ) -{ - fprintf( stderr, "usage: %s [ options ]\n", name ); - fprintf( stderr, "\n" ); - fprintf( stderr, "options:\n" ); - fprintf( stderr, " -sb single buffered\n" ); - fprintf( stderr, " -db double buffered\n" ); - fprintf( stderr, " -info print OpenGL driver info\n" ); -} - -static void instructions( void ) -{ - fprintf( stderr, "texgenmix - mixed texgen/non-texgen texture coordinate test\n" ); - fprintf( stderr, "all quads should look the same!\n" ); - fprintf( stderr, "\n" ); - fprintf( stderr, " [t] - toggle texturing\n" ); -} - -int main( int argc, char *argv[] ) -{ - GLboolean info = GL_FALSE; - int i; - - glutInit( &argc, argv ); - - for ( i = 1 ; i < argc ; i++ ) { - if ( !strcmp( "-sb", argv[i] ) ) { - doubleBuffered = GL_FALSE; - } else if ( !strcmp( "-db", argv[i] ) ) { - doubleBuffered = GL_TRUE; - } else if ( !strcmp( "-info", argv[i] ) ) { - info = GL_TRUE; - } else { - usage( argv[0] ); - exit( 1 ); - } - } - - if ( doubleBuffered ) { - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - } else { - glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE ); - } - - glutInitWindowSize( winWidth, winHeight ); - glutInitWindowPosition( 0, 0 ); - glutCreateWindow( "Mixed texgen/non-texgen texture coordinate test" ); - - initialize(); - instructions(); - - if ( info ) { - printf( "\n" ); - printf( "GL_RENDERER = %s\n", (char *) glGetString( GL_RENDERER ) ); - printf( "GL_VERSION = %s\n", (char *) glGetString( GL_VERSION ) ); - printf( "GL_VENDOR = %s\n", (char *) glGetString( GL_VENDOR ) ) ; - printf( "GL_EXTENSIONS = %s\n", (char *) glGetString( GL_EXTENSIONS ) ); - } - - glutDisplayFunc( display ); - glutReshapeFunc( reshape ); - glutKeyboardFunc( keyboard ); - glutSpecialFunc( special ); - glutMainLoop(); - - return 0; -} diff --git a/progs/tests/texline.c b/progs/tests/texline.c deleted file mode 100644 index bf09b87284d..00000000000 --- a/progs/tests/texline.c +++ /dev/null @@ -1,269 +0,0 @@ -/* $Id: texline.c,v 1.5 2004-01-28 10:07:48 keithw Exp $ */ - -/* - * Test textured lines. - * - * Brian Paul - * September 2000 - */ - - -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> -#include "../util/readtex.c" /* I know, this is a hack. */ - -#define TEXTURE_FILE "../images/girl.rgb" - -static GLboolean Antialias = GL_FALSE; -static GLboolean Animate = GL_FALSE; -static GLint Texture = 1; -static GLboolean Stipple = GL_FALSE; -static GLfloat LineWidth = 1.0; - -static GLfloat Xrot = -60.0, Yrot = 0.0, Zrot = 0.0; -static GLfloat DYrot = 1.0; -static GLboolean Points = GL_FALSE; -static GLfloat Scale = 1.0; - -static void Idle( void ) -{ - if (Animate) { - Zrot += DYrot; - glutPostRedisplay(); - } -} - - -static void Display( void ) -{ - GLfloat x, y, s, t; - - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glScalef(Scale, Scale, Scale); - - if (Texture) - glColor3f(1, 1, 1); - - if (Points) { - glBegin(GL_POINTS); - for (t = 0.0; t <= 1.0; t += 0.025) { - for (s = 0.0; s <= 1.0; s += 0.025) { - x = s * 2.0 - 1.0; - y = t * 2.0 - 1.0; - if (!Texture) - glColor3f(1, 0, 1); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, t, s); - glTexCoord2f(s, t); - glVertex2f(x, y); - } - } - glEnd(); - } - else { - glBegin(GL_LINES); - for (t = 0.0; t <= 1.0; t += 0.025) { - x = t * 2.0 - 1.0; - if (!Texture) - glColor3f(1, 0, 1); - glTexCoord2f(t, 0.0); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, t); - glVertex2f(x, -1.0); - if (!Texture) - glColor3f(0, 1, 0); - glTexCoord2f(t, 1.0); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, t); - glVertex2f(x, 1.0); - } - glEnd(); - } - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, 10.0, 100.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -12.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'a': - Antialias = !Antialias; - if (Antialias) { - glEnable(GL_LINE_SMOOTH); - glEnable(GL_POINT_SMOOTH); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - } - else { - glDisable(GL_LINE_SMOOTH); - glDisable(GL_POINT_SMOOTH); - glDisable(GL_BLEND); - } - break; - case 't': - Texture++; - if (Texture > 2) - Texture = 0; - if (Texture == 0) { - glActiveTextureARB(GL_TEXTURE0_ARB); - glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE1_ARB); - glDisable(GL_TEXTURE_2D); - } - else if (Texture == 1) { - glActiveTextureARB(GL_TEXTURE0_ARB); - glEnable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE1_ARB); - glDisable(GL_TEXTURE_2D); - } - else { - glActiveTextureARB(GL_TEXTURE0_ARB); - glEnable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE1_ARB); - glEnable(GL_TEXTURE_2D); - } - break; - case 'w': - LineWidth -= 0.25; - if (LineWidth < 0.25) - LineWidth = 0.25; - glLineWidth(LineWidth); - glPointSize(LineWidth); - break; - case 'W': - LineWidth += 0.25; - if (LineWidth > 8.0) - LineWidth = 8.0; - glLineWidth(LineWidth); - glPointSize(LineWidth); - break; - case 'p': - Points = !Points; - break; - case 's': - Stipple = !Stipple; - if (Stipple) - glEnable(GL_LINE_STIPPLE); - else - glDisable(GL_LINE_STIPPLE); - break; - case ' ': - Animate = !Animate; - if (Animate) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 27: - exit(0); - break; - } - printf("LineWidth, PointSize = %f\n", LineWidth); - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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( int argc, char *argv[] ) -{ - GLuint u; - for (u = 0; u < 2; u++) { - glActiveTextureARB(GL_TEXTURE0_ARB + u); - glBindTexture(GL_TEXTURE_2D, 10+u); - if (u == 0) - glEnable(GL_TEXTURE_2D); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - if (u == 0) - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - else - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) { - printf("Error: couldn't load texture image\n"); - exit(1); - } - } - - glLineStipple(1, 0xff); - - if (argc > 1 && strcmp(argv[1], "-info")==0) { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - } -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition(0, 0); - glutInitWindowSize( 400, 300 ); - - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - - glutCreateWindow(argv[0] ); - - Init(argc, argv); - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Animate) - glutIdleFunc( Idle ); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/texobjshare.c b/progs/tests/texobjshare.c deleted file mode 100644 index 2b31cb6c4d3..00000000000 --- a/progs/tests/texobjshare.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Create several OpenGL rendering contexts, sharing textures, display - * lists, etc. Exercise binding, deleting, etc. - * - * Brian Paul - * 21 December 2004 - */ - - -#include <GL/gl.h> -#include <GL/glx.h> -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <X11/keysym.h> - - -/* - * Each display/window/context: - */ -struct context { - char DisplayName[1000]; - Display *Dpy; - Window Win; - GLXContext Context; -}; - - -#define MAX_CONTEXTS 200 -static struct context Contexts[MAX_CONTEXTS]; -static int NumContexts = 0; - - -static void -Error(const char *display, const char *msg) -{ - fprintf(stderr, "Error on display %s - %s\n", display, msg); - exit(1); -} - - -static struct context * -CreateContext(const char *displayName, const char *name) -{ - Display *dpy; - Window win; - GLXContext ctx; - int attrib[] = { GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DOUBLEBUFFER, - None }; - int scrnum; - XSetWindowAttributes attr; - unsigned long mask; - Window root; - XVisualInfo *visinfo; - int width = 90, height = 90; - int xpos = 0, ypos = 0; - - if (NumContexts >= MAX_CONTEXTS) - return NULL; - - dpy = XOpenDisplay(displayName); - if (!dpy) { - Error(displayName, "Unable to open display"); - return NULL; - } - - scrnum = DefaultScreen(dpy); - root = RootWindow(dpy, scrnum); - - visinfo = glXChooseVisual(dpy, scrnum, attrib); - if (!visinfo) { - Error(displayName, "Unable to find RGB, double-buffered visual"); - return NULL; - } - - /* window attributes */ - xpos = (NumContexts % 10) * 100; - ypos = (NumContexts / 10) * 100; - attr.background_pixel = 0; - attr.border_pixel = 0; - attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone); - attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask; - mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - - win = XCreateWindow(dpy, root, xpos, ypos, width, height, - 0, visinfo->depth, InputOutput, - visinfo->visual, mask, &attr); - if (!win) { - Error(displayName, "Couldn't create window"); - return NULL; - } - - { - XSizeHints sizehints; - sizehints.x = xpos; - sizehints.y = ypos; - sizehints.width = width; - sizehints.height = height; - sizehints.flags = USSize | USPosition; - XSetNormalHints(dpy, win, &sizehints); - XSetStandardProperties(dpy, win, name, name, - None, (char **)NULL, 0, &sizehints); - } - - if (NumContexts == 0) { - ctx = glXCreateContext(dpy, visinfo, NULL, True); - } - else { - /* share textures & dlists with 0th context */ - ctx = glXCreateContext(dpy, visinfo, Contexts[0].Context, True); - } - if (!ctx) { - Error(displayName, "Couldn't create GLX context"); - return NULL; - } - - XMapWindow(dpy, win); - - if (!glXMakeCurrent(dpy, win, ctx)) { - Error(displayName, "glXMakeCurrent failed"); - return NULL; - } - - if (NumContexts == 0) { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - } - - /* save the info for this context */ - { - struct context *h = &Contexts[NumContexts]; - strcpy(h->DisplayName, name); - h->Dpy = dpy; - h->Win = win; - h->Context = ctx; - NumContexts++; - return &Contexts[NumContexts-1]; - } -} - - -static void -MakeCurrent(int i) -{ - if (!glXMakeCurrent(Contexts[i].Dpy, Contexts[i].Win, Contexts[i].Context)) { - fprintf(stderr, "glXMakeCurrent failed!\n"); - } -} - - - -static void -DestroyContext(int i) -{ - XDestroyWindow(Contexts[i].Dpy, Contexts[i].Win); - glXDestroyContext(Contexts[i].Dpy, Contexts[i].Context); - XCloseDisplay(Contexts[i].Dpy); -} - - -int -main(int argc, char *argv[]) -{ - char *dpyName = NULL; - int i; - GLuint t; - GLint tb; - - for (i = 0; i < 2; i++) { - CreateContext(dpyName, "context"); - } - - /* Create texture and bind it in context 0 */ - MakeCurrent(0); - glGenTextures(1, &t); - printf("Generated texture ID %u\n", t); - assert(!glIsTexture(t)); - glBindTexture(GL_TEXTURE_2D, t); - assert(glIsTexture(t)); - glGetIntegerv(GL_TEXTURE_BINDING_2D, &tb); - assert(tb == t); - - /* Bind texture in context 1 */ - MakeCurrent(1); - assert(glIsTexture(t)); - glBindTexture(GL_TEXTURE_2D, t); - glGetIntegerv(GL_TEXTURE_BINDING_2D, &tb); - assert(tb == t); - - /* Delete texture from context 0 */ - MakeCurrent(0); - glDeleteTextures(1, &t); - assert(!glIsTexture(t)); - glGetIntegerv(GL_TEXTURE_BINDING_2D, &tb); - printf("After delete, binding = %d\n", tb); - - /* Check texture state from context 1 */ - MakeCurrent(1); - assert(!glIsTexture(t)); - glGetIntegerv(GL_TEXTURE_BINDING_2D, &tb); - printf("In second context, binding = %d\n", tb); - glBindTexture(GL_TEXTURE_2D, 0); - glGetIntegerv(GL_TEXTURE_BINDING_2D, &tb); - assert(tb == 0); - - - for (i = 0; i < NumContexts; i++) { - DestroyContext(i); - } - - printf("Success!\n"); - - return 0; -} diff --git a/progs/tests/texrect.c b/progs/tests/texrect.c deleted file mode 100644 index 3035224816f..00000000000 --- a/progs/tests/texrect.c +++ /dev/null @@ -1,360 +0,0 @@ -/* $Id: texrect.c,v 1.5 2004-05-06 20:27:32 brianp Exp $ */ - -/* GL_NV_texture_rectangle test - * - * Brian Paul - * 14 June 2002 - */ - - -#define GL_GLEXT_PROTOTYPES -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <GL/glut.h> -#include "readtex.h" - -#define TEXTURE_0_FILE "../images/girl.rgb" -#define TEXTURE_1_FILE "../images/reflect.rgb" - -#define TEX0 1 -#define TEX7 8 -#define ANIMATE 10 -#define CLAMP 20 -#define CLAMP_TO_EDGE 21 -#define CLAMP_TO_BORDER 22 -#define LINEAR_FILTER 30 -#define NEAREST_FILTER 31 -#define QUIT 100 - -static GLboolean Animate = GL_FALSE; -static GLint NumUnits = 2; -static GLboolean TexEnabled[8]; -static GLint Width[8], Height[8]; /* image sizes */ -static GLenum Format[8]; - -static GLfloat Xrot = 00.0, Yrot = 00.0, Zrot = 0.0; - - -static void Idle( void ) -{ - Zrot = glutGet(GLUT_ELAPSED_TIME) * 0.01; - glutPostRedisplay(); -} - - -static void DrawObject(void) -{ - GLint i; - GLfloat d = 10; /* so we can see how borders are handled */ - - glColor3f(.1, .1, .1); /* modulate this */ - - glPushMatrix(); - - glRotatef(Zrot, 0, 0, 1); - - glBegin(GL_QUADS); - - for (i = 0; i < NumUnits; i++) - glMultiTexCoord2fARB(GL_TEXTURE0_ARB + i, -d, -d); - glVertex2f(-1.0, -1.0); - - for (i = 0; i < NumUnits; i++) - glMultiTexCoord2fARB(GL_TEXTURE0_ARB + i, Width[i]+d, -d); - glVertex2f(1.0, -1.0); - - for (i = 0; i < NumUnits; i++) - glMultiTexCoord2fARB(GL_TEXTURE0_ARB + i, Width[i]+d, Height[i]+d); - glVertex2f(1.0, 1.0); - - for (i = 0; i < NumUnits; i++) - glMultiTexCoord2fARB(GL_TEXTURE0_ARB + i, -d, Height[i]+d); - glVertex2f(-1.0, 1.0); - - glEnd(); - glPopMatrix(); -} - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glScalef(5.0, 5.0, 5.0); - DrawObject(); - glPopMatrix(); - - glutSwapBuffers(); -} - - -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, 100.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -35.0 ); -} - - -static void ModeMenu(int entry) -{ - GLint i; - if (entry >= TEX0 && entry < TEX0 + NumUnits) { - /* toggle */ - i = entry - TEX0; - TexEnabled[i] = !TexEnabled[i]; - glActiveTextureARB(GL_TEXTURE0_ARB + i); - if (TexEnabled[i]) { - glEnable(GL_TEXTURE_RECTANGLE_NV); - } - else { - glDisable(GL_TEXTURE_RECTANGLE_NV); - } - printf("Enabled: "); - for (i = 0; i < NumUnits; i++) - printf("%d ", (int) TexEnabled[i]); - printf("\n"); - } - else if (entry==ANIMATE) { - Animate = !Animate; - if (Animate) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - } - else if (entry==CLAMP) { - for (i = 0; i < NumUnits; i++) { - glActiveTextureARB(GL_TEXTURE0_ARB + i); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_T, GL_CLAMP); - } - } - else if (entry==CLAMP_TO_EDGE) { - for (i = 0; i < NumUnits; i++) { - glActiveTextureARB(GL_TEXTURE0_ARB + i); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - } - } - else if (entry==CLAMP_TO_BORDER) { - for (i = 0; i < NumUnits; i++) { - glActiveTextureARB(GL_TEXTURE0_ARB + i); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); - } - } - else if (entry==NEAREST_FILTER) { - for (i = 0; i < NumUnits; i++) { - glActiveTextureARB(GL_TEXTURE0_ARB + i); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - } - else if (entry==LINEAR_FILTER) { - for (i = 0; i < NumUnits; i++) { - glActiveTextureARB(GL_TEXTURE0_ARB + i); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - } - - else if (entry==QUIT) { - exit(0); - } - - glutPostRedisplay(); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'z': - Zrot -= 1.0; - break; - case 'Z': - Zrot += 1.0; - break; - case 'a': - Animate = !Animate; - if (Animate) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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( int argc, char *argv[] ) -{ - const GLenum wrap = GL_CLAMP; - GLuint texObj[8]; - GLint size, i; - - if (!glutExtensionSupported("GL_ARB_multitexture")) { - printf("Sorry, GL_ARB_multitexture needed by this program\n"); - exit(1); - } - - if (!glutExtensionSupported("GL_NV_texture_rectangle")) { - printf("Sorry, GL_NV_texture_rectangle needed by this program\n"); - exit(1); - } - - glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &NumUnits); - printf("%d texture units supported, using 2.\n", NumUnits); - if (NumUnits > 2) - NumUnits = 2; - - glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_NV, &size); - printf("%d x %d max texture rectangle size\n", size, size); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - for (i = 0; i < NumUnits; i++) { - TexEnabled[i] = GL_TRUE; - } - - /* allocate two texture objects */ - glGenTextures(NumUnits, texObj); - - /* setup the texture objects */ - for (i = 0; i < NumUnits; i++) { - - glActiveTextureARB(GL_TEXTURE0_ARB + i); - - glBindTexture(GL_TEXTURE_RECTANGLE_NV, texObj[i]); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, - GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, - GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_S, wrap); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_T, wrap); - - if (i == 0) { - GLubyte *img = LoadRGBImage(TEXTURE_0_FILE, &Width[0], &Height[0], - &Format[0]); - if (!img) { - printf("Error: couldn't load texture image\n"); - exit(1); - } - printf("Texture %d: %s (%d x %d)\n", i, - TEXTURE_0_FILE, Width[0], Height[0]); - glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, GL_RGB, - Width[0], Height[0], 0, - Format[0], GL_UNSIGNED_BYTE, img); - } - else { - GLubyte *img = LoadRGBImage(TEXTURE_1_FILE, &Width[1], &Height[1], - &Format[1]); - if (!img) { - printf("Error: couldn't load texture image\n"); - exit(1); - } - printf("Texture %d: %s (%d x %d)\n", i, - TEXTURE_1_FILE, Width[1], Height[1]); - glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, GL_RGB, - Width[1], Height[1], 0, - Format[1], GL_UNSIGNED_BYTE, img); - } - - if (i < 1) - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); - else - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); - - if (TexEnabled[i]) - glEnable(GL_TEXTURE_RECTANGLE_NV); - } - - glShadeModel(GL_FLAT); - glClearColor(0.3, 0.3, 0.4, 1.0); - - if (argc > 1 && strcmp(argv[1], "-info")==0) { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - } -} - - -int main( int argc, char *argv[] ) -{ - GLint i; - - glutInit( &argc, argv ); - glutInitWindowSize( 300, 300 ); - glutInitWindowPosition( 0, 0 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0] ); - - Init( argc, argv ); - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Animate) - glutIdleFunc( Idle ); - - glutCreateMenu(ModeMenu); - - for (i = 0; i < NumUnits; i++) { - char s[100]; - sprintf(s, "Toggle Texture %d", i); - glutAddMenuEntry(s, TEX0 + i); - } - glutAddMenuEntry("Toggle Animation", ANIMATE); - glutAddMenuEntry("GL_CLAMP", CLAMP); - glutAddMenuEntry("GL_CLAMP_TO_EDGE", CLAMP_TO_EDGE); - glutAddMenuEntry("GL_CLAMP_TO_BORDER", CLAMP_TO_BORDER); - glutAddMenuEntry("GL_NEAREST", NEAREST_FILTER); - glutAddMenuEntry("GL_LINEAR", LINEAR_FILTER); - glutAddMenuEntry("Quit", QUIT); - glutAttachMenu(GLUT_RIGHT_BUTTON); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/texwrap.c b/progs/tests/texwrap.c deleted file mode 100644 index b888dcd100c..00000000000 --- a/progs/tests/texwrap.c +++ /dev/null @@ -1,304 +0,0 @@ -/* $Id: texwrap.c,v 1.8 2005-08-25 03:09:12 brianp Exp $ */ - -/* - * Test texture wrap modes. - * Press 'b' to toggle texture image borders. You should see the same - * rendering whether or not you're using borders. - * - * Brian Paul March 2001 - */ - - -#define GL_GLEXT_PROTOTYPES -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <GL/glut.h> - - -#ifndef GL_CLAMP_TO_BORDER -#define GL_CLAMP_TO_BORDER 0x812D -#endif - -#ifndef GL_MIRRORED_REPEAT -#define GL_MIRRORED_REPEAT 0x8370 -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif - -#define BORDER_TEXTURE 1 -#define NO_BORDER_TEXTURE 2 - -#define SIZE 8 -static GLubyte BorderImage[SIZE+2][SIZE+2][4]; -static GLubyte NoBorderImage[SIZE][SIZE][4]; -static GLuint Border = 0; - -#define TILE_SIZE 110 - -#define WRAP_MODE(m) { m , # m, GL_TRUE, 1.0, { NULL, NULL } } -#define WRAP_EXT(m,e1,e2,v) { m , # m, GL_FALSE, v, { e1, e2 } } - -struct wrap_mode { - GLenum mode; - const char * name; - GLboolean supported; - GLfloat version; - const char * extension_names[2]; -}; - -static struct wrap_mode modes[] = { - WRAP_MODE( GL_REPEAT ), - WRAP_MODE( GL_CLAMP ), - WRAP_EXT ( GL_CLAMP_TO_EDGE, "GL_EXT_texture_edge_clamp", - "GL_SGIS_texture_edge_clamp", - 1.2 ), - WRAP_EXT ( GL_CLAMP_TO_BORDER, "GL_ARB_texture_border_clamp", - "GL_SGIS_texture_border_clamp", - 1.3 ), - WRAP_EXT ( GL_MIRRORED_REPEAT, "GL_ARB_texture_mirrored_repeat", - "GL_IBM_texture_mirrored_repeat", - 1.4 ), - WRAP_EXT ( GL_MIRROR_CLAMP_EXT, "GL_ATI_texture_mirror_once", - "GL_EXT_texture_mirror_clamp", - 999.0 ), - WRAP_EXT ( GL_MIRROR_CLAMP_TO_BORDER_EXT, "GL_EXT_texture_mirror_clamp", - NULL, - 999.0 ), - WRAP_EXT ( GL_MIRROR_CLAMP_TO_EDGE_EXT, "GL_ATI_texture_mirror_once", - "GL_EXT_texture_mirror_clamp", - 999.0 ), - { 0 } -}; - -static void -PrintString(const char *s) -{ - while (*s) { - glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s); - s++; - } -} - - -static void Display( void ) -{ - GLenum i, j; - GLint offset; - GLfloat version; - - /* Fill in the extensions that are supported. - */ - - version = atof( (char *) glGetString( GL_VERSION ) ); - for ( i = 0 ; modes[i].mode != 0 ; i++ ) { - if ( ((modes[i].extension_names[0] != NULL) - && glutExtensionSupported(modes[i].extension_names[0])) - || ((modes[i].extension_names[1] != NULL) - && glutExtensionSupported(modes[i].extension_names[1])) ) { - modes[i].supported = GL_TRUE; - } - else if ( !modes[i].supported && (modes[i].version <= version) ) { - fprintf( stderr, "WARNING: OpenGL library meets minimum version\n" - " requirement for %s, but the\n" - " extension string is not advertised.\n" - " (%s%s%s)\n", - modes[i].name, - modes[i].extension_names[0], - (modes[i].extension_names[1] != NULL) - ? " or " : "", - (modes[i].extension_names[1] != NULL) - ? modes[i].extension_names[1] : "" ); - modes[i].supported = GL_TRUE; - } - } - - - glClearColor(0.5, 0.5, 0.5, 1.0); - glClear( GL_COLOR_BUFFER_BIT ); - -#if 0 - /* draw texture as image */ - glDisable(GL_TEXTURE_2D); - glWindowPos2iARB(1, 1); - glDrawPixels(6, 6, GL_RGBA, GL_UNSIGNED_BYTE, (void *) TexImage); -#endif - - glBindTexture(GL_TEXTURE_2D, Border ? BORDER_TEXTURE : NO_BORDER_TEXTURE); - - - /* loop over min/mag filters */ - for (i = 0; i < 2; i++) { - offset = 0; - - if (i) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - - /* loop over border modes */ - for (j = 0; modes[j].mode != 0; j++) { - const GLfloat x0 = 0, y0 = 0, x1 = (TILE_SIZE - 10), y1 = (TILE_SIZE - 10); - const GLfloat b = 1.2; - const GLfloat s0 = -b, t0 = -b, s1 = 1.0+b, t1 = 1.0+b; - - if ( modes[j].supported != GL_TRUE ) - continue; - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, modes[j].mode); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, modes[j].mode); - - glPushMatrix(); - glTranslatef(offset * TILE_SIZE + 10, i * TILE_SIZE + 40, 0); - offset++; - - glEnable(GL_TEXTURE_2D); - glColor3f(1, 1, 1); - glBegin(GL_POLYGON); - glTexCoord2f(s0, t0); glVertex2f(x0, y0); - glTexCoord2f(s1, t0); glVertex2f(x1, y0); - glTexCoord2f(s1, t1); glVertex2f(x1, y1); - glTexCoord2f(s0, t1); glVertex2f(x0, y1); - glEnd(); - - /* draw red outline showing bounds of texture at s=0,1 and t=0,1 */ - glDisable(GL_TEXTURE_2D); - glColor3f(1, 0, 0); - glBegin(GL_LINE_LOOP); - glVertex2f(x0 + b * (x1-x0) / (s1-s0), y0 + b * (y1-y0) / (t1-t0)); - glVertex2f(x1 - b * (x1-x0) / (s1-s0), y0 + b * (y1-y0) / (t1-t0)); - glVertex2f(x1 - b * (x1-x0) / (s1-s0), y1 - b * (y1-y0) / (t1-t0)); - glVertex2f(x0 + b * (x1-x0) / (s1-s0), y1 - b * (y1-y0) / (t1-t0)); - glEnd(); - - glPopMatrix(); - } - } - - glDisable(GL_TEXTURE_2D); - glColor3f(1, 1, 1); - offset = 0; - for (i = 0; modes[i].mode != 0; i++) { - if ( modes[i].supported ) { - glWindowPos2iARB( offset * TILE_SIZE + 10, 5 + ((offset & 1) * 15) ); - PrintString(modes[i].name); - offset++; - } - } - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(0, width, 0, height, -1, 1); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'b': - Border = !Border; - printf("Texture Border Size = %d\n", Border); - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - static const GLubyte border[4] = { 0, 255, 0, 255 }; - static const GLfloat borderf[4] = { 0, 1.0, 0, 1.0 }; - GLint i, j; - - for (i = 0; i < SIZE+2; i++) { - for (j = 0; j < SIZE+2; j++) { - if (i == 0 || j == 0 || i == SIZE+1 || j == SIZE+1) { - /* border color */ - BorderImage[i][j][0] = border[0]; - BorderImage[i][j][1] = border[1]; - BorderImage[i][j][2] = border[2]; - BorderImage[i][j][3] = border[3]; - } - else if ((i + j) & 1) { - /* white */ - BorderImage[i][j][0] = 255; - BorderImage[i][j][1] = 255; - BorderImage[i][j][2] = 255; - BorderImage[i][j][3] = 255; - } - else { - /* black */ - BorderImage[i][j][0] = 0; - BorderImage[i][j][1] = 0; - BorderImage[i][j][2] = 0; - BorderImage[i][j][3] = 0; - } - } - } - - glBindTexture(GL_TEXTURE_2D, BORDER_TEXTURE); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE+2, SIZE+2, 1, - GL_RGBA, GL_UNSIGNED_BYTE, (void *) BorderImage); - - for (i = 0; i < SIZE; i++) { - for (j = 0; j < SIZE; j++) { - if ((i + j) & 1) { - /* white */ - NoBorderImage[i][j][0] = 255; - NoBorderImage[i][j][1] = 255; - NoBorderImage[i][j][2] = 255; - NoBorderImage[i][j][3] = 255; - } - else { - /* black */ - NoBorderImage[i][j][0] = 0; - NoBorderImage[i][j][1] = 0; - NoBorderImage[i][j][2] = 0; - NoBorderImage[i][j][3] = 0; - } - } - } - - glBindTexture(GL_TEXTURE_2D, NO_BORDER_TEXTURE); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE, SIZE, 0, - GL_RGBA, GL_UNSIGNED_BYTE, (void *) NoBorderImage); - glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderf); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 1000, 270 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/vparray.c b/progs/tests/vparray.c deleted file mode 100644 index 580a670f8e1..00000000000 --- a/progs/tests/vparray.c +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Test vertex arrays with GL_NV_vertex_program - * - * Based on a stripped-down version of the isosurf demo. - * The vertex program is trivial: compute the resulting - * RGB color as a linear function of vertex XYZ. - */ - -#include <assert.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include "GL/glut.h" - -#define MAXVERTS 10000 -static float data[MAXVERTS][6]; -static GLint numverts; - -static GLfloat xrot; -static GLfloat yrot; -static GLboolean useArrays = GL_TRUE; -static GLboolean useProgram = GL_TRUE; -static GLboolean useList = GL_FALSE; - - -static void read_surface( char *filename ) -{ - FILE *f; - - f = fopen(filename,"r"); - if (!f) { - printf("couldn't read %s\n", filename); - exit(1); - } - - numverts = 0; - while (!feof(f) && numverts < MAXVERTS) { - fscanf( f, "%f %f %f %f %f %f", - &data[numverts][0], &data[numverts][1], &data[numverts][2], - &data[numverts][3], &data[numverts][4], &data[numverts][5] ); - numverts++; - } - numverts--; - - printf("%d vertices, %d triangles\n", numverts, numverts-2); - printf("data = %p\n", (void *) data); - fclose(f); -} - - - - -static void Display(void) -{ - if (useProgram) - glEnable(GL_VERTEX_PROGRAM_NV); - else - glDisable(GL_VERTEX_PROGRAM_NV); - - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(xrot, 1, 0, 0); - glRotatef(yrot, 0, 1, 0); - glScalef(2, 2, 2); - if (useArrays) { - if (useProgram) { - glVertexAttribPointerNV( 0, 3, GL_FLOAT, 6 * sizeof(GLfloat), data ); - glEnableClientState( GL_VERTEX_ATTRIB_ARRAY0_NV ); - glVertexAttribPointerNV( 2, 3, GL_FLOAT, 6 * sizeof(GLfloat), ((GLfloat *) data) + 3); - glEnableClientState( GL_VERTEX_ATTRIB_ARRAY2_NV); - } - else { - glVertexPointer( 3, GL_FLOAT, 6 * sizeof(GLfloat), data ); - glEnableClientState( GL_VERTEX_ARRAY ); - glNormalPointer( GL_FLOAT, 6 * sizeof(GLfloat), ((GLfloat *) data) + 3); - glEnableClientState( GL_NORMAL_ARRAY ); - } - - if (useList) { - /* dumb, but a good test */ - glNewList(1,GL_COMPILE); - glDrawArrays(GL_TRIANGLE_STRIP, 0, numverts); - glEndList(); - glCallList(1); - } - else { - glDrawArrays(GL_TRIANGLE_STRIP, 0, numverts); - } - - glDisableClientState( GL_VERTEX_ATTRIB_ARRAY0_NV ); - glDisableClientState( GL_VERTEX_ATTRIB_ARRAY2_NV); - glDisableClientState( GL_VERTEX_ARRAY ); - glDisableClientState( GL_NORMAL_ARRAY ); - } - else { - int i; - glBegin(GL_TRIANGLE_STRIP); - for (i = 0; i < numverts; i++) { - glNormal3fv( data[i] + 3 ); - glVertex3fv( data[i] + 0 ); - } - glEnd(); - } - glPopMatrix(); - - if (glGetError()) - printf("Error!\n"); - - glutSwapBuffers(); -} - - -static void InitMaterials(void) -{ - static float ambient[] = {0.1, 0.1, 0.1, 1.0}; - static float diffuse[] = {0.5, 1.0, 1.0, 1.0}; - static float position0[] = {0.0, 0.0, 20.0, 0.0}; - static float position1[] = {0.0, 0.0, -20.0, 0.0}; - static float front_mat_shininess[] = {60.0}; - static float front_mat_specular[] = {0.2, 0.2, 0.2, 1.0}; - static float front_mat_diffuse[] = {0.5, 0.28, 0.38, 1.0}; - /* - static float back_mat_shininess[] = {60.0}; - static float back_mat_specular[] = {0.5, 0.5, 0.2, 1.0}; - static float back_mat_diffuse[] = {1.0, 1.0, 0.2, 1.0}; - */ - static float lmodel_ambient[] = {1.0, 1.0, 1.0, 1.0}; - static float lmodel_twoside[] = {GL_FALSE}; - - glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); - glLightfv(GL_LIGHT0, GL_POSITION, position0); - glEnable(GL_LIGHT0); - - glLightfv(GL_LIGHT1, GL_AMBIENT, ambient); - glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse); - glLightfv(GL_LIGHT1, GL_POSITION, position1); - glEnable(GL_LIGHT1); - - glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); - glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside); - - glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_mat_shininess); - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_mat_specular); - glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, front_mat_diffuse); - glEnable(GL_LIGHTING); -} - - -static void init_program(void) -{ - /* - * c[0..3] = modelview matrix - * c[4..7] = inverse modelview matrix - * c[30] = color scale - * c[31] = color bias - */ - static const char prog[] = - "!!VP1.0\n" - - "# RGB is proportional to XYZ \n" - - "MUL R0, v[OPOS], c[30]; \n" - "ADD o[COL0], R0, c[31]; \n" - - "# Continue with typical modelview/projection\n" - "MOV R3, v[OPOS]; \n" - "DP4 o[HPOS].x, c[0], R3 ; # object x MVP -> clip\n" - "DP4 o[HPOS].y, c[1], R3 ;\n" - "DP4 o[HPOS].z, c[2], R3 ;\n" - "DP4 o[HPOS].w, c[3], R3 ;\n" - - "END"; - - static const GLfloat scale[4] = {2.0, 2.0, 2.0, 0.0}; - static const GLfloat bias[4] = {1.0, 1.0, 1.0, 0.0}; - - if (!glutExtensionSupported("GL_NV_vertex_program")) { - printf("Sorry, this program requires GL_NV_vertex_program"); - exit(1); - } - - glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1, - strlen(prog), (const GLubyte *) prog); - assert(glIsProgramNV(1)); - glBindProgramNV(GL_VERTEX_PROGRAM_NV, 1); - - /* Load the program registers */ - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV); - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MODELVIEW, GL_INVERSE_TRANSPOSE_NV); - - glProgramParameter4fvNV(GL_VERTEX_PROGRAM_NV, 30, scale); - glProgramParameter4fvNV(GL_VERTEX_PROGRAM_NV, 31, bias); -} - - -static void init(void) -{ - xrot = 0; - yrot = 0; - glClearColor(0.0, 0.0, 1.0, 0.0); - glEnable( GL_DEPTH_TEST ); - glEnable(GL_NORMALIZE); - InitMaterials(); - read_surface( "../demos/isosurf.dat" ); - init_program(); -} - - -static void Reshape(int width, int height) -{ - glViewport(0, 0, (GLint)width, (GLint)height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum( -1.0, 1.0, -1.0, 1.0, 5, 25 ); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0, 0, -15); -} - - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - case 'a': - useArrays = !useArrays; - printf("use arrays: %s\n", useArrays ? "yes" : "no"); - break; - case 'l': - useList = !useList; - printf("use list: %s\n", useList ? "yes" : "no"); - break; - case 'p': - useProgram = !useProgram; - printf("use program: %s\n", useProgram ? "yes" : "no"); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case GLUT_KEY_LEFT: - yrot -= 15.0; - break; - case GLUT_KEY_RIGHT: - yrot += 15.0; - break; - case GLUT_KEY_UP: - xrot += 15.0; - break; - case GLUT_KEY_DOWN: - xrot -= 15.0; - break; - default: - return; - } - glutPostRedisplay(); -} - - - -int main(int argc, char **argv) -{ - glutInit(&argc, argv); - glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_DOUBLE ); - glutInitWindowPosition(0, 0); - glutInitWindowSize(400, 400); - if (glutCreateWindow("Isosurface") <= 0) { - exit(0); - } - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutSpecialFunc(SpecialKey); - glutDisplayFunc(Display); - - init(); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/vpeval.c b/progs/tests/vpeval.c deleted file mode 100644 index 8b6996d3b5c..00000000000 --- a/progs/tests/vpeval.c +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Vertex program evaluators test. - * Based on book/bezmesh.c - * - * Brian Paul - * 22 June 2002 - */ - -#include <assert.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - -/* - * Transform position by modelview/projection. - * Square incoming color. - */ -static const char prog[] = -"!!VP1.0\n" - -"# Typical modelview/projection\n" -"DP4 o[HPOS].x, c[0], v[OPOS] ; # object x MVP -> clip\n" -"DP4 o[HPOS].y, c[1], v[OPOS] ;\n" -"DP4 o[HPOS].z, c[2], v[OPOS] ;\n" -"DP4 o[HPOS].w, c[3], v[OPOS] ;\n" - -"MOV R0, v[COL0];\n # square the color\n" -"MUL R0, R0, R0;\n" -"MOV o[COL0], R0;\n # store output color\n" - -"END"; - - -static int program = 1; - - -GLfloat ctrlpoints[4][4][4] = -{ - { - {-1.5, -1.5, 4.0, 1.0}, - {-0.5, -1.5, 2.0, 1.0}, - {0.5, -1.5, -1.0, 1.0}, - {1.5, -1.5, 2.0, 1.0}}, - { - {-1.5, -0.5, 1.0, 1.0}, - {-0.5, -0.5, 3.0, 1.0}, - {0.5, -0.5, 0.0, 1.0}, - {1.5, -0.5, -1.0, 1.0}}, - { - {-1.5, 0.5, 4.0, 1.0}, - {-0.5, 0.5, 0.0, 1.0}, - {0.5, 0.5, 3.0, 1.0}, - {1.5, 0.5, 4.0, 1.0}}, - { - {-1.5, 1.5, -2.0, 1.0}, - {-0.5, 1.5, -2.0, 1.0}, - {0.5, 1.5, 0.0, 1.0}, - {1.5, 1.5, -1.0, 1.0}} -}; - -/* - * +-------------+ - * |green |yellow - * | | - * | | - * |black |red - * +-------------+ - */ -GLfloat colorPoints[4][4][4] = -{ - { - {0.0, 0.0, 0.0, 1.0}, - {0.3, 0.0, 0.0, 1.0}, - {0.6, 0.0, 0.0, 1.0}, - {1.0, 0.0, 0.0, 1.0}}, - { - {0.0, 0.3, 0.0, 1.0}, - {0.3, 0.3, 0.0, 1.0}, - {0.6, 0.3, 0.0, 1.0}, - {1.0, 0.3, 0.0, 1.0}}, - { - {0.0, 0.6, 0.0, 1.0}, - {0.3, 0.6, 0.0, 1.0}, - {0.6, 0.6, 0.0, 1.0}, - {1.0, 0.6, 0.0, 1.0}}, - { - {0.0, 1.0, 0.0, 1.0}, - {0.3, 1.0, 0.0, 1.0}, - {0.6, 1.0, 0.0, 1.0}, - {1.0, 1.0, 0.0, 1.0}} -}; - - -void -initlights(void) -{ - GLfloat ambient[] = {0.2, 0.2, 0.2, 1.0}; - GLfloat position[] = {0.0, 0.0, 2.0, 1.0}; - GLfloat mat_diffuse[] = {0.6, 0.6, 0.6, 1.0}; - GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0}; - GLfloat mat_shininess[] = {50.0}; - -#if 0 /* no lighting for now */ - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - - glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); - glLightfv(GL_LIGHT0, GL_POSITION, position); - - glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); - glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); -#endif -} - -void -display(void) -{ - glClearColor(.3, .3, .3, 0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glPushMatrix(); -#if 1 - glRotatef(85.0, 1.0, 1.0, 1.0); -#endif - glEvalMesh2(GL_FILL, 0, 8, 0, 8); - glPopMatrix(); - glFlush(); -} - -void -myinit(int argc, char *argv[]) -{ - glClearColor(0.0, 0.0, 0.0, 1.0); - glEnable(GL_DEPTH_TEST); - - initlights(); /* for lighted version only */ - - glMapGrid2f(8, 0.0, 1.0, 8, 0.0, 1.0); - - if (argc > 1) - program = 0; - - printf("Using vertex program attribs? %s\n", program ? "yes" : "no"); - - if (!program) { - glMap2f(GL_MAP2_VERTEX_4, - 0.0, 1.0, 4, 4, - 0.0, 1.0, 16, 4, &ctrlpoints[0][0][0]); - glMap2f(GL_MAP2_COLOR_4, - 0.0, 1.0, 4, 4, - 0.0, 1.0, 16, 4, &colorPoints[0][0][0]); - glEnable(GL_MAP2_VERTEX_4); - glEnable(GL_MAP2_COLOR_4); - /* - glEnable(GL_AUTO_NORMAL); - glEnable(GL_NORMALIZE); - */ - } - else { - glMap2f(GL_MAP2_VERTEX_ATTRIB0_4_NV, - 0.0, 1.0, 4, 4, - 0.0, 1.0, 16, 4, &ctrlpoints[0][0][0]); - glMap2f(GL_MAP2_VERTEX_ATTRIB3_4_NV, - 0.0, 1.0, 4, 4, - 0.0, 1.0, 16, 4, &colorPoints[0][0][0]); - glEnable(GL_MAP2_VERTEX_ATTRIB0_4_NV); - glEnable(GL_MAP2_VERTEX_ATTRIB3_4_NV); - - /* - glEnable(GL_AUTO_NORMAL); - glEnable(GL_NORMALIZE); - */ - - /* vertex program init */ - glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1, - strlen(prog), (const GLubyte *) prog); - assert(glIsProgramNV(1)); - glBindProgramNV(GL_VERTEX_PROGRAM_NV, 1); - - /* track matrices */ - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV); - glEnable(GL_VERTEX_PROGRAM_NV); - } -} - -void -myReshape(int w, int h) -{ - glViewport(0, 0, w, h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - if (w <= h) - glOrtho(-4.0, 4.0, -4.0 * (GLfloat) h / (GLfloat) w, - 4.0 * (GLfloat) h / (GLfloat) w, -4.0, 4.0); - else - glOrtho(-4.0 * (GLfloat) w / (GLfloat) h, - 4.0 * (GLfloat) w / (GLfloat) h, -4.0, 4.0, -4.0, 4.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); -} - -static void -key(unsigned char k, int x, int y) -{ - switch (k) { - case 27: /* Escape */ - exit(0); - break; - default: - return; - } - glutPostRedisplay(); -} - -int -main(int argc, char **argv) -{ - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH); - glutInitWindowPosition(0, 0); - glutCreateWindow(argv[0]); - myinit(argc, argv); - glutReshapeFunc(myReshape); - glutDisplayFunc(display); - glutKeyboardFunc(key); - glutMainLoop(); - return 0; /* ANSI C requires main to return int. */ -} diff --git a/progs/tests/vptest1.c b/progs/tests/vptest1.c deleted file mode 100644 index 560df2c3fdc..00000000000 --- a/progs/tests/vptest1.c +++ /dev/null @@ -1,170 +0,0 @@ -/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - - glBegin(GL_POLYGON); - glVertexAttrib2fNV(0, -1, -1); - glVertexAttrib2fNV(0, 1, -1); - glVertexAttrib2fNV(0, 0, 1); - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -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.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - static const char *prog1 = - "!!VP1.0\n" - "MUL o[COL0].xyz, R0, c[35]; \n" - "END\n"; - static const char *prog2 = - "!!VP1.0\n" - "#\n" - "# c[0-3] = modelview projection (composite) matrix\n" - "# c[32] = normalized light direction in object-space\n" - "# c[35] = yellow diffuse material, (1.0, 1.0, 0.0, 1.0)\n" - "# c[64].x = 0.0\n" - "# c[64].z = 0.125, a scaling factor\n" - "#\n" - "# outputs diffuse illumination for color and perturbed position\n" - "#\n" - "DP3 R0, c[32], v[NRML]; # light direction DOT normal\n" - "MUL o[COL0].xyz, R0, c[35]; \n" - "MAX R0, c[64].x, R0; \n" - "MUL R0, R0, v[NRML]; \n" - "MUL R0, R0, c[64].z; \n" - "ADD R1, v[OPOS], -R0; # perturb object space position\n" - "DP4 o[HPOS].x, c[0], R1; \n" - "DP4 o[HPOS].y, c[1], R1; \n" - "DP4 o[HPOS].z, c[2], R1; \n" - "DP4 o[HPOS].w, c[3], R1; \n" - "END\n"; - static const char *prog3 = - "!!VP1.0\n" - "DP4 o[HPOS].x, c[0], v[OPOS];\n" - "DP4 o[HPOS].y, c[1], v[OPOS];\n" - "DP4 o[HPOS].z, c[2], v[OPOS];\n" - "DP4 o[HPOS].w, c[3], v[OPOS];\n" - "DP3 R0.x, c[4], v[NRML];\n" - "DP3 R0.y, c[5], v[NRML]; \n" - "DP3 R0.z, c[6], v[NRML]; # R0 = n' = transformed normal\n" - "DP3 R1.x, c[32], R0; # R1.x = Lpos DOT n'\n" - "DP3 R1.y, c[33], R0; # R1.y = hHat DOT n'\n" - "MOV R1.w, c[38].x; # R1.w = specular power\n" - "LIT R2, R1; # Compute lighting values\n" - "MAD R3, c[35].x, R2.y, c[35].y; # diffuse + emissive\n" - "MAD o[COL0].xyz, c[36], R2.z, R3; # + specular\n" - "END\n"; - static const char *prog4 = - "!!VP1.0\n" - "DP4 R2, R3, c[A0.x];\n" - "DP4 R2, R3, c[A0.x + 5];\n" - "DP4 o[HPOS], R3, c[A0.x - 4];\n" - "END\n"; - static const char *prog5 = - "!!VSP1.0\n" - "DP4 R2, R3, c[A0.x];\n" - "DP4 R2, R3, v[0];\n" - "DP4 c[3], R3, R2;\n" - "END\n"; - - - GLuint progs[5]; - - glGenProgramsNV(2, progs); - assert(progs[0]); - assert(progs[1]); - assert(progs[0] != progs[1]); - - glGenProgramsNV(3, progs + 2); - assert(progs[2]); - assert(progs[3]); - assert(progs[2] != progs[3]); - assert(progs[0] != progs[2]); - - - glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1, - strlen(prog1), - (const GLubyte *) prog1); - assert(!glIsProgramNV(1)); - - glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 2, - strlen(prog2), - (const GLubyte *) prog2); - assert(glIsProgramNV(2)); - - glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 3, - strlen(prog3), - (const GLubyte *) prog3); - assert(glIsProgramNV(3)); - - glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 4, - strlen(prog4), - (const GLubyte *) prog4); - assert(glIsProgramNV(4)); - - glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 5, - strlen(prog5), - (const GLubyte *) prog5); - assert(glIsProgramNV(5)); - - printf("glGetError = %d\n", (int) glGetError()); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/vptest2.c b/progs/tests/vptest2.c deleted file mode 100644 index 2158e07f042..00000000000 --- a/progs/tests/vptest2.c +++ /dev/null @@ -1,151 +0,0 @@ -/* Test vertex state program execution */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - glPushMatrix(); - glutSolidCube(2.0); - glPopMatrix(); - glutSwapBuffers(); -} - - -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.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Test1( void ) -{ - static const GLfloat p[4] = {9, 8, 7, 6}; - GLfloat q[4]; - /* test addition */ - static const char *prog = - "!!VSP1.0\n" - "MOV R0, c[0];\n" - "MOV R1, c[1];\n" - "ADD c[2], R0, R1;\n" - "END\n"; - - glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1, - strlen(prog), - (const GLubyte *) prog); - assert(glIsProgramNV(1)); - - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 0, 1, 2, 3, 4); - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 1, 10, 20, 30, 40); - - glExecuteProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1, p); - - glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV, 2, GL_PROGRAM_PARAMETER_NV, q); - printf("Result c[2] = %g %g %g %g (should be 11 22 33 44)\n", - q[0], q[1], q[2], q[3]); -} - - -static void Test2( void ) -{ - static const GLfloat p[4] = {9, 8, 7, 6}; - GLfloat q[4]; - /* test swizzling */ - static const char *prog = - "!!VSP1.0\n" - "MOV R0, c[0].wzyx;\n" - "MOV R1, c[1].wzyx;\n" - "ADD c[2], R0, R1;\n" - "END\n"; - - glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1, - strlen(prog), - (const GLubyte *) prog); - assert(glIsProgramNV(1)); - - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 0, 1, 2, 3, 4); - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 1, 10, 20, 30, 40); - - glExecuteProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1, p); - - glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV, 2, GL_PROGRAM_PARAMETER_NV, q); - printf("Result c[2] = %g %g %g %g (should be 44 33 22 11)\n", - q[0], q[1], q[2], q[3]); -} - - -static void Test3( void ) -{ - static const GLfloat p[4] = {0, 0, 0, 0}; - GLfloat q[4]; - /* normalize vector */ - static const char *prog = - "!!VSP1.0\n" - "# c[0] = (nx,ny,nz)\n" - "# R0.xyz = normalize(R1)\n" - "# R0.w = 1/sqrt(nx*nx + ny*ny + nz*nz)\n" - "# c[2] = R0\n" - "DP3 R0.w, c[0], c[0];\n" - "RSQ R0.w, R0.w;\n" - "MUL R0.xyz, c[0], R0.w;\n" - "MOV c[2], R0;\n" - "END\n"; - - glLoadProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1, - strlen(prog), - (const GLubyte *) prog); - assert(glIsProgramNV(1)); - - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 0, 0, 10, 0, 0); - - glExecuteProgramNV(GL_VERTEX_STATE_PROGRAM_NV, 1, p); - - glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV, 2, GL_PROGRAM_PARAMETER_NV, q); - printf("Result c[2] = %g %g %g %g (should be 0, 1, 0, 0.1)\n", - q[0], q[1], q[2], q[3]); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 50, 50 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Test1(); - Test2(); - Test3(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/vptest3.c b/progs/tests/vptest3.c deleted file mode 100644 index 2c5c8000408..00000000000 --- a/progs/tests/vptest3.c +++ /dev/null @@ -1,120 +0,0 @@ -/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -static float Zrot = 0.0; - - -static void Display( void ) -{ - glClearColor(0.3, 0.3, 0.3, 1); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glEnable(GL_VERTEX_PROGRAM_NV); - - glLoadIdentity(); - glRotatef(Zrot, 0, 0, 1); - - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW, GL_IDENTITY_NV); - glPushMatrix(); - - glVertexAttrib3fNV(3, 1, 0.5, 0.25); - glBegin(GL_TRIANGLES); -#if 1 - glVertexAttrib3fNV(3, 1.0, 0.0, 0.0); - glVertexAttrib2fNV(0, -0.5, -0.5); - glVertexAttrib3fNV(3, 0.0, 1.0, 0.0); - glVertexAttrib2fNV(0, 0.5, -0.5); - glVertexAttrib3fNV(3, 0.0, 0.0, 1.0); - glVertexAttrib2fNV(0, 0, 0.5); -#else - glVertex2f( -1, -1); - glVertex2f( 1, -1); - glVertex2f( 0, 1); -#endif - glEnd(); - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - /* glFrustum( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 );*/ - glOrtho(-2.0, 2.0, -2.0, 2.0, -2.0, 2.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - /*glTranslatef( 0.0, 0.0, -15.0 );*/ -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'z': - Zrot -= 5.0; - break; - case 'Z': - Zrot += 5.0; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init( void ) -{ - static const char *prog1 = - "!!VP1.0\n" - "MOV o[COL0], v[COL0];\n" -#if 0 - "MOV o[HPOS], v[OPOS];\n" -#else - "DP4 o[HPOS].x, v[OPOS], c[0];\n" - "DP4 o[HPOS].y, v[OPOS], c[1];\n" - "DP4 o[HPOS].z, v[OPOS], c[2];\n" - "DP4 o[HPOS].w, v[OPOS], c[3];\n" -#endif - "END\n"; - - glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1, - strlen(prog1), - (const GLubyte *) prog1); - assert(glIsProgramNV(1)); - - glBindProgramNV(GL_VERTEX_PROGRAM_NV, 1); - - printf("glGetError = %d\n", (int) glGetError()); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/vptorus.c b/progs/tests/vptorus.c deleted file mode 100644 index 764dea4ec22..00000000000 --- a/progs/tests/vptorus.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * A lit, rotating torus via vertex program - */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0; -static GLboolean Anim = GL_TRUE; - - -static void Idle( void ) -{ - Xrot += .3; - Yrot += .4; - Zrot += .2; - glutPostRedisplay(); -} - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1, 0, 0); - glRotatef(Yrot, 0, 1, 0); - glRotatef(Zrot, 0, 0, 1); - glutSolidTorus(0.75, 2.0, 10, 20); - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -2.0, 2.0, -2.0, 2.0, 5.0, 25.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -12.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case ' ': - Xrot = Yrot = Zrot = 0; - break; - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 'z': - Zrot -= 5.0; - break; - case 'Z': - Zrot += 5.0; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - const GLfloat step = 3.0; - (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 ) -{ - /* borrowed from an nvidia demo: - * c[0..3] = modelview matrix - * c[4..7] = inverse modelview matrix - * c[32] = light pos - * c[35] = diffuse color - */ - static const char prog[] = - "!!VP1.0\n" - "#Simple transform and diffuse lighting\n" - "\n" - "DP4 o[HPOS].x, c[0], v[OPOS] ; # object x MVP -> clip\n" - "DP4 o[HPOS].y, c[1], v[OPOS] ;\n" - "DP4 o[HPOS].z, c[2], v[OPOS] ;\n" - "DP4 o[HPOS].w, c[3], v[OPOS] ;\n" - - "DP3 R1.x, c[4], v[NRML] ; # normal x MV-1T -> lighting normal\n" - "DP3 R1.y, c[5], v[NRML] ;\n" - "DP3 R1.z, c[6], v[NRML] ;\n" - - "DP3 R0, c[32], R1 ; # L.N\n" - "MUL o[COL0].xyz, R0, c[35] ; # col = L.N * diffuse\n" - "MOV o[TEX0], v[TEX0];\n" - "END"; - - if (!glutExtensionSupported("GL_NV_vertex_program")) { - printf("Sorry, this program requires GL_NV_vertex_program"); - exit(1); - } - - glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1, - strlen(prog), (const GLubyte *) prog); - assert(glIsProgramNV(1)); - glBindProgramNV(GL_VERTEX_PROGRAM_NV, 1); - - /* Load the program registers */ - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV); - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MODELVIEW, GL_INVERSE_TRANSPOSE_NV); - - /* Light position */ - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 32, 2, 2, 4, 1); - /* Diffuse material color */ - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 35, 0.25, 0, 0.25, 1); - - glEnable(GL_VERTEX_PROGRAM_NV); - glEnable(GL_DEPTH_TEST); - glClearColor(0.3, 0.3, 0.3, 1); - - printf("glGetError = %d\n", (int) glGetError()); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc(Idle); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/vpwarpmesh.c b/progs/tests/vpwarpmesh.c deleted file mode 100644 index 56aa8200ec8..00000000000 --- a/progs/tests/vpwarpmesh.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Warp a triangle mesh with a vertex program. - */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0; -static GLboolean Anim = GL_TRUE; -static GLfloat Phi = 0.0; - - -static void Idle( void ) -{ - Phi += 0.01; - glutPostRedisplay(); -} - - -static void DrawMesh( int rows, int cols ) -{ - static const GLfloat colorA[3] = { 0, 1, 0 }; - static const GLfloat colorB[3] = { 0, 0, 1 }; - const float dx = 2.0 / (cols - 1); - const float dy = 2.0 / (rows - 1); - float x, y; - int i, j; - -#if 1 -#define COLOR3FV(c) glVertexAttrib3fvNV(3, c) -#define VERTEX2F(x, y) glVertexAttrib2fNV(0, x, y) -#else -#define COLOR3FV(c) glColor3fv(c) -#define VERTEX2F(x, y) glVertex2f(x, y) -#endif - - y = -1.0; - for (i = 0; i < rows - 1; i++) { - glBegin(GL_QUAD_STRIP); - x = -1.0; - for (j = 0; j < cols; j++) { - if ((i + j) & 1) - COLOR3FV(colorA); - else - COLOR3FV(colorB); - VERTEX2F(x, y); - VERTEX2F(x, y + dy); - x += dx; - } - glEnd(); - y += dy; - } -} - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1, 0, 0); - glRotatef(Yrot, 0, 1, 0); - glRotatef(Zrot, 0, 0, 1); - - /* Position the gravity source */ - { - GLfloat x, y, z, r = 0.5; - x = r * cos(Phi); - y = r * sin(Phi); - z = 1.0; - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 30, x, y, z, 1); - glDisable(GL_VERTEX_PROGRAM_NV); - glBegin(GL_POINTS); - glColor3f(1,1,1); - glVertex3f(x, y, z); - glEnd(); - } - - glEnable(GL_VERTEX_PROGRAM_NV); - DrawMesh(8, 8); - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - float ar = (float) width / (float) height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -1.0 * ar, 1.0 * ar, -1.0, 1.0, 5.0, 25.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -12.0 ); - glScalef(2, 2, 2); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 'p': - Phi += 0.2; - break; - case 'z': - Zrot -= 5.0; - break; - case 'Z': - Zrot += 5.0; - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - const GLfloat step = 3.0; - (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 ) -{ - /* - * c[0..3] = modelview matrix - * c[4..7] = inverse modelview matrix - * c[30] = gravity source location - * c[31] = gravity source strength - * c[32] = light pos - * c[35] = diffuse color - */ - static const char prog[] = - "!!VP1.0\n" - - "# Compute distance from vertex to gravity source\n" - "ADD R1, c[30], -v[OPOS]; # vector from vertex to gravity\n" - "DP3 R2, R1, R1; # dot product\n" - "RSQ R2, R2.x; # square root = distance\n" - "MUL R2, R2, c[31].xxxx; # scale by the gravity factor\n" - - "# Displace vertex by gravity factor along R1 vector\n" - "MAD R3, R1, R2, v[OPOS];\n" - - "# Continue with typical modelview/projection\n" - "DP4 o[HPOS].x, c[0], R3 ; # object x MVP -> clip\n" - "DP4 o[HPOS].y, c[1], R3 ;\n" - "DP4 o[HPOS].z, c[2], R3 ;\n" - "DP4 o[HPOS].w, c[3], R3 ;\n" - - "MOV o[COL0], v[COL0];\n # copy input color to output color\n" - - "END"; - - if (!glutExtensionSupported("GL_NV_vertex_program")) { - printf("Sorry, this program requires GL_NV_vertex_program\n"); - exit(1); - } - - glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1, - strlen(prog), (const GLubyte *) prog); - assert(glIsProgramNV(1)); - glBindProgramNV(GL_VERTEX_PROGRAM_NV, 1); - - /* Load the program registers */ - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV); - glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MODELVIEW, GL_INVERSE_TRANSPOSE_NV); - - /* Light position */ - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 32, 2, 2, 4, 1); - /* Diffuse material color */ - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 35, 0.25, 0, 0.25, 1); - - /* Gravity strength */ - glProgramParameter4fNV(GL_VERTEX_PROGRAM_NV, 31, .5, 0, 0, 0); - - glEnable(GL_DEPTH_TEST); - glClearColor(0.3, 0.3, 0.3, 1); - glShadeModel(GL_FLAT); - glPointSize(3); - printf("glGetError = %d\n", (int) glGetError()); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc(Idle); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/tests/yuvrect.c b/progs/tests/yuvrect.c deleted file mode 100644 index acef4060970..00000000000 --- a/progs/tests/yuvrect.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Test the GL_NV_texture_rectangle and GL_MESA_ycrcb_texture extensions. - * - * Brian Paul 13 September 2002 - */ - -#include <assert.h> -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -#include "../util/readtex.c" /* I know, this is a hack. */ - -#define TEXTURE_FILE "../images/girl.rgb" - -static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; -static GLint ImgWidth, ImgHeight; -static GLushort *ImageYUV = NULL; - - -static void DrawObject(void) -{ - glBegin(GL_QUADS); - - glTexCoord2f(0, 0); - glVertex2f(-1.0, -1.0); - - glTexCoord2f(ImgWidth, 0); - glVertex2f(1.0, -1.0); - - glTexCoord2f(ImgWidth, ImgHeight); - glVertex2f(1.0, 1.0); - - glTexCoord2f(0, ImgHeight); - glVertex2f(-1.0, 1.0); - - glEnd(); -} - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - DrawObject(); - glPopMatrix(); - - glutSwapBuffers(); -} - - -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, 10.0, 100.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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( int argc, char *argv[] ) -{ - GLuint texObj = 100; - const char *file; - - if (!glutExtensionSupported("GL_NV_texture_rectangle")) { - printf("Sorry, GL_NV_texture_rectangle is required\n"); - exit(0); - } - - if (!glutExtensionSupported("GL_MESA_ycbcr_texture")) { - printf("Sorry, GL_MESA_ycbcr_texture is required\n"); - exit(0); - } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - glBindTexture(GL_TEXTURE_RECTANGLE_NV, texObj); -#ifdef LINEAR_FILTER - /* linear filtering looks much nicer but is much slower for Mesa */ - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -#else - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER, GL_NEAREST); -#endif - - if (argc > 1) - file = argv[1]; - else - file = TEXTURE_FILE; - - ImageYUV = LoadYUVImage(file, &ImgWidth, &ImgHeight); - if (!ImageYUV) { - printf("Couldn't read %s\n", TEXTURE_FILE); - exit(0); - } - - printf("Image: %dx%d\n", ImgWidth, ImgHeight); - - glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, - GL_YCBCR_MESA, ImgWidth, ImgHeight, 0, - GL_YCBCR_MESA, GL_UNSIGNED_SHORT_8_8_MESA, ImageYUV); - - assert(glGetError() == GL_NO_ERROR); - glTexSubImage2D(GL_TEXTURE_RECTANGLE_NV, 0, - 0, 0, ImgWidth, ImgHeight, - GL_YCBCR_MESA, GL_UNSIGNED_SHORT_8_8_MESA, ImageYUV); - - assert(glGetError() == GL_NO_ERROR); - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - glEnable(GL_TEXTURE_RECTANGLE_NV); - - glShadeModel(GL_FLAT); - glClearColor(0.3, 0.3, 0.4, 1.0); - - if (argc > 1 && strcmp(argv[1], "-info")==0) { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - } -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowSize( 300, 300 ); - glutInitWindowPosition( 0, 0 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0] ); - - Init( argc, argv ); - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/yuvsquare.c b/progs/tests/yuvsquare.c deleted file mode 100644 index 3601e7a31c7..00000000000 --- a/progs/tests/yuvsquare.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Test the GL_NV_texture_rectangle and GL_MESA_ycrcb_texture extensions. - * - * Brian Paul 13 September 2002 - */ - - -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -#include "../util/readtex.c" /* I know, this is a hack. */ - -#define TEXTURE_FILE "../images/tile.rgb" - -static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; -static GLint ImgWidth, ImgHeight; -static GLushort *ImageYUV = NULL; -static GLubyte *ImageRGB = NULL; -static const GLuint yuvObj = 100; -static const GLuint rgbObj = 101; - - -static void DrawObject(void) -{ - glBegin(GL_QUADS); - - glTexCoord2f(0, 0); - glVertex2f(-1.0, -1.0); - - glTexCoord2f(1, 0); - glVertex2f(1.0, -1.0); - - glTexCoord2f(1, 1); - glVertex2f(1.0, 1.0); - - glTexCoord2f(0, 1); - glVertex2f(-1.0, 1.0); - - glEnd(); -} - - -static void Display( void ) -{ - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glTranslatef( -1.1, 0.0, -15.0 ); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glBindTexture(GL_TEXTURE_2D, yuvObj); - DrawObject(); - glPopMatrix(); - - glPushMatrix(); - glTranslatef( 1.1, 0.0, -15.0 ); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glBindTexture(GL_TEXTURE_2D, rgbObj); - DrawObject(); - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -1.1, 1.1, -1.1, 1.1, 10.0, 100.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -15.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (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(); -} - - -#define CLAMP( X, MIN, MAX ) ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) ) - - - -/* #define LINEAR_FILTER */ - -static void Init( int argc, char *argv[] ) -{ - const char *file; - GLenum format; - - if (!glutExtensionSupported("GL_MESA_ycbcr_texture")) { - printf("Sorry, GL_MESA_ycbcr_texture is required\n"); - exit(0); - } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - if (argc > 1) - file = argv[1]; - else - file = TEXTURE_FILE; - - /* First load the texture as YCbCr. - */ - - glBindTexture(GL_TEXTURE_2D, yuvObj); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - ImageYUV = LoadYUVImage(file, &ImgWidth, &ImgHeight ); - if (!ImageYUV) { - printf("Couldn't read %s\n", TEXTURE_FILE); - exit(0); - } - - printf("Image: %dx%d\n", ImgWidth, ImgHeight); - - - glTexImage2D(GL_TEXTURE_2D, 0, - GL_YCBCR_MESA, - ImgWidth, ImgHeight, 0, - GL_YCBCR_MESA, - GL_UNSIGNED_SHORT_8_8_MESA, ImageYUV); - - glEnable(GL_TEXTURE_2D); - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - - - /* Now load the texture as RGB. - */ - - glBindTexture(GL_TEXTURE_2D, rgbObj); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - ImageRGB = LoadRGBImage(file, &ImgWidth, &ImgHeight, &format ); - if (!ImageRGB) { - printf("Couldn't read %s\n", TEXTURE_FILE); - exit(0); - } - - printf("Image: %dx%d\n", ImgWidth, ImgHeight); - - - glTexImage2D(GL_TEXTURE_2D, 0, - format, - ImgWidth, ImgHeight, 0, - format, - GL_UNSIGNED_BYTE, ImageRGB); - - glEnable(GL_TEXTURE_2D); - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - - - glShadeModel(GL_FLAT); - glClearColor(0.3, 0.3, 0.4, 1.0); - - if (argc > 1 && strcmp(argv[1], "-info")==0) { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - } - - printf( "Both images should appear the same.\n" ); -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowSize( 300, 300 ); - glutInitWindowPosition( 0, 0 ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0] ); - - Init( argc, argv ); - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - - glutMainLoop(); - return 0; -} diff --git a/progs/tests/zreaddraw.c b/progs/tests/zreaddraw.c deleted file mode 100644 index e2dacbf7f2f..00000000000 --- a/progs/tests/zreaddraw.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Test glRead/DrawPixels for GL_DEPTH_COMPONENT, with pixelzoom. - * - * Brian Paul - * 23 August 2003 - */ - -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -static GLint WinWidth = 500, WinHeight = 500; - - -static void Display(void) -{ - GLfloat depth[100 * 100]; - GLfloat depth2[400 * 400]; - GLfloat min, max; - int i; - - glClearColor(0.5, 0.5, 0.5, 0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - /* draw a sphere */ - glViewport(0, 0, 100, 100); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1, 1, -1, 1, -1, 0); /* clip away back half of sphere */ - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glutSolidSphere(1.0, 20, 10); - - /* read the depth image */ - glReadPixels(0, 0, 100, 100, GL_DEPTH_COMPONENT, GL_FLOAT, depth); - min = max = depth[0]; - for (i = 1; i < 100 * 100; i++) { - if (depth[i] < min) - min = depth[i]; - if (depth[i] > max) - max = depth[i]; - } - printf("Depth value range: [%f, %f]\n", min, max); - - /* draw depth image with scaling (into z buffer) */ - glPixelZoom(4.0, 4.0); - glWindowPos2i(100, 0); - glDrawPixels(100, 100, GL_DEPTH_COMPONENT, GL_FLOAT, depth); - - /* read back scaled depth image */ - glReadPixels(100, 0, 400, 400, GL_DEPTH_COMPONENT, GL_FLOAT, depth2); - /* draw as luminance */ - glPixelZoom(1.0, 1.0); - glDrawPixels(400, 400, GL_LUMINANCE, GL_FLOAT, depth2); - - glutSwapBuffers(); -} - - -static void Reshape(int width, int height) -{ - WinWidth = width; - WinHeight = height; - glViewport(0, 0, width, height); -} - - -static void Key(unsigned char key, int x, int y) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -static void Init(void) -{ - const GLfloat blue[4] = {.1, .1, 1.0, 0.0}; - const GLfloat gray[4] = {0.2, 0.2, 0.2, 1.0}; - const GLfloat white[4] = {1.0, 1.0, 1.0, 1.0}; - const GLfloat pos[4] = {0, 0, 10, 0}; - - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - - glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, blue); - glLightfv(GL_LIGHT0, GL_AMBIENT, gray); - glLightfv(GL_LIGHT0, GL_DIFFUSE, white); - glLightfv(GL_LIGHT0, GL_POSITION, pos); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); -} - - -int main(int argc, char *argv[]) -{ - glutInit(&argc, argv); - glutInitWindowPosition(0, 0); - glutInitWindowSize(WinWidth, WinHeight); - glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); - glutCreateWindow(argv[0]); - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - glutDisplayFunc(Display); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/util/descrip.mms b/progs/util/descrip.mms deleted file mode 100644 index 21dec4b9be4..00000000000 --- a/progs/util/descrip.mms +++ /dev/null @@ -1,42 +0,0 @@ -# Makefile for GLUT-based demo programs for VMS -# contributed by Jouk Jansen [email protected] - - -.first - define gl [--.include.gl] - -.include [--]mms-config. - -##### MACROS ##### - -INCDIR = ([--.include],[-.util]) -CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm - -.ifdef SHARE -GL_LIBS = $(XLIBS) -LIB_DEP = [--.lib]$(GL_SHAR) [--.lib]$(GLU_SHAR) [--.lib]$(GLUT_SHAR) -.else -GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS) -LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB) -.endif - - -OBJS =readtex.obj,showbuffer.obj - - -##### RULES ##### -.obj.exe : - cxxlink $(MMS$TARGET_NAME),$(GL_LIBS) - -##### TARGETS ##### -default : - $(MMS)$(MMSQUALIFIERS) $(OBJS) - -clean : - delete *.obj;* - -realclean : - delete *.obj;* - -readtex.obj : readtex.c -showbuffer.obj : showbuffer.c diff --git a/progs/util/imagesgi.cpp b/progs/util/imagesgi.cpp deleted file mode 100644 index f5128aabec0..00000000000 --- a/progs/util/imagesgi.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/****************************************************************************** -** Filename : imageSgi.cpp -** UNCLASSIFIED -** -** Description : Utility to read SGI image format files. This code was -** originally a SGI image loading utility provided with the -** Mesa 3D library @ http://www.mesa3d.org by Brain Paul. -** This has been extended to read all SGI image formats -** (e.g. INT, INTA, RGB, RGBA). -** -** Revision History: -** Date Name Description -** 06/07/99 BRC Initial Release -** -** Note: -** -** The SGI Image Data (if not RLE) -** -** If the image is stored verbatim (without RLE), then image data directly -** follows the 512 byte header. The data for each scanline of the first -** channel is written first. If the image has more than 1 channel, all -** the data for the first channel is written, followed by the remaining -** channels. If the BPC value is 1, then each scanline is written as XSIZE -** bytes. If the BPC value is 2, then each scanline is written as XSIZE -** shorts. These shorts are stored in the byte order described above. -** -******************************************************************************/ -#define __IMAGESGI_CPP - -#include "imagesgi.h" - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <math.h> -#include <assert.h> - -struct sImageSgiRaw -{ - struct sImageSgiHeader header; - unsigned char *chan0; - unsigned char *chan1; - unsigned char *chan2; - unsigned char *chan3; - unsigned int *rowStart; - int *rowSize; -}; - -// Static routines -static struct sImageSgiRaw *ImageSgiRawOpen(char const * const fileName); -static void ImageSgiRawClose(struct sImageSgiRaw *raw); -static void ImageSgiRawGetRow(struct sImageSgiRaw *raw, unsigned char *buf, - int y, int z); -static void ImageSgiRawGetData(struct sImageSgiRaw *raw, struct sImageSgi -*final); -static void *SwitchEndian16(void *value); -static void *SwitchEndian32(void *value); - -// Static variables -FILE *mFp = NULL; -unsigned char *mChanTmp = NULL; - - -/*****************************************************************************/ -struct sImageSgi *ImageSgiOpen(char const * const fileName) -{ - struct sImageSgiRaw *raw = NULL; - struct sImageSgi *final = NULL; - - raw = ImageSgiRawOpen(fileName); - final = new struct sImageSgi; - - assert(final); - if(final) - { - final->header = raw->header; - final->data = NULL; - ImageSgiRawGetData(raw, final); - ImageSgiRawClose(raw); - } - - return final; -} // ImageSgiRawOpen - - -/*****************************************************************************/ -void ImageSgiClose(struct sImageSgi *image) -{ - - if(image) - { - if(image->data) - delete[] image->data; - image->data = NULL; - delete image; - } - image = NULL; - - return; -} // ImageSgiClose - - -/*****************************************************************************/ -static struct sImageSgiRaw *ImageSgiRawOpen(char const * const fileName) -{ - struct sImageSgiRaw *raw = NULL; - int x; - int i; - bool swapFlag = false; - union - { - int testWord; - char testByte[4]; - } endianTest; - endianTest.testWord = 1; - - // Determine endianess of platform. - if(endianTest.testByte[0] == 1) - swapFlag = true; - else - swapFlag = false; - - raw = new struct sImageSgiRaw; - - assert(raw); - if(raw) - { - raw->chan0 = NULL; - raw->chan1 = NULL; - raw->chan2 = NULL; - raw->chan3 = NULL; - raw->rowStart = NULL; - raw->rowSize = NULL; - mFp = fopen(fileName, "rb"); - assert(mFp); - - fread(&raw->header, sizeof(struct sImageSgiHeader), 1, mFp); - if(swapFlag == true) - { - SwitchEndian16(&raw->header.magic); - SwitchEndian16(&raw->header.type); - SwitchEndian16(&raw->header.dim); - SwitchEndian16(&raw->header.xsize); - SwitchEndian16(&raw->header.ysize); - SwitchEndian16(&raw->header.zsize); - } - - mChanTmp = new unsigned char[raw->header.xsize * raw->header.ysize]; - assert(mChanTmp); - switch(raw->header.zsize) - { - case 4: - raw->chan3 = new unsigned char[raw->header.xsize * -raw->header.ysize]; - assert(raw->chan3); - case 3: - raw->chan2 = new unsigned char[raw->header.xsize * -raw->header.ysize]; - assert(raw->chan2); - case 2: - raw->chan1 = new unsigned char[raw->header.xsize * -raw->header.ysize]; - assert(raw->chan1); - case 1: - raw->chan0 = new unsigned char[raw->header.xsize * -raw->header.ysize]; - assert(raw->chan0); - } - - if(raw->header.type == IMAGE_SGI_TYPE_RLE) - { - x = raw->header.ysize * raw->header.zsize * sizeof(unsigned int); - raw->rowStart = new unsigned int[x]; - raw->rowSize = new int[x]; - - fseek(mFp, sizeof(struct sImageSgiHeader), SEEK_SET); - fread(raw->rowStart, 1, x, mFp); - fread(raw->rowSize, 1, x, mFp); - - if(swapFlag == true) - { - for(i=0; i<x/sizeof(unsigned int); i++) - SwitchEndian32(&raw->rowStart[i]); - for(i=0; i<x/sizeof(int); i++) - SwitchEndian32(&raw->rowSize[i]); - } - - } - - } - - return raw; -} // ImageSgiRawOpen - - -/*****************************************************************************/ -static void ImageSgiRawClose(struct sImageSgiRaw *raw) -{ - - fclose(mFp); - mFp = NULL; - - if(mChanTmp) - delete[] mChanTmp; - mChanTmp = NULL; - - if(raw->chan0) - delete[] raw->chan0; - raw->chan0 = NULL; - - if(raw->chan1) - delete[] raw->chan1; - raw->chan1 = NULL; - - if(raw->chan2) - delete[] raw->chan2; - raw->chan2 = NULL; - - if(raw->chan3) - delete[] raw->chan3; - raw->chan3 = NULL; - - if(raw) - delete raw; - raw = NULL; - - return; -} // ImageSgiRawClose - - -/*****************************************************************************/ -static void ImageSgiRawGetRow(struct sImageSgiRaw *raw, unsigned char *buf, - int y, int z) -{ - unsigned char *iPtr = NULL; - unsigned char *oPtr = NULL; - unsigned char pixel; - int count; - - if((raw->header.type & 0xFF00) == 0x0100) - { - fseek(mFp, raw->rowStart[y+z*raw->header.ysize], SEEK_SET); - fread(mChanTmp, 1, (unsigned int)raw->rowSize[y+z*raw->header.ysize], -mFp); - iPtr = mChanTmp; - oPtr = buf; - while(1) - { - pixel = *iPtr++; - count = (int)(pixel & 0x7F); - if(!count) - { - return; - } - if (pixel & 0x80) - { - while (count--) - { - *oPtr++ = *iPtr++; - } - } - else - { - pixel = *iPtr++; - while (count--) - { - *oPtr++ = pixel; - } - } - } - } - else - { - fseek(mFp, - sizeof(struct sImageSgiHeader)+(y*raw->header.xsize) + - (z*raw->header.xsize*raw->header.ysize), - SEEK_SET); - fread(buf, 1, raw->header.xsize, mFp); - } - - return; -} // ImageSgiRawGetRow - - -/*****************************************************************************/ -static void ImageSgiRawGetData(struct sImageSgiRaw *raw, struct sImageSgi -*final) -{ - unsigned char *ptr = NULL; - int i, j; - - final->data = - new unsigned -char[raw->header.xsize*raw->header.ysize*raw->header.zsize]; - assert(final->data); - - ptr = final->data; - for(i=0; i<raw->header.ysize; i++) - { - switch(raw->header.zsize) - { - case 1: - ImageSgiRawGetRow(raw, raw->chan0, i, 0); - for(j=0; j<raw->header.xsize; j++) - *(ptr++) = raw->chan0[j]; - break; - case 2: - ImageSgiRawGetRow(raw, raw->chan0, i, 0); - ImageSgiRawGetRow(raw, raw->chan1, i, 1); - for(j=0; j<raw->header.xsize; j++) - { - *(ptr++) = raw->chan0[j]; - *(ptr++) = raw->chan1[j]; - } - break; - case 3: - ImageSgiRawGetRow(raw, raw->chan0, i, 0); - ImageSgiRawGetRow(raw, raw->chan1, i, 1); - ImageSgiRawGetRow(raw, raw->chan2, i, 2); - for(j=0; j<raw->header.xsize; j++) - { - *(ptr++) = raw->chan0[j]; - *(ptr++) = raw->chan1[j]; - *(ptr++) = raw->chan2[j]; - } - break; - case 4: - ImageSgiRawGetRow(raw, raw->chan0, i, 0); - ImageSgiRawGetRow(raw, raw->chan1, i, 1); - ImageSgiRawGetRow(raw, raw->chan2, i, 2); - ImageSgiRawGetRow(raw, raw->chan3, i, 3); - for(j=0; j<raw->header.xsize; j++) - { - *(ptr++) = raw->chan0[j]; - *(ptr++) = raw->chan1[j]; - *(ptr++) = raw->chan2[j]; - *(ptr++) = raw->chan3[j]; - } - break; - } - } - - return; -} // ImageSgiRawGetData - - -/*****************************************************************************/ -static void *SwitchEndian16(void *value) -{ - short value16 = *(short *) value; - value16 = ((value16 & 0xff00) >> 8L) + - ((value16 & 0x00ff) << 8L); - *(short *)value = value16; - return value; -} // SwitchEndian16 - - -/*****************************************************************************/ -static void *SwitchEndian32(void *value) -{ - int value32 = *(int *) value; - value32 = ((value32 & 0xff000000) >> 24L) + - ((value32 & 0x00ff0000) >> 8) + - ((value32 & 0x0000ff00) << 8) + - ((value32 & 0x000000ff) << 24L); - *(int *)value = value32; - return value; -} // SwitchEndian32 - diff --git a/progs/vp/Makefile b/progs/vp/Makefile deleted file mode 100644 index c3faeb5b602..00000000000 --- a/progs/vp/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# progs/tests/Makefile - - -# These programs aren't intended to be included with the normal distro. -# They're not too interesting but they're good for testing. - -TOP = ../.. -include $(TOP)/configs/current - - -LIBS = $(APP_LIB_DEPS) - -SOURCES = \ - vp-tris.c - - - -PROGS = $(SOURCES:%.c=%) - -INCLUDES = -I. -I$(TOP)/include -I../samples - - -##### RULES ##### - -.SUFFIXES: -.SUFFIXES: .c - -.c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: $(PROGS) - -clean: - rm -f $(PROGS) - rm -f *.o - rm -f getproclist.h - - - - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` diff --git a/progs/vp/abs.txt b/progs/vp/abs.txt deleted file mode 100644 index cd00952e349..00000000000 --- a/progs/vp/abs.txt +++ /dev/null @@ -1,7 +0,0 @@ -!!ARBvp1.0 -TEMP R0; -SUB R0, {0.5}.x, vertex.color; -ABS result.color, R0; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/add.txt b/progs/vp/add.txt deleted file mode 100644 index 4094cd448dc..00000000000 --- a/progs/vp/add.txt +++ /dev/null @@ -1,6 +0,0 @@ -!!ARBvp1.0 -TEMP R0; -ADD R0, vertex.color, vertex.color; -ADD result.color, R0, R0; -MOV result.position, vertex.position; -END diff --git a/progs/vp/arl.txt b/progs/vp/arl.txt deleted file mode 100644 index a262b0149c6..00000000000 --- a/progs/vp/arl.txt +++ /dev/null @@ -1,9 +0,0 @@ -!!ARBvp1.0 -PARAM arr[5] = { {0,1,2,3}, {4,5,6,7}, {8,9,10,11}, {12,13,14,14}, {16,17,18,19} }; -ADDRESS addr; -TEMP R0; -MAD R0, {5.0}.x, vertex.color, {2.0}.x; -ARL addr.x, R0.x; -MUL result.color, arr[addr.x-2], {.07}.x; -MOV result.position, vertex.position; -END diff --git a/progs/vp/dp3.txt b/progs/vp/dp3.txt deleted file mode 100644 index 8336bd3dd8e..00000000000 --- a/progs/vp/dp3.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -DP3 result.color, vertex.color, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/dp4.txt b/progs/vp/dp4.txt deleted file mode 100644 index 70505a494c5..00000000000 --- a/progs/vp/dp4.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -DP4 result.color, vertex.color.xxxx, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/dph.txt b/progs/vp/dph.txt deleted file mode 100644 index c7cab1384dd..00000000000 --- a/progs/vp/dph.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -DPH result.color, vertex.color, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/dst.txt b/progs/vp/dst.txt deleted file mode 100644 index 03613c0eece..00000000000 --- a/progs/vp/dst.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -DST result.color, vertex.color, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/ex2.txt b/progs/vp/ex2.txt deleted file mode 100644 index bbef67bbb8a..00000000000 --- a/progs/vp/ex2.txt +++ /dev/null @@ -1,6 +0,0 @@ -!!ARBvp1.0 -TEMP R0; -EX2 R0, vertex.color.x; -SUB result.color, R0, {1.0}.x; -MOV result.position, vertex.position; -END diff --git a/progs/vp/flr.txt b/progs/vp/flr.txt deleted file mode 100644 index c33280da978..00000000000 --- a/progs/vp/flr.txt +++ /dev/null @@ -1,6 +0,0 @@ -!!ARBvp1.0 -TEMP R0; -ADD R0, vertex.color, {0.5}.x; -FLR result.color, R0; -MOV result.position, vertex.position; -END diff --git a/progs/vp/frc.txt b/progs/vp/frc.txt deleted file mode 100644 index d8e72b60cc7..00000000000 --- a/progs/vp/frc.txt +++ /dev/null @@ -1,6 +0,0 @@ -!!ARBvp1.0 -TEMP R0; -MUL R0, vertex.color, {3.0}.x; -FRC result.color, R0; -MOV result.position, vertex.position; -END diff --git a/progs/vp/lg2.txt b/progs/vp/lg2.txt deleted file mode 100644 index 2f59b993a41..00000000000 --- a/progs/vp/lg2.txt +++ /dev/null @@ -1,6 +0,0 @@ -!!ARBvp1.0 -TEMP R0; -MUL R0, vertex.color, {4.0}.x; -LG2 result.color, R0.x; -MOV result.position, vertex.position; -END diff --git a/progs/vp/lit.txt b/progs/vp/lit.txt deleted file mode 100644 index 65705b41705..00000000000 --- a/progs/vp/lit.txt +++ /dev/null @@ -1,6 +0,0 @@ -!!ARBvp1.0 -TEMP R0; -SUB R0, {0.5}.x, vertex.color; -LIT result.color, R0; -MOV result.position, vertex.position; -END diff --git a/progs/vp/mad.txt b/progs/vp/mad.txt deleted file mode 100644 index 0c9ed6c8b7f..00000000000 --- a/progs/vp/mad.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -MAD result.color, vertex.color.z, {1,0,0,1}, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/max.txt b/progs/vp/max.txt deleted file mode 100644 index 6747ca57277..00000000000 --- a/progs/vp/max.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -MAX result.color, {0.5}.x, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/min.txt b/progs/vp/min.txt deleted file mode 100644 index 2adc872ed9c..00000000000 --- a/progs/vp/min.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -MIN result.color, {0.5}.x, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/mov.txt b/progs/vp/mov.txt deleted file mode 100644 index 9ce1a453067..00000000000 --- a/progs/vp/mov.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -MOV result.color, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/mul.txt b/progs/vp/mul.txt deleted file mode 100644 index e479cdb8543..00000000000 --- a/progs/vp/mul.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -MUL result.color, vertex.color, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/pow.txt b/progs/vp/pow.txt deleted file mode 100644 index 512412997de..00000000000 --- a/progs/vp/pow.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -POW result.color, vertex.color.x, vertex.color.y; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/rcp.txt b/progs/vp/rcp.txt deleted file mode 100644 index e16292bd00a..00000000000 --- a/progs/vp/rcp.txt +++ /dev/null @@ -1,7 +0,0 @@ -!!ARBvp1.0 -TEMP R0; -ADD R0, vertex.color.x, vertex.color.x; -RCP result.color, R0.x; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/rsq.txt b/progs/vp/rsq.txt deleted file mode 100644 index 3e3f3251ee0..00000000000 --- a/progs/vp/rsq.txt +++ /dev/null @@ -1,7 +0,0 @@ -!!ARBvp1.0 -TEMP R0; -MUL R0, vertex.color, {3.0}.x; -RSQ result.color, R0.x; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/sge.txt b/progs/vp/sge.txt deleted file mode 100644 index 3fa82e5d5ea..00000000000 --- a/progs/vp/sge.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -SGE result.color, {0.5}.x, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/slt.txt b/progs/vp/slt.txt deleted file mode 100644 index 6bf8ffa775d..00000000000 --- a/progs/vp/slt.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -SLT result.color, {0.5}.x, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/sub.txt b/progs/vp/sub.txt deleted file mode 100644 index a58ab101bcd..00000000000 --- a/progs/vp/sub.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -SUB result.color, vertex.color.yzxw, vertex.color; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/swz.txt b/progs/vp/swz.txt deleted file mode 100644 index 92c58089b1a..00000000000 --- a/progs/vp/swz.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -MOV result.color, vertex.color.xxzx; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/swz2.txt b/progs/vp/swz2.txt deleted file mode 100644 index 84c78db49f6..00000000000 --- a/progs/vp/swz2.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -SWZ result.color, vertex.color, 1,x,y,z; -MOV result.position, vertex.position; -END - diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c deleted file mode 100644 index 5dbe5ac8359..00000000000 --- a/progs/vp/vp-tris.c +++ /dev/null @@ -1,216 +0,0 @@ -/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */ - -#include <assert.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#define GL_GLEXT_PROTOTYPES -#include <GL/glut.h> - -static const char *filename = NULL; -static GLuint nr_steps = 4; - -static void usage( char *name ) -{ - fprintf( stderr, "usage: %s [ options ] shader_filename\n", name ); - fprintf( stderr, "\n" ); - fprintf( stderr, "options:\n" ); - fprintf( stderr, " -f flat shaded\n" ); - fprintf( stderr, " -nNr subdivision steps\n" ); -} - - -static void args(int argc, char *argv[]) -{ - GLint i; - - for (i = 1; i < argc; i++) { - if (strncmp(argv[i], "-n", 2) == 0) { - nr_steps = atoi((argv[i]) + 2); - } - else if (strcmp(argv[i], "-f") == 0) { - glShadeModel(GL_FLAT); - } - else if (i == argc - 1) { - filename = argv[i]; - } - else { - usage(argv[0]); - exit(1); - } - } - - if (!filename) { - usage(argv[0]); - exit(1); - } -} - - - -static void Init( void ) -{ - GLint errno; - GLuint prognum; - char buf[4096]; - GLuint sz; - FILE *f; - - if ((f = fopen(filename, "r")) == NULL) { - fprintf(stderr, "couldn't open %s\n", filename); - exit(1); - } - - sz = fread(buf, 1, sizeof(buf), f); - if (!feof(f)) { - fprintf(stderr, "file too long\n"); - exit(1); - } - - fprintf(stderr, "%.*s\n", sz, buf); - - glGenProgramsARB(1, &prognum); - - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - sz, (const GLubyte *) buf); - - errno = glGetError(); - printf("glGetError = %d\n", errno); - if (errno != GL_NO_ERROR) - { - GLint errorpos; - - glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos); - printf("errorpos: %d\n", errorpos); - printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); - } - assert(glIsProgramARB(prognum)); -} - - -union vert { - struct { - GLfloat color[3]; - GLfloat pos[3]; - } v; - GLfloat f[6]; -}; - -static void make_midpoint( union vert *out, - const union vert *v0, - const union vert *v1) -{ - int i; - for (i = 0; i < 6; i++) - out->f[i] = v0->f[i] + .5 * (v1->f[i] - v0->f[i]); -} - -static void subdiv( union vert *v0, - union vert *v1, - union vert *v2, - GLuint depth ) -{ - if (depth == 0) { - glColor3fv(v0->v.color); - glVertex3fv(v0->v.pos); - glColor3fv(v1->v.color); - glVertex3fv(v1->v.pos); - glColor3fv(v2->v.color); - glVertex3fv(v2->v.pos); - } - else { - union vert m[3]; - - make_midpoint(&m[0], v0, v1); - make_midpoint(&m[1], v1, v2); - make_midpoint(&m[2], v2, v0); - - subdiv(&m[0], &m[2], v0, depth-1); - subdiv(&m[1], &m[0], v1, depth-1); - subdiv(&m[2], &m[1], v2, depth-1); - subdiv(&m[0], &m[1], &m[2], depth-1); - } -} - -/** Assignment */ -#define ASSIGN_3V( V, V0, V1, V2 ) \ -do { \ - V[0] = V0; \ - V[1] = V1; \ - V[2] = V2; \ -} while(0) - -static void Display( void ) -{ - glClearColor(0.3, 0.3, 0.3, 1); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - - glEnable(GL_VERTEX_PROGRAM_NV); - - glBegin(GL_TRIANGLES); - - - { - union vert v[3]; - - ASSIGN_3V(v[0].v.color, 0,0,1); - ASSIGN_3V(v[0].v.pos, 0.9, -0.9, 0.0); - ASSIGN_3V(v[1].v.color, 1,0,0); - ASSIGN_3V(v[1].v.pos, 0.9, 0.9, 0.0); - ASSIGN_3V(v[2].v.color, 0,1,0); - ASSIGN_3V(v[2].v.pos, -0.9, 0, 0.0); - - subdiv(&v[0], &v[1], &v[2], nr_steps); - } - - glEnd(); - - - glFlush(); -} - - -static void Reshape( int width, int height ) -{ - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - /*glTranslatef( 0.0, 0.0, -15.0 );*/ -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( 250, 250 ); - glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - args( argc, argv ); - Init(); - glutMainLoop(); - return 0; -} diff --git a/progs/vp/xpd.txt b/progs/vp/xpd.txt deleted file mode 100644 index b8818ebc60e..00000000000 --- a/progs/vp/xpd.txt +++ /dev/null @@ -1,5 +0,0 @@ -!!ARBvp1.0 -XPD result.color, vertex.color, {2,2,2,0}; -MOV result.position, vertex.position; -END - diff --git a/progs/xdemos/.cvsignore b/progs/xdemos/.cvsignore deleted file mode 100644 index 4adffda2d1e..00000000000 --- a/progs/xdemos/.cvsignore +++ /dev/null @@ -1,16 +0,0 @@ -glthreads -glxdemo -glxgears -glxheads -glxinfo -glxpixmap -glxpbdemo -glxswapcontrol -manywin -offset -pbinfo -pbdemo -wincopy -xdemo -xfont -xrotfontdemo |