aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-15 21:31:53 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-05-15 21:31:53 +0000
commit17c4a117949e1ab430bda520e5923346216264ae (patch)
treebcb6f70c063916eec1babfe0533528305cde214f
parent62aea784507707eac56c5305fb191365987ae596 (diff)
downloadusdx-17c4a117949e1ab430bda520e5923346216264ae.tar.gz
usdx-17c4a117949e1ab430bda520e5923346216264ae.tar.xz
usdx-17c4a117949e1ab430bda520e5923346216264ae.zip
start of test programs
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1728 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--test/test001.pas84
1 files changed, 84 insertions, 0 deletions
diff --git a/test/test001.pas b/test/test001.pas
new file mode 100644
index 00000000..4ee62690
--- /dev/null
+++ b/test/test001.pas
@@ -0,0 +1,84 @@
+program test001;
+
+{
+This program test the function glext_ExtensionSupported from unit glext.
+}
+
+uses
+ SysUtils,
+ SDL,
+ gl,
+ glext;
+
+const
+ s1: pchar = '';
+ s2: pchar = 'ext';
+ s3: pchar = ' ext';
+ s4: pchar = ' ext ';
+ s5: pchar = 'kkshf kjsfh ext';
+ s6: pchar = 'fakh sajhf ext jskdhf';
+ s7: pchar = 'ext jshf';
+ s8: pchar = 'sdkjfh ksjhext sjdha';
+ s9: pchar = 'sdkjfh ksjh extsjdha';
+ s10: pchar = 'sdkjfh ksjhextsjdha';
+ s11: pchar = 'sd kjf jdha';
+
+ e1: pchar = '';
+ e2: pchar = 'ext';
+ e3: pchar = 'GL_ARB_window_pos';
+
+ SCREEN_WIDTH = 640;
+ SCREEN_HEIGHT = 480;
+ SCREEN_BPP = 16;
+
+var
+ surface: PSDL_Surface;
+ videoFlags: integer;
+
+begin
+ write ('test001: Start ... ');
+
+// initialize SDL and OpenGL for the use of glGetString(GL_EXTENSIONS)
+// within glext_ExtensionSupported.
+
+ SDL_Init( SDL_INIT_VIDEO);
+
+// the flags to pass to SDL_SetVideoMode
+ videoFlags := SDL_OPENGL;
+
+// get a SDL surface
+ surface := SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, videoFlags);
+
+// Initialization finished
+
+ if glext_ExtensionSupported(e1, s1) then
+ writeln ('test001, 1: failed');
+ if glext_ExtensionSupported(e1, s2) then
+ writeln ('test001, 2: failed');
+ if glext_ExtensionSupported(e2, s1) then
+ writeln ('test001, 3: failed');
+ if not glext_ExtensionSupported(e2, s2) then
+ writeln ('test001, 4: failed');
+ if not glext_ExtensionSupported(e2, s3) then
+ writeln ('test001, 5: failed');
+ if not glext_ExtensionSupported(e2, s4) then
+ writeln ('test001, 6: failed');
+ if not glext_ExtensionSupported(e2, s5) then
+ writeln ('test001, 7: failed');
+ if not glext_ExtensionSupported(e2, s6) then
+ writeln ('test001, 8: failed');
+ if not glext_ExtensionSupported(e2, s7) then
+ writeln ('test001, 9: failed');
+ if glext_ExtensionSupported(e2, s8) then
+ writeln ('test001, 10: failed');
+ if glext_ExtensionSupported(e2, s9) then
+ writeln ('test001, 11: failed');
+ if glext_ExtensionSupported(e2, s10) then
+ writeln ('test001, 12: failed');
+ if glext_ExtensionSupported(e2, s11) then
+ writeln ('test001, 13: failed');
+ if not glext_ExtensionSupported(e3, s1) then
+ writeln ('test001, 14: failed');
+
+ writeln ('End');
+end. \ No newline at end of file