From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,185b7565eacf2adf,start X-Google-Attributes: gid103376,public From: "Adrian B.Y. Hoe" Subject: Help: OpenGL doesn't draw with OA Date: 1997/06/13 Message-ID: <33a0bd94.quantum@quantum.pc.my>#1/1 X-Deja-AN: 248071471 Sender: Ada programming language Organization: Lexical Integration (M) Sdn Bhd Comments: To: intel-objectada@aonix.com Newsgroups: comp.lang.ada Date: 1997-06-13T00:00:00+00:00 List-Id: Hello: I am learning/experimenting OpenGL with OA for windows 7.0 I could not have a white square drawn on a blank window with black background. Below is my code. Can someone show me the correct way to do it? Also, can someone explain how the AuxReshapeFunc and AuxMainLoop work? Thanks in advance for your valuable time and effort. Adrian --------------------------------------------------------------------------- with Win32.Gl; with Win32.Glu; with Win32.Glaux; with Interfaces.C; with Interfaces.C.Strings; with System; with Unchecked_Conversion; use Win32.Gl; use Win32.Glu; use Win32.Glaux; use Interfaces; procedure TestOpenGL is function Conv is new Unchecked_Conversion (System.Address, AUXRESHAPEPROC); function Conv is new Unchecked_Conversion (System.Address, AUXMAINPROC); Window_Name : C.Char_Array := C.To_C("Test of OpenGL"); Res : Glenum; procedure MyInit; procedure Display; pragma Convention(Stdcall, Display); procedure MyInit is begin glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); -- glColor3f(1.0, 1.0, 1.0); -- glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); -- glBegin(GL_POLYGON); -- glVertex3f(0.25, 0.25, 0.0); -- glVertex3f(0.75, 0.25, 0.0); -- glVertex3f(0.75, 0.75, 0.0); -- glVertex3f(0.25, 0.75, 0.0); -- glEnd; -- glFlush; end MyInit; procedure Display is begin glColor3f(1.0, 1.0, 1.0); glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); glBegin(GL_POLYGON); glVertex3f(0.25, 0.25, 0.0); glVertex3f(0.75, 0.25, 0.0); glVertex3f(0.75, 0.75, 0.0); glVertex3f(0.25, 0.75, 0.0); glEnd; glFlush; end Display; begin AuxInitDisplayMode(AUX_SINGLE + AUX_RGB + AUX_DEPTH16); AuxInitPosition(0, 0, 400, 400); Res := AuxInitWindow(Window_Name(Window_Name'First)'Unchecked_Access); MyInit; -- AuxReshapeFunc(Conv(MyReshape'Address)); Auxmainloop(Conv(Display'Address)); end TestOpenGL; ---------------------------------------------------------------------------- -- B.Y. --------------------------------------------------------------------------- Adrian, B.Y. Hoe byHoe@quantum.pc.my \/ Business Development, VP \/ \/ \/ \/ \/ Phone : +60 3 495 4048 \/ \/ Lexical Integration (M) Sdn Bhd Fax : +60 3 495 4037 \/ 13-B Jalan Pandan Indah 4/2, Pandan Indah, 55100 Kuala Lumpur-Malaysia ---------------------------------------------------------------------------