delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/10/17/05:11:41

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Date: Sun, 17 Oct 1999 01:16:47 +0100
From: "Gary V. Vaughan" <gary AT oranda DOT demon DOT co DOT uk>
To: Antonio MATTA <amatta AT atlas DOT ujavcali DOT edu DOT co>
Cc: cygwin AT sourceware DOT cygnus DOT com
Subject: cygwin linked opengl app displays only an empty window =(O|
Message-ID: <19991017011647.A22657@demon.co.uk>
Mime-Version: 1.0
User-Agent: Mutt/1.0pre3i
X-Operating-System: Linux oranda 2.2.10

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 AT atlas DOT ujavcali DOT edu DOT co> -----

Date: Sat, 16 Oct 1999 17:36:02 -0500 (COT)
From: Antonio MATTA <amatta AT atlas DOT ujavcali DOT edu DOT co>
To: gvaughan AT oranda DOT demon DOT co DOT 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 AT oranda DOT demon DOT co DOT uk
 / __|__ _ _ ___ _| | / / | / /_ _ _  _ __ _| |_  __ _ ___       gary AT gnu DOT 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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019