From eda59aa87e6f651a734d2dfd9f30271764712f35 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 5 Jan 2006 11:01:18 +0000 Subject: [PATCH] Oops - bad file-completion typo. --- progs/fp/tri-param | Bin 13300 -> 0 bytes progs/fp/tri-param.c | 114 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) delete mode 100755 progs/fp/tri-param create mode 100644 progs/fp/tri-param.c diff --git a/progs/fp/tri-param b/progs/fp/tri-param deleted file mode 100755 index eee43fae8f045b39edaac83a5935364091b78f0e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13300 zcmc&)3v^sZd7gWBWv^w$SwG^KJnZ!=v4edj+p^;*fMr{=3)!9@B{nlggW>JMa#p51r8?s(y3OgK1y}WB;In zq8*&}{#@HL@O#fUYex>E_ z)A|)UztR7$#%6qH>iRvY^ zF(JYT)`gx_!Q+y!PB8ZV#KF!?EEnHaNOy^7!v}BLyrXHWlr;8viF7`hNw*cU*-Xw$ z#AWi1STfz5$z%aK5=iY^*Dcex<`OY4u{)WLXAX#HGM)6OkxU$5UPQMfdXj0W*#w!= zYfIjdK+^Vv*O<#?a%E{lGM`Pw4(`arDK2=-QI4prEt!1ML*-<$)|YLN=GwemGTkGh z-KdAuXienZST>ZikjMB&qtw;S?!`chXd)i-Vi0uZ^C}%l=%DS* zO|@iO9##94{i({4TSK8e}m?hV8(60_&s7UFt|IRfq;;u?uL z67D|Yh{PNbmkl}-mbjicODrUAAnqd`egg^1IZ|#v@o9-UV(t;*QxbFJ+@r+DCFTga z4-!8iF-OupMtn?Sj;Q-N;-eDpBYuLoU*b6NSBbL{bEMtl#QP-Xh`Y}bw@A#9cTW-5 zOUxPI{*bsvV$KBjG;u^?&Iq?e9G1ABc$ip7d^hn3@$ly0bFlxt528fjU4Hi6XD?!MITVivKYbLkvF|=cHW)tq-NMJueBzlHcEj(eRg9Oip@%Xe175_{sca)Qc8qc>NL!-()*m$05 zZtw{5{fSZ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kdNc#_^ln0!6H z`E2x<*Th+_w@BS{W1PWMVdW&f_J|Nal^W{D*ueCaeQZP<7Q+u>gh(_|a$j}COIHiA z56|!tq;u_IxqO!RjC0IPXuzB66Q)u~H1>?#&v`G87_Waand_&*s${N{3ab*h9xAK~ z;JT-c`MK$%6Uu}4}nRy;{x)QpkMA^IhlXqxDc^`yfrtT z6cCYdAmxiE;UyF1O%V6QRF5k);uXFe#5^#WKwM`4II#!L(*%=kc+T%;Lbew*>J zFta}aY{tieSNv~)&G=ZjY4%lM`2if`}BCtw&zQSD(_OZnhpxKqnbeeTh?UE8~VlKgRv4`}(9f%*QT>{W@cYk9Yp z|EtD4W3m0e(Af0fh{om~rll8YBM$@n`)4VzyhbAJRf%=LX8mCQZ2~rDt~nUr24IG7 zfLMOB#@tVdlNy`$-wy0A?;b5T?foRMS-&Efe}Apzo3*_sHQu1{cQiKR^8;YB9?!w8 zzRB83?wV$3BziVmS+w81ayZ*Wj$|G(3$@C3NH}9KW*d4!>YObIbyeY2m zM!U07_W&GO1#haGyis{&7U$<&?4Z2pNyUj*d!zAuChEr0ao(U+7e?XzFjsBg?A|Ny zoz~ZnUmbmuTf%g&!yVwiAgitc`z{Xa`>5sHv{PT5RoN!qC^jGIWj8db%f%C}*iPsM z=_d6zmD3-1{7S6!wfCgdb>Isw(fXS_;qGo!cEF_0W_2cAai*W6+}MKWzwNAU^iC`R ztyBH>`|dwqaCew@f+yNicZtilfRh_GZg6@MxHHie_1r@GHm9>sM7KBZ+_Jejx^vsM jw#N2o`{pgpjd*Gk@*Xw&O1Dt= +#include +#include +#define GL_GLEXT_PROTOTYPES +#include +#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; +} -- 2.30.2