This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cygwin linked opengl app displays only an empty window =(O|


Hi Antonio,

I am afraid that I know nothing at all about windows applications,
least of all with opengl,  I am strictly a console apps guy.  I have
seen other people have problems when mixing VC++ dll's with cygwin, so
it might simply be that you need to get a set of opengl libs compiled
for cygwin (if that isn't what you have already).

I am forwarding a copy of your mail to the cygwin list where someone
more knowledgeable than I might be able to offer some help.

Cheers,
	Gary.
	
----- Forwarded message from Antonio MATTA <amatta@atlas.ujavcali.edu.co> -----

Date: Sat, 16 Oct 1999 17:36:02 -0500 (COT)
From: Antonio MATTA <amatta@atlas.ujavcali.edu.co>
To: gvaughan@oranda.demon.co.uk
Subject: Help


Hi

Sorry to write you directly, but I have not been able to send a message
to the cygwin mailing list correctly.
I want to develop an aplication using OpenGl an Glut using cywing32.
I have compiled the example that I am sending to you , but when I execute
it,
it draws the window but nothing on it.
I do not know if I have to have a special consideration in order to use
OpenGl function on a Glut Window, because when I use Opengl functions and
MFC
to handle a window it draws them very well.

Thanks for your help.

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/Gl.h>
#include <GL/Glu.h>
#include <GL/glut.h>

#ifdef __CYGWIN__
 WinMainCRTStartup() { mainCRTStartup(); }
#endif


void init(void) 
{
   glClearColor (0.0, 0.0, 0.0, 0.0);
   glShadeModel (GL_FLAT);
}

void display(void)
{
  
   glClear (GL_COLOR_BUFFER_BIT);
   glColor3f (1.0, 1.0, 1.0);
   glLoadIdentity ();             /* clear the matrix */
           /* viewing transformation  */
   gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
   glScalef (1.0, 2.0, 1.0);      /* modeling transformation */ 
   glutWireCube(1.0);
   glFlush();
}

void reshape (int w, int h)
{
    
   glClearColor (0.0, 0.0, 0.0, 0.0);
   glViewport (0, 0, (GLsizei) w, (GLsizei) h); 
   glMatrixMode (GL_PROJECTION);
   glLoadIdentity ();
   glFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0);
   glMatrixMode (GL_MODELVIEW);
}

/* ARGSUSED1 */
void keyboard(unsigned char key, int x, int y)
{
   switch (key) {
      case 27:
         exit(0);
         break;
   }
}



int main(int argc, char** argv)
{  
    
   glutInit(&argc, argv);
   glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
   glutInitWindowSize (500, 500); 
   glutInitWindowPosition (100, 100);
   glutCreateWindow (argv[0]);
   init(); 
   glutDisplayFunc(display);
   glutReshapeFunc(reshape);
   glutKeyboardFunc(keyboard);
   glutMainLoop();
   return 0;
}

This is the Makefile:

##### MACROS #####
INCDIR = /cygnus/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include/GL
LIBDIR = /cygnus/cygwin-b20/H-i586-cygwin32/i586-cygwin32/lib
GL_LIBS = -L$(LIBDIR) -lglu32 -lopengl32 -lglut -lglut32 -lwing32 -lm
Wall = -g -O2 
CFLAGS= -mwindows -DWIN32 -D__WIN32__ -D_WINDOWS \
	-O2 -funroll-loops \
	-fexpensive-optimizations -fomit-frame-pointer -ffast-math \
	-malign-loops=2 -malign-jumps=2 -malign-functions=2
	
cube.exe:cube.o
	gcc $(Wall) $(CFLAGS) cube.o -o $@ $(GL_LIBS) -e _mainCRTStartup 

cube.o:cube.c
	gcc $(Wall) -c cube.c -I$(INCDIR)



----- End forwarded message -----

-- 
  ___              _   ___   __              _  email:gary@oranda.demon.co.uk
 / __|__ _ _ ___ _| | / / | / /_ _ _  _ __ _| |_  __ _ ___       gary@gnu.org 
| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \
 \___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/
home page:  /___/                      /___/                pgp-2 public key:
http://www.oranda.demon.co.uk               http://www.oranda.demon.co.uk/pgp

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]