|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
glutEntryFunc on Windows XPHello everyone,
I'm trying to debug my library under Windows XP at the moment, and it seems like glutEntryFunc is never called, even though the comments in the source say that it will at least be called when the pointer leaves the window. Is this a known bug? Also, the code uses 0x02A2, whereas WM_MOUSELEAVE would actually be 0x02A3.. Thanks, Yours, Florian -- 0666 - Filemode of the Beast ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XPFlorian,
To the best of my knowledge this is not a known bug. This means simply that I don't know about it. The code in question was put in by me as SVN revision 587, with an update (also by me) to handle menus as revision 606. The update makes me think that the code actually worked when it was first put in, and frankly I wouldn't put it past Microsoft to have changed the event code from 0x02A2 to 0x02A3. But that may also be my natural tendency to want to blame somebody else for my mistakes. I remember using the hex code because some older versions of the header files didn't defined the "WM_MOUSELEAVE" macro. John F. Fay Technical Fellow Jacobs Technology TEAS Group 850-883-1294 -----Original Message----- From: Florian Echtler [mailto:floe@...] Sent: Friday, August 14, 2009 5:39 AM To: freeglut-developer@... Subject: [Freeglut-developer] glutEntryFunc on Windows XP Hello everyone, I'm trying to debug my library under Windows XP at the moment, and it seems like glutEntryFunc is never called, even though the comments in the source say that it will at least be called when the pointer leaves the window. Is this a known bug? Also, the code uses 0x02A2, whereas WM_MOUSELEAVE would actually be 0x02A3.. Thanks, Yours, Florian -- 0666 - Filemode of the Beast ------------------------------------------------------------------------ ------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XPSee my 2c below.. > Florian, > > To the best of my knowledge this is not a known bug. This means > simply that I don't know about it. > > The code in question was put in by me as SVN revision 587, with > an update (also by me) to handle menus as revision 606. The update > makes me think that the code actually worked when it was first put in, > and frankly I wouldn't put it past Microsoft to have changed the event > code from 0x02A2 to 0x02A3. But that may also be my natural tendency to > want to blame somebody else for my mistakes. > > I remember using the hex code because some older versions of the > header files didn't defined the "WM_MOUSELEAVE" macro. > > John F. Fay > Technical Fellow > Jacobs Technology TEAS Group > 850-883-1294 > > -----Original Message----- > > Hello everyone, > > I'm trying to debug my library under Windows XP at the moment, and it > seems like glutEntryFunc is never called, even though the comments in > the source say that it will at least be called when the pointer leaves > the window. Is this a known bug? Also, the code uses 0x02A2, whereas > WM_MOUSELEAVE would actually be 0x02A3.. > > Thanks, Yours, Florian The correct value for WM_MOUSELEAVE is 0x2A3. 0x2A2 is the value of WM_NCMOUSELEAVE (Non-Client area, i.e. including the border added by Windows). This is according to the w32api package of Cygwin. HTH, - André Bleau, Cygwin's volunteer OpenGL package maintainer. Nous sommes vos photos. Partagez-nous dès maintenant avec Windows Live Photos. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XPAndré,
Thanks very much for the explanation. There remains now the question of what to do about it. Here is the apparent situation: * Evidently the callback is not being invoked under any circumstances in Windows XP. * The "freeglut" case uses the hexadecimal code rather than a defined symbol * The hexadecimal code does not appear in the header file on my system. If I remember correctly, it didn't appear on my (student version) system at home either, although it used to appear in the header file on my older system at work. Therefore it was never universal and it appears now that Microsoft has deprecated it. With all that in mind, I propose that we change "0x02A2" to "WM_MOUSELEAVE". I'll need to check it out on my system at home to see if that is supported; if it isn't, we may need to use "0x02A3" instead and put a comment explaining the hex code. Florian, can you try making the change and seeing if it works? John F. Fay Technical Fellow Jacobs Technology TEAS Group 850-883-1294 -----Original Message----- From: André Bleau [mailto:andre_bleau@...] Sent: Monday, August 17, 2009 6:25 PM To: freeglut-developer@... Subject: Re: [Freeglut-developer] glutEntryFunc on Windows XP Hi Florian & John, See my 2c below.. > Florian, > > To the best of my knowledge this is not a known bug. This means simply > that I don't know about it. > > The code in question was put in by me as SVN revision 587, with an > update (also by me) to handle menus as revision 606. The update makes > me think that the code actually worked when it was first put in, and > frankly I wouldn't put it past Microsoft to have changed the event > code from 0x02A2 to 0x02A3. But that may also be my natural tendency > to want to blame somebody else for my mistakes. > > I remember using the hex code because some older versions of the > header files didn't defined the "WM_MOUSELEAVE" macro. > > John F. Fay > Technical Fellow > Jacobs Technology TEAS Group > 850-883-1294 > > -----Original Message----- > > Hello everyone, > > I'm trying to debug my library under Windows XP at the moment, and it > seems like glutEntryFunc is never called, even though the comments in > the source say that it will at least be called when the pointer leaves > the window. Is this a known bug? Also, the code uses 0x02A2, whereas > WM_MOUSELEAVE would actually be 0x02A3.. > > Thanks, Yours, Florian The correct value for WM_MOUSELEAVE is 0x2A3. 0x2A2 is the value of WM_NCMOUSELEAVE (Non-Client area, i.e. including the border added by Windows). This is according to the w32api package of Cygwin. HTH, - André Bleau, Cygwin's volunteer OpenGL package maintainer. ________________________________ Nous sommes vos photos. Partagez-nous dès maintenant avec Windows Live Photos. <http://go.microsoft.com/?linkid=9666049> ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XP> With all that in mind, I propose that we change "0x02A2" to
> "WM_MOUSELEAVE". I'll need to check it out on my system at home to > see if that is supported; if it isn't, we may need to use "0x02A3" > instead and put a comment explaining the hex code. > > Florian, can you try making the change and seeing if it works? Hello John, I've tried WM_MOUSELEAVE with no discernible result. What I completely forgot to mention is that I'm doing all this in a virtual machine (VirtualBox). Can anybody reproduce this behaviour on a natively running WinXP? Thanks, Florian -- 0666 - Filemode of the Beast ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XPwtf stop sending that, how can i unsubscribe from this???? i'm so fucking tired, always mails from freeglut! damn it! ¿Quieres un regalo de cumpleaños? Messenger te lo da ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XPMon, Aug 24, 2009 at 20:07, Daniel Enriquez:
> > wtf stop sending that, how can i unsubscribe from this???? i'm so fucking > tired, > always mails from freeglut! damn it! This is a mailing list. Read by people actually. Anyway, you should have received a confirmation email to unsubscribe now. You could otherwise have done it all by yourself thanks to the following link, which is added to all emails sent to the ML: > _______________________________________________ > Freeglut-developer mailing list > Freeglut-developer@... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer -- Julien Guertault ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XPOK, I have two bits of data here. First, my 1998 student version of
MSVC 6.0 at home does indeed have the "WM_MOUSELEAVE" defined constant. Second, when I try running "CallbackMaker" and move the mouse out of a window, I do not get either a 0x02A2 or a WM_MOUSELEAVE (0x02A3) event. Unfortunately I don't remember what was supposed to trigger the event and I don't have help files here at home. A quick Google search turns up this intriguing text: "The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent." I'm reminded of the magic trick whose last instruction is "now pull out the (fill in the blank) that you had previously hidden up your sleeve" with no prior indication that you were supposed to hide anything up your sleeve. Let me try making some time to do something about this. If somebody wants to step in and fix it, feel free. - John At 01:04 PM 8/24/2009, you wrote: > > With all that in mind, I propose that we change "0x02A2" to > > "WM_MOUSELEAVE". I'll need to check it out on my system at home to > > see if that is supported; if it isn't, we may need to use "0x02A3" > > instead and put a comment explaining the hex code. > > > > Florian, can you try making the change and seeing if it works? > >Hello John, > >I've tried WM_MOUSELEAVE with no discernible result. What I completely >forgot to mention is that I'm doing all this in a virtual machine >(VirtualBox). Can anybody reproduce this behaviour on a natively running >WinXP? > >Thanks, Florian >-- >0666 - Filemode of the Beast > > >------------------------------------------------------------------------------ >Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >trial. Simplify your report design, integration and deployment - and focus on >what you do best, core application coding. Discover what's new with >Crystal Reports now. http://p.sf.net/sfu/bobj-july >_______________________________________________ >Freeglut-developer mailing list >Freeglut-developer@... >https://lists.sourceforge.net/lists/listinfo/freeglut-developer ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
GameMode behaviourThere is not a great deal of solid documentation to be found about Glut's
GameMode. I found the following on the web but I wonder if it is a reliable explanation of how GameMode _should_ function? Most examples merely show the application entering GameMode and never returning. I have an application that needs to go full-screen and also return to decorated window mode. I'm working with freeglut 2.4.0 on both Win XP and Linux Ubuntu and with a variety of graphics hardware Nvidia 8800 to Intel 945GM. I get erratic behaviour -- sometimes the return from GameMode has the video driver very confused and a system has to be restarted -- on another platform the return takes several seconds. --quote: When game mode is entered, certain GLUT functionality is disable to facilitate high-performance fullscreen rendering. GLUT pop-up menus are not available while in game mode. Other created windows and subwindows are not displayed in GLUT game mode. Game mode will also hide all other applications running on the computer's display screen. The intent of these restrictions is to eliminate window clipping issues, permit screen display format changes, and permit fullscreen rendering optimization such as page flipping for fullscreen buffer swaps. The value returned by glutEnterGameMode is a unique small integer identifier for the fullscreen window. The range of allocated identifiers starts at one. This window identifier can be used when calling glutSetWindow. After leaving game mode, the GLUT functionality disabled in game mode is available again. The game mode window (and its OpenGL rendering state) is destroyed when leaving game mode. Any windows and subwindows created before entering the game mode are displayed in their previous locations. The OpenGL state of normal GLUT windows and subwindows is not disturbed by entering and/or leaving game mode. --unquote Here's a code fragment with my two functions the first to switch to full screen the second to return. I had a problem with just entering and leaving GameMode so I explicitly destroy the current window before entering GameMode and I explicitly create a new window after returning from GameMode. My application only has one window. The callbacks are re-registered after entering GameMode and whenever a new window is created. If I knew the design intent I could write explicitly for that and then start debugging the particular OS and hardware issues that may be present. Clive McCarthy /*------------------------------------------------------------------------------ ------------------------------------------------------------------------------*/ void switch_to_full_screen(void) { char mode_string[24]; full_screen = TRUE; sprintf(mode_string, "%dx%d:32@60", glutGet(GLUT_SCREEN_WIDTH), glutGet(GLUT_SCREEN_HEIGHT)); glutGameModeString(mode_string); if(glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) { printf("GameMode %s is possible\n", mode_string); glutDestroyWindow(glut_pane_id); // destroys the current graphics window glutEnterGameMode(); glut_OpenGL_call_backs(); glutSetCursor(GLUT_CURSOR_NONE); // hide the cursor } else { printf("GameMode %s NOT possible\n", mode_string); glutFullScreen(); } #ifdef UBUNTU_PORT system("wmctrl -r\"FourteenthStreetStudio\" -b add,fullscreen,skip_taskbar"); #endif if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) { printf("GameMode is now active...\n"); } else { //printf("GameMode is NOT active\n"); } OpenGL_error_check(__FILE__, __LINE__); glutPostRedisplay(); } /*------------------------------------------------------------------------------ set the window's width and position for debugging Window managers (including gnome) adhere to a standard interface, the EWMH/NetWM specification. This allows programs that remote-control their functionality. And fortunately, someone already has written one called "wmctrl". ------------------------------------------------------------------------------*/ #ifdef __FREEGLUT__ #define WINDOW_X_ORIGIN 0 #define WINDOW_Y_ORIGIN 0 #else #define WINDOW_X_ORIGIN 4 #define WINDOW_Y_ORIGIN 24 #endif void set_debug_window_size(void) { int screen_width, screen_length; full_screen = FALSE; if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) { printf("returning from GameMode\n"); glutLeaveGameMode(); glut_pane_id = glutCreateWindow("FourteenthStreetStudio"); glut_OpenGL_call_backs(); } #ifdef UBUNTU_PORT system("wmctrl -r\"FourteenthStreetStudio\" -b remove,fullscreen,skip_taskbar"); #endif screen_width = glutGet(GLUT_SCREEN_WIDTH); screen_length = glutGet(GLUT_SCREEN_HEIGHT); switch(screen_width) { case 3840: // dual screen WUXGA glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2), WINDOW_Y_ORIGIN); glutReshapeWindow(1824, 1140); // 16:10 break; case 3200: // dual screen UXGA glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2), WINDOW_Y_ORIGIN); glutReshapeWindow (1584, 990); // 16:10 break; etc. etc. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
|
|
|
Re: GameMode behaviour<COL116-W29AA73C245C6AFB98457EC93010@...> <5A0D3AA05E51474C99134F14F2B418100504BDAD@...> <1251137088.6099.14.camel@pancake> <200908290922736.SM01448@...> <AGD.20090907094453133@...> <20090927221953.SM01004@...> Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 John=2C Sorry to hear about the losses in you immediate family... =20 I received good advice from someone [Member #20245] on the OpenGL forum=2C = who made small modifications to my code and got GameMode to run satisfactor= ily on Ubuntu. I have appended the modified code to the end of this email= =2C so that others can see what probably works. I have not yet tested this = myself. =20 It seems my system calls to "wmctrl" to remove the Ubuntu toolbars may have= upset things. I have also figured out that the network applet on the Ubunt= u toolbar=2C which has been a problem=2C can be hidden/disabled so that it = doesn't 'blink-through' the OpenGL renderings when using conventional glutF= ullScreen(). I now have a couple of solutions for truly full screen freeglu= t use=2C including the use of GameMode. =20 Now that I have confirmation that it works on Ubuntu I shall test it on the= feeble 945GM Intel hardware with both XP and Ubuntu. Intel's Ubuntu OpenGL= drivers for the 945GM are inferior to their XP drivers -- the former is on= ly OpenGL 1.3 -- so I may have an issue with the driver. =20 Clive. ---------------------------------------- > Date: Sun=2C 27 Sep 2009 21:19:34 -0500 > To: freeglut-developer@... > From: johnffay@... > Subject: Re: [Freeglut-developer] GameMode behaviour > > Clive=2C > > Thanks for your input. Unfortunately there isn't a lot more > documentation beyond what you have found already. > > One thing that I seriously recommend is getting an > up-to-date copy of the source. We've been trying to get out a new > release for over a year now=2C but the main project admin is working > 16-hour days on his day job and I've been dealing with three deaths > in my immediate family plus some other stuff that is going on. But > we *are* working on it. When I can come up for air I will look at > your e-mail in more detail. > > - John > > > At 10:20 AM 9/6/2009=2C you wrote: > >>There is not a great deal of solid documentation to be found about Glut's >>GameMode. I found the following on the web but I wonder if it is a reliab= >>explanation of how GameMode _should_ function? Most examples merely show = the >>application entering GameMode and never returning. I have an application >>that needs to go full-screen and also return to decorated window mode. I'= m >>working with freeglut 2.4.0 on both Win XP and Linux Ubuntu and with a >>variety of graphics hardware Nvidia 8800 to Intel 945GM. I get erratic >>behaviour -- sometimes the return from GameMode has the video driver very >>confused and a system has to be restarted -- on another platform the retu= rn >>takes several seconds. > > _______________________________________________ I tried your code with a few little changes and it worked fine for me. The = changes that I made were to remove the system calls and to call init() alon= g with the glut_OpenGL_call_backs() each time. I changed the code so it tog= gles between fullscreen and windowed mode with any key press (except esc wh= ich exits the program). Note I ran the following code on Ubuntu 9.04+GNOME = window manager with freeglut. I would be curious if you can compile and run= it without problems. Code:// http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=3Dshowfl= at&Number=3D263588#Post263588 #include <cstdio> #include <cstdlib> #include <GL/glut.h> void display(void)=3B void init(void)=3B void set_debug_window_size(void)=3B void switch_to_full_screen(void)=3B #define TRUE true #define FALSE false bool full_screen =3D FALSE=3B int glut_pane_id =3D 0=3B void SampleGameModeKeyboard( unsigned char cChar=2C int nMouseX=2C int nMou= seY ) { static int toggleMode=3Dtrue=3B if( cChar =3D=3D 27 ) exit(0)=3B if (toggleMode) { set_debug_window_size()=3B toggleMode=3D!toggleMode=3B } else { switch_to_full_screen()=3B toggleMode=3D!toggleMode=3B } } void glut_OpenGL_call_backs() { init()=3B glutKeyboardFunc( SampleGameModeKeyboard )=3B glutDisplayFunc(display)=3B }=3B void switch_to_full_screen(void) { char mode_string[24]=3B full_screen =3D TRUE=3B sprintf(mode_string=2C "%dx%d:32@60"=2C glutGet(GLUT_SCREEN_WIDTH)=2C glutGet(GLUT_SCREEN_HEIGHT))=3B glutGameModeString(mode_string)=3B if(glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) { printf("GameMode %s is possible\n"=2C mode_string)=3B // destroys the current graphics window glutDestroyWindow(glut_pane_id)=3B glutEnterGameMode()=3B glut_OpenGL_call_backs()=3B // hide the cursor glutSetCursor(GLUT_CURSOR_NONE)=3B } else { printf("GameMode %s NOT possible\n"=2C mode_string)=3B glutFullScreen()=3B } #ifdef UBUNTU_PORT //system("wmctrl -r\"FourteenthStreetStudio\" -b add=2Cfullscreen=2Cskip_= taskbar")=3B #endif if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) { printf("GameMode is now active...\n")=3B } else { //printf("GameMode is NOT active\n")=3B } } /*-------------------------------------------------------------------------= - set the window's width and position for debugging Window managers (including gnome) adhere to a standard interface=2C the EWMH/NetWM specification. This allows programs that remote-control their functionality. And fortunately=2C someone already has written one called "wmctrl". --------------------------------------------------------------------------*= / #ifdef __FREEGLUT__ #define WINDOW_X_ORIGIN 0 #define WINDOW_Y_ORIGIN 0 #else #define WINDOW_X_ORIGIN 4 #define WINDOW_Y_ORIGIN 24 #endif void set_debug_window_size(void) { int screen_width=2C screen_length=3B full_screen =3D FALSE=3B if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) { printf("returning from GameMode\n")=3B glutLeaveGameMode()=3B glut_pane_id =3D glutCreateWindow("FourteenthStreetStudio")=3B glut_OpenGL_call_backs()=3B } #ifdef UBUNTU_PORT //system("wmctrl -r\"FourteenthStreetStudio\" -b remove=2Cfullscreen=2Csk= ip_taskbar")=3B #endif /*screen_width =3D glutGet(GLUT_SCREEN_WIDTH)=3B screen_length =3D glutGet(GLUT_SCREEN_HEIGHT)=3B switch(screen_width) { case 3840: // dual screen WUXGA glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C WINDOW_Y_ORIGIN)=3B glutReshapeWindow(1824=2C 1140)=3B // 16:10 break=3B case 3200: // dual screen UXGA glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C WINDOW_Y_ORIGIN)=3B glutReshapeWindow (1584=2C 990)=3B // 16:10 break=3B //etc } */ } // following modified from http://www.opengl.org/resources/code/samples/glu= t_examples/examples/cube.c /* Copyright (c) Mark J. Kilgard=2C 1997. */ /* This program is freely distributable without licensing fees and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ /* This program was requested by Patrick Earl=3B hopefully someone else will write the equivalent Direct3D immediate mode program. */ #include <GL/glut.h> GLfloat light_diffuse[] =3D /* Red diffuse light. */ { 1.0=2C 0.0=2C 0.0=2C 1.0 }=3B GLfloat light_position[] =3D /* Infinite light location. */ { 1.0=2C 1.0=2C 1.0=2C 0.0 }=3B GLfloat n[6][3] =3D /* Normals for the 6 faces of a cube. */ { {-1.0=2C 0.0=2C 0.0}=2C { 0.0=2C 1.0=2C 0.0 } =2C { 1.0=2C 0.0=2C 0.0 }=2C {0.0=2C -1.0=2C 0.0}=2C { 0.0=2C 0.0=2C 1.0 } =2C { 0.0=2C 0.0=2C -1.0 } }=3B GLint faces[6][4] =3D /* Vertex indices for the 6 faces of a c= ube. */ { {0=2C 1=2C 2=2C 3}=2C { 3=2C 2=2C 6=2C 7 } =2C { 7=2C 6=2C 5=2C 4 }=2C {4=2C 5=2C 1=2C 0}=2C { 5=2C 6=2C 2=2C 1 } =2C { 7=2C 4=2C 0=2C 3 } }=3B GLfloat v[8][3]=3B /* Will be filled in with X=2CY=2CZ vert= exes. */ void drawBox(void) { int i=3B for (i =3D 0=3B i < 6=3B i++) { glBegin(GL_QUADS)=3B glNormal3fv(&n[i][0])=3B glVertex3fv(&v[faces[i][0]][0])=3B glVertex3fv(&v[faces[i][1]][0])=3B glVertex3fv(&v[faces[i][2]][0])=3B glVertex3fv(&v[faces[i][3]][0])=3B glEnd()=3B } } void display(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)=3B drawBox()=3B glutSwapBuffers()=3B } void init(void) { /* Setup cube vertex data. */ v[0][0] =3D v[1][0] =3D v[2][0] =3D v[3][0] =3D -1=3B v[4][0] =3D v[5][0] =3D v[6][0] =3D v[7][0] =3D 1=3B v[0][1] =3D v[1][1] =3D v[4][1] =3D v[5][1] =3D -1=3B v[2][1] =3D v[3][1] =3D v[6][1] =3D v[7][1] =3D 1=3B v[0][2] =3D v[3][2] =3D v[4][2] =3D v[7][2] =3D 1=3B v[1][2] =3D v[2][2] =3D v[5][2] =3D v[6][2] =3D -1=3B /* Enable a single OpenGL light. */ glLightfv(GL_LIGHT0=2C GL_DIFFUSE=2C light_diffuse)=3B glLightfv(GL_LIGHT0=2C GL_POSITION=2C light_position)=3B glEnable(GL_LIGHT0)=3B glEnable(GL_LIGHTING)=3B /* Use depth buffering for hidden surface elimination. */ glEnable(GL_DEPTH_TEST)=3B /* Setup the view of the cube. */ glMatrixMode(GL_PROJECTION)=3B gluPerspective( /* field of view in degree */ 40.0=2C /* aspect ratio */ 1.0=2C /* Z near */ 1.0=2C /* Z far */ 10.0)=3B glMatrixMode(GL_MODELVIEW)=3B gluLookAt(0.0=2C 0.0=2C 5.0=2C /* eye is at (0=2C0=2C5) */ 0.0=2C 0.0=2C 0.0=2C /* center is at (0=2C0=2C0) */ 0.0=2C 1.0=2C 0.)=3B /* up is in positive Y direction */ /* Adjust cube position to be asthetic angle. */ glTranslatef(0.0=2C 0.0=2C -1.0)=3B glRotatef(60=2C 1.0=2C 0.0=2C 0.0)=3B glRotatef(-20=2C 0.0=2C 0.0=2C 1.0)=3B } int main(int argc=2C char **argv) { glutInit(&argc=2C argv)=3B glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)=3B glut_pane_id=3DglutCreateWindow("red 3D lighted cube")=3B switch_to_full_screen()=3B glutMainLoop()=3B return 0=3B /* ANSI C requires main to return int. *= / } =0A= _________________________________________________________________=0A= Hotmail=AE has ever-growing storage! Don=92t worry about storage limits.=0A= http://windowslive.com/Tutorial/Hotmail/Storage?ocid=3DTXT_TAGLM_WL_HM_Tuto= rial_Storage_062009= ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XPIt would appear that in order for "WM_MOUSELEAVE" to show up, we need
to call "TrackMouseEvent" when the mouse enters a window. Is there a need for this functionality? If not, we can simply take out the "WM_MOUSELEAVE" or "0x02A3" block. Preferences? - John At 07:22 AM 8/29/2009, you wrote: >OK, I have two bits of data here. First, my 1998 student version of >MSVC 6.0 at home does indeed have the "WM_MOUSELEAVE" defined >constant. Second, when I try running "CallbackMaker" and move the >mouse out of a window, I do not get either a 0x02A2 or a >WM_MOUSELEAVE (0x02A3) event. > >Unfortunately I don't remember what was supposed to trigger the event >and I don't have help files here at home. A quick Google search >turns up this intriguing text: > > "The WM_MOUSELEAVE message is posted to a window when the >cursor leaves the client area of the window specified in a prior call >to TrackMouseEvent." > >I'm reminded of the magic trick whose last instruction is "now pull >out the (fill in the blank) that you had previously hidden up your >sleeve" with no prior indication that you were supposed to hide >anything up your sleeve. > >Let me try making some time to do something about this. If somebody >wants to step in and fix it, feel free. > > - John > > >At 01:04 PM 8/24/2009, you wrote: > > > > With all that in mind, I propose that we change "0x02A2" to > > > "WM_MOUSELEAVE". I'll need to check it out on my system at home to > > > see if that is supported; if it isn't, we may need to use "0x02A3" > > > instead and put a comment explaining the hex code. > > > > > > Florian, can you try making the change and seeing if it works? > > > >Hello John, > > > >I've tried WM_MOUSELEAVE with no discernible result. What I completely > >forgot to mention is that I'm doing all this in a virtual machine > >(VirtualBox). Can anybody reproduce this behaviour on a natively running > >WinXP? > > > >Thanks, Florian > >-- > >0666 - Filemode of the Beast > > > > > >------------------------------------------------------------------- > ----------- > >Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > >trial. Simplify your report design, integration and deployment - > and focus on > >what you do best, core application coding. Discover what's new with > >Crystal Reports now. http://p.sf.net/sfu/bobj-july > >_______________________________________________ > >Freeglut-developer mailing list > >Freeglut-developer@... > >https://lists.sourceforge.net/lists/listinfo/freeglut-developer > > >------------------------------------------------------------------------------ >Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >trial. Simplify your report design, integration and deployment - and focus on >what you do best, core application coding. Discover what's new with >Crystal Reports now. http://p.sf.net/sfu/bobj-july >_______________________________________________ >Freeglut-developer mailing list >Freeglut-developer@... >https://lists.sourceforge.net/lists/listinfo/freeglut-developer ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: GameMode behaviourClive,
Many thanks for your contribution here. Is there anything that I need to put into "freeglut" to get it to work on Ubuntu before the next release? - John At 11:19 AM 9/28/2009, you wrote: >John=2C >Sorry to hear about the losses in you immediate family... >=20 >I received good advice from someone [Member #20245] on the OpenGL forum=2C = >who made small modifications to my code and got GameMode to run satisfactor= >ily on Ubuntu. I have appended the modified code to the end of this email= >=2C so that others can see what probably works. I have not yet tested this = >myself. >=20 >It seems my system calls to "wmctrl" to remove the Ubuntu toolbars may have= > upset things. I have also figured out that the network applet on the Ubunt= >u toolbar=2C which has been a problem=2C can be hidden/disabled so that it = >doesn't 'blink-through' the OpenGL renderings when using conventional glutF= >ullScreen(). I now have a couple of solutions for truly full screen freeglu= >t use=2C including the use of GameMode. >=20 >Now that I have confirmation that it works on Ubuntu I shall test it on the= > feeble 945GM Intel hardware with both XP and Ubuntu. Intel's Ubuntu OpenGL= > drivers for the 945GM are inferior to their XP drivers -- the former is on= >ly OpenGL 1.3 -- so I may have an issue with the driver. >=20 >Clive. >---------------------------------------- > > Date: Sun=2C 27 Sep 2009 21:19:34 -0500 > > To: freeglut-developer@... > > From: johnffay@... > > Subject: Re: [Freeglut-developer] GameMode behaviour > > > > Clive=2C > > > > Thanks for your input. Unfortunately there isn't a lot more > > documentation beyond what you have found already. > > > > One thing that I seriously recommend is getting an > > up-to-date copy of the source. We've been trying to get out a new > > release for over a year now=2C but the main project admin is working > > 16-hour days on his day job and I've been dealing with three deaths > > in my immediate family plus some other stuff that is going on. But > > we *are* working on it. When I can come up for air I will look at > > your e-mail in more detail. > > > > - John > > > > > > At 10:20 AM 9/6/2009=2C you wrote: > > > >>There is not a great deal of solid documentation to be found about Glut's > >>GameMode. I found the following on the web but I wonder if it is a reliab= >le > >>explanation of how GameMode _should_ function? Most examples merely show = >the > >>application entering GameMode and never returning. I have an application > >>that needs to go full-screen and also return to decorated window mode. I'= >m > >>working with freeglut 2.4.0 on both Win XP and Linux Ubuntu and with a > >>variety of graphics hardware Nvidia 8800 to Intel 945GM. I get erratic > >>behaviour -- sometimes the return from GameMode has the video driver very > >>confused and a system has to be restarted -- on another platform the retu= >rn > >>takes several seconds. > > > > >_______________________________________________ > >I tried your code with a few little changes and it worked fine for me. The = >changes that I made were to remove the system calls and to call init() alon= >g with the glut_OpenGL_call_backs() each time. I changed the code so it tog= >gles between fullscreen and windowed mode with any key press (except esc wh= >ich exits the program). Note I ran the following code on Ubuntu 9.04+GNOME = >window manager with freeglut. I would be curious if you can compile and run= > it without problems. > >Code:// http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=3Dshowfl= >at&Number=3D263588#Post263588 >#include <cstdio> >#include <cstdlib> >#include <GL/glut.h> >void display(void)=3B >void init(void)=3B >void set_debug_window_size(void)=3B >void switch_to_full_screen(void)=3B >#define TRUE true >#define FALSE false >bool full_screen =3D FALSE=3B >int glut_pane_id =3D 0=3B >void SampleGameModeKeyboard( unsigned char cChar=2C int nMouseX=2C int nMou= >seY ) >{ > static int toggleMode=3Dtrue=3B > if( cChar =3D=3D 27 ) exit(0)=3B > if (toggleMode) > { > set_debug_window_size()=3B > toggleMode=3D!toggleMode=3B > } > else > { > switch_to_full_screen()=3B > toggleMode=3D!toggleMode=3B > } >} > >void glut_OpenGL_call_backs() >{ > init()=3B > glutKeyboardFunc( SampleGameModeKeyboard )=3B > glutDisplayFunc(display)=3B >}=3B >void switch_to_full_screen(void) >{ > char mode_string[24]=3B > full_screen =3D TRUE=3B > sprintf(mode_string=2C "%dx%d:32@60"=2C glutGet(GLUT_SCREEN_WIDTH)=2C > glutGet(GLUT_SCREEN_HEIGHT))=3B > glutGameModeString(mode_string)=3B > if(glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) > { > printf("GameMode %s is possible\n"=2C mode_string)=3B > // destroys the current graphics window > glutDestroyWindow(glut_pane_id)=3B > glutEnterGameMode()=3B > glut_OpenGL_call_backs()=3B > // hide the cursor > glutSetCursor(GLUT_CURSOR_NONE)=3B > } > else > { > printf("GameMode %s NOT possible\n"=2C mode_string)=3B > glutFullScreen()=3B > } > #ifdef UBUNTU_PORT > //system("wmctrl -r\"FourteenthStreetStudio\" -b add=2Cfullscreen=2Cskip_= >taskbar")=3B > #endif > if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) > { > printf("GameMode is now active...\n")=3B > } > else > { > //printf("GameMode is NOT active\n")=3B > } >} > >/*-------------------------------------------------------------------------= >- >set the window's width and position for debugging >Window managers (including gnome) >adhere to a standard interface=2C the EWMH/NetWM specification. >This allows programs that remote-control their functionality. >And fortunately=2C someone already has written one called "wmctrl". >--------------------------------------------------------------------------*= >/ >#ifdef __FREEGLUT__ >#define WINDOW_X_ORIGIN 0 >#define WINDOW_Y_ORIGIN 0 >#else >#define WINDOW_X_ORIGIN 4 >#define WINDOW_Y_ORIGIN 24 >#endif >void set_debug_window_size(void) >{ > int screen_width=2C screen_length=3B > full_screen =3D FALSE=3B > if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) > { > printf("returning from GameMode\n")=3B > glutLeaveGameMode()=3B > glut_pane_id =3D glutCreateWindow("FourteenthStreetStudio")=3B > glut_OpenGL_call_backs()=3B > } > #ifdef UBUNTU_PORT > //system("wmctrl -r\"FourteenthStreetStudio\" -b remove=2Cfullscreen=2Csk= >ip_taskbar")=3B > #endif > /*screen_width =3D glutGet(GLUT_SCREEN_WIDTH)=3B > screen_length =3D glutGet(GLUT_SCREEN_HEIGHT)=3B > switch(screen_width) > { > case 3840: // dual screen WUXGA > glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C > WINDOW_Y_ORIGIN)=3B > glutReshapeWindow(1824=2C 1140)=3B // 16:10 > break=3B > case 3200: // dual screen UXGA > glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C > WINDOW_Y_ORIGIN)=3B > glutReshapeWindow (1584=2C 990)=3B // 16:10 > break=3B > //etc > } > */ >} > >// following modified from http://www.opengl.org/resources/code/samples/glu= >t_examples/examples/cube.c >/* Copyright (c) Mark J. Kilgard=2C 1997. */ >/* This program is freely distributable without licensing fees > and is provided without guarantee or warrantee expressed or > implied. This program is -not- in the public domain. */ >/* This program was requested by Patrick Earl=3B hopefully someone else > will write the equivalent Direct3D immediate mode program. */ >#include <GL/glut.h> >GLfloat light_diffuse[] =3D /* Red diffuse light. */ >{ > 1.0=2C 0.0=2C 0.0=2C 1.0 >}=3B >GLfloat light_position[] =3D /* Infinite light location. */ >{ > 1.0=2C 1.0=2C 1.0=2C 0.0 >}=3B >GLfloat n[6][3] =3D /* Normals for the 6 faces of a cube. */ >{ > {-1.0=2C 0.0=2C 0.0}=2C > { 0.0=2C 1.0=2C 0.0 } =2C > { 1.0=2C 0.0=2C 0.0 }=2C > {0.0=2C -1.0=2C 0.0}=2C > { 0.0=2C 0.0=2C 1.0 } =2C > { 0.0=2C 0.0=2C -1.0 } >}=3B >GLint faces[6][4] =3D /* Vertex indices for the 6 faces of a c= >ube. */ >{ > {0=2C 1=2C 2=2C 3}=2C > { 3=2C 2=2C 6=2C 7 } =2C > { 7=2C 6=2C 5=2C 4 }=2C > {4=2C 5=2C 1=2C 0}=2C > { 5=2C 6=2C 2=2C 1 } =2C > { 7=2C 4=2C 0=2C 3 } >}=3B >GLfloat v[8][3]=3B /* Will be filled in with X=2CY=2CZ vert= >exes. */ >void >drawBox(void) >{ > int i=3B > for (i =3D 0=3B i < 6=3B i++) > { > glBegin(GL_QUADS)=3B > glNormal3fv(&n[i][0])=3B > glVertex3fv(&v[faces[i][0]][0])=3B > glVertex3fv(&v[faces[i][1]][0])=3B > glVertex3fv(&v[faces[i][2]][0])=3B > glVertex3fv(&v[faces[i][3]][0])=3B > glEnd()=3B > } >} > >void >display(void) >{ > glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)=3B > drawBox()=3B > glutSwapBuffers()=3B >} > >void >init(void) >{ > /* Setup cube vertex data. */ > v[0][0] =3D v[1][0] =3D v[2][0] =3D v[3][0] =3D -1=3B > v[4][0] =3D v[5][0] =3D v[6][0] =3D v[7][0] =3D 1=3B > v[0][1] =3D v[1][1] =3D v[4][1] =3D v[5][1] =3D -1=3B > v[2][1] =3D v[3][1] =3D v[6][1] =3D v[7][1] =3D 1=3B > v[0][2] =3D v[3][2] =3D v[4][2] =3D v[7][2] =3D 1=3B > v[1][2] =3D v[2][2] =3D v[5][2] =3D v[6][2] =3D -1=3B > /* Enable a single OpenGL light. */ > glLightfv(GL_LIGHT0=2C GL_DIFFUSE=2C light_diffuse)=3B > glLightfv(GL_LIGHT0=2C GL_POSITION=2C light_position)=3B > glEnable(GL_LIGHT0)=3B > glEnable(GL_LIGHTING)=3B > /* Use depth buffering for hidden surface elimination. */ > glEnable(GL_DEPTH_TEST)=3B > /* Setup the view of the cube. */ > glMatrixMode(GL_PROJECTION)=3B > gluPerspective( /* field of view in degree */ 40.0=2C > /* aspect ratio */ 1.0=2C > /* Z near */ 1.0=2C /* Z far */ 10.0)=3B > glMatrixMode(GL_MODELVIEW)=3B > gluLookAt(0.0=2C 0.0=2C 5.0=2C /* eye is at (0=2C0=2C5) */ > 0.0=2C 0.0=2C 0.0=2C /* center is at (0=2C0=2C0) */ > 0.0=2C 1.0=2C 0.)=3B /* up is in positive Y direction */ > /* Adjust cube position to be asthetic angle. */ > glTranslatef(0.0=2C 0.0=2C -1.0)=3B > glRotatef(60=2C 1.0=2C 0.0=2C 0.0)=3B > glRotatef(-20=2C 0.0=2C 0.0=2C 1.0)=3B >} > >int >main(int argc=2C char **argv) >{ > glutInit(&argc=2C argv)=3B > glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)=3B > glut_pane_id=3DglutCreateWindow("red 3D lighted cube")=3B > switch_to_full_screen()=3B > glutMainLoop()=3B > return 0=3B /* ANSI C requires main to return int. *= >/ >} =0A= >_________________________________________________________________=0A= >Hotmail=AE has ever-growing storage! Don=92t worry about storage limits.=0A= >http://windowslive.com/Tutorial/Hotmail/Storage?ocid=3DTXT_TAGLM_WL_HM_Tuto= >rial_Storage_062009= > >------------------------------------------------------------------------------ >Come build with us! The BlackBerry® Developer Conference in SF, CA >is the only developer event you need to attend this year. Jumpstart your >developing skills, take BlackBerry mobile applications to market and stay >ahead of the curve. Join us from November 9-12, 2009. Register now! >http://p.sf.net/sfu/devconf >_______________________________________________ >Freeglut-developer mailing list >Freeglut-developer@... >https://lists.sourceforge.net/lists/listinfo/freeglut-developer ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XP> It would appear that in order for "WM_MOUSELEAVE" to show up, we need
> to call "TrackMouseEvent" when the mouse enters a window. Is there a > need for this functionality? If not, we can simply take out the > "WM_MOUSELEAVE" or "0x02A3" block. > Preferences? I would suggest to add the TrackMouseEvent call, if only for completeness' sake. Otherwise, glutEntryFunc would be just about useless on Windows.. Thanks, Yours, Florian ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XPSomething else that comes to mind: this is the window ENTRY function
that we are trying to activate. The "mouse leave" event was simply a stopgap to return control to the application somehow. Does anybody have a better idea on how to implement this? Oh, and something that can be implemented rather easily; I'm trying to get a release out. - John At 01:42 PM 11/4/2009, you wrote: > > It would appear that in order for "WM_MOUSELEAVE" to show up, we need > > to call "TrackMouseEvent" when the mouse enters a window. Is there a > > need for this functionality? If not, we can simply take out the > > "WM_MOUSELEAVE" or "0x02A3" block. > > Preferences? >I would suggest to add the TrackMouseEvent call, if only for >completeness' sake. Otherwise, glutEntryFunc would be just about useless >on Windows.. > >Thanks, >Yours, Florian > > >------------------------------------------------------------------------------ >Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >trial. Simplify your report design, integration and deployment - and focus on >what you do best, core application coding. Discover what's new with >Crystal Reports now. http://p.sf.net/sfu/bobj-july >_______________________________________________ >Freeglut-developer mailing list >Freeglut-developer@... >https://lists.sourceforge.net/lists/listinfo/freeglut-developer ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: glutEntryFunc on Windows XPCancel last transmission.
The "glutEntryFunc" should now be working in the SVN version of "freeglut" as it does in GLUT for Windows. I also moved the menu highlight code into a new "case" block so that will need some testing. I have not tested it. - John At 06:19 AM 11/5/2009, you wrote: >Something else that comes to mind: this is the window ENTRY function >that we are trying to activate. The "mouse leave" event was simply a >stopgap to return control to the application somehow. > >Does anybody have a better idea on how to implement this? Oh, and >something that can be implemented rather easily; I'm trying to get a >release out. > > - John > > >At 01:42 PM 11/4/2009, you wrote: > > > It would appear that in order for "WM_MOUSELEAVE" to show up, we need > > > to call "TrackMouseEvent" when the mouse enters a window. Is there a > > > need for this functionality? If not, we can simply take out the > > > "WM_MOUSELEAVE" or "0x02A3" block. > > > Preferences? > >I would suggest to add the TrackMouseEvent call, if only for > >completeness' sake. Otherwise, glutEntryFunc would be just about useless > >on Windows.. > > > >Thanks, > >Yours, Florian > > > > > >------------------------------------------------------------------- > ----------- > >Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > >trial. Simplify your report design, integration and deployment - > and focus on > >what you do best, core application coding. Discover what's new with > >Crystal Reports now. http://p.sf.net/sfu/bobj-july > >_______________________________________________ > >Freeglut-developer mailing list > >Freeglut-developer@... > >https://lists.sourceforge.net/lists/listinfo/freeglut-developer > > >------------------------------------------------------------------------------ >Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >trial. Simplify your report design, integration and deployment - and focus on >what you do best, core application coding. Discover what's new with >Crystal Reports now. http://p.sf.net/sfu/bobj-july >_______________________________________________ >Freeglut-developer mailing list >Freeglut-developer@... >https://lists.sourceforge.net/lists/listinfo/freeglut-developer ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: GameMode behaviourI'll get on it tomorrow, with luck.
-------------------------------------------------- From: "John F. Fay" <johnffay@...> Sent: Wednesday, November 04, 2009 4:48 AM To: "FreeGLUT developers list" <freeglut-developer@...> Subject: Re: [Freeglut-developer] GameMode behaviour > Clive, > > Many thanks for your contribution here. Is there anything > that I need to put into "freeglut" to get it to work on Ubuntu before > the next release? > > - John > > > At 11:19 AM 9/28/2009, you wrote: >>John=2C >>Sorry to hear about the losses in you immediate family... >>=20 >>I received good advice from someone [Member #20245] on the OpenGL forum=2C >>= >>who made small modifications to my code and got GameMode to run >>satisfactor= >>ily on Ubuntu. I have appended the modified code to the end of this email= >>=2C so that others can see what probably works. I have not yet tested this >>= >>myself. >>=20 >>It seems my system calls to "wmctrl" to remove the Ubuntu toolbars may >>have= >> upset things. I have also figured out that the network applet on the >> Ubunt= >>u toolbar=2C which has been a problem=2C can be hidden/disabled so that it >>= >>doesn't 'blink-through' the OpenGL renderings when using conventional >>glutF= >>ullScreen(). I now have a couple of solutions for truly full screen >>freeglu= >>t use=2C including the use of GameMode. >>=20 >>Now that I have confirmation that it works on Ubuntu I shall test it on >>the= >> feeble 945GM Intel hardware with both XP and Ubuntu. Intel's Ubuntu >> OpenGL= >> drivers for the 945GM are inferior to their XP drivers -- the former is >> on= >>ly OpenGL 1.3 -- so I may have an issue with the driver. >>=20 >>Clive. >>---------------------------------------- >> > Date: Sun=2C 27 Sep 2009 21:19:34 -0500 >> > To: freeglut-developer@... >> > From: johnffay@... >> > Subject: Re: [Freeglut-developer] GameMode behaviour >> > >> > Clive=2C >> > >> > Thanks for your input. Unfortunately there isn't a lot more >> > documentation beyond what you have found already. >> > >> > One thing that I seriously recommend is getting an >> > up-to-date copy of the source. We've been trying to get out a new >> > release for over a year now=2C but the main project admin is working >> > 16-hour days on his day job and I've been dealing with three deaths >> > in my immediate family plus some other stuff that is going on. But >> > we *are* working on it. When I can come up for air I will look at >> > your e-mail in more detail. >> > >> > - John >> > >> > >> > At 10:20 AM 9/6/2009=2C you wrote: >> > >> >>There is not a great deal of solid documentation to be found about >> >>Glut's >> >>GameMode. I found the following on the web but I wonder if it is a >> >>reliab= >>le >> >>explanation of how GameMode _should_ function? Most examples merely >> >>show = >>the >> >>application entering GameMode and never returning. I have an >> >>application >> >>that needs to go full-screen and also return to decorated window mode. >> >>I'= >>m >> >>working with freeglut 2.4.0 on both Win XP and Linux Ubuntu and with a >> >>variety of graphics hardware Nvidia 8800 to Intel 945GM. I get erratic >> >>behaviour -- sometimes the return from GameMode has the video driver >> >>very >> >>confused and a system has to be restarted -- on another platform the >> >>retu= >>rn >> >>takes several seconds. >> > >> > >>_______________________________________________ >> >>I tried your code with a few little changes and it worked fine for me. The >>= >>changes that I made were to remove the system calls and to call init() >>alon= >>g with the glut_OpenGL_call_backs() each time. I changed the code so it >>tog= >>gles between fullscreen and windowed mode with any key press (except esc >>wh= >>ich exits the program). Note I ran the following code on Ubuntu 9.04+GNOME >>= >>window manager with freeglut. I would be curious if you can compile and >>run= >> it without problems. >> >>Code:// >>http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=3Dshowfl= >>at&Number=3D263588#Post263588 >>#include <cstdio> >>#include <cstdlib> >>#include <GL/glut.h> >>void display(void)=3B >>void init(void)=3B >>void set_debug_window_size(void)=3B >>void switch_to_full_screen(void)=3B >>#define TRUE true >>#define FALSE false >>bool full_screen =3D FALSE=3B >>int glut_pane_id =3D 0=3B >>void SampleGameModeKeyboard( unsigned char cChar=2C int nMouseX=2C int >>nMou= >>seY ) >>{ >> static int toggleMode=3Dtrue=3B >> if( cChar =3D=3D 27 ) exit(0)=3B >> if (toggleMode) >> { >> set_debug_window_size()=3B >> toggleMode=3D!toggleMode=3B >> } >> else >> { >> switch_to_full_screen()=3B >> toggleMode=3D!toggleMode=3B >> } >>} >> >>void glut_OpenGL_call_backs() >>{ >> init()=3B >> glutKeyboardFunc( SampleGameModeKeyboard )=3B >> glutDisplayFunc(display)=3B >>}=3B >>void switch_to_full_screen(void) >>{ >> char mode_string[24]=3B >> full_screen =3D TRUE=3B >> sprintf(mode_string=2C "%dx%d:32@60"=2C glutGet(GLUT_SCREEN_WIDTH)=2C >> glutGet(GLUT_SCREEN_HEIGHT))=3B >> glutGameModeString(mode_string)=3B >> if(glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) >> { >> printf("GameMode %s is possible\n"=2C mode_string)=3B >> // destroys the current graphics window >> glutDestroyWindow(glut_pane_id)=3B >> glutEnterGameMode()=3B >> glut_OpenGL_call_backs()=3B >> // hide the cursor >> glutSetCursor(GLUT_CURSOR_NONE)=3B >> } >> else >> { >> printf("GameMode %s NOT possible\n"=2C mode_string)=3B >> glutFullScreen()=3B >> } >> #ifdef UBUNTU_PORT >> //system("wmctrl -r\"FourteenthStreetStudio\" -b >> add=2Cfullscreen=2Cskip_= >>taskbar")=3B >> #endif >> if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) >> { >> printf("GameMode is now active...\n")=3B >> } >> else >> { >> //printf("GameMode is NOT active\n")=3B >> } >>} >> >>/*-------------------------------------------------------------------------= >>- >>set the window's width and position for debugging >>Window managers (including gnome) >>adhere to a standard interface=2C the EWMH/NetWM specification. >>This allows programs that remote-control their functionality. >>And fortunately=2C someone already has written one called "wmctrl". >>--------------------------------------------------------------------------*= >>/ >>#ifdef __FREEGLUT__ >>#define WINDOW_X_ORIGIN 0 >>#define WINDOW_Y_ORIGIN 0 >>#else >>#define WINDOW_X_ORIGIN 4 >>#define WINDOW_Y_ORIGIN 24 >>#endif >>void set_debug_window_size(void) >>{ >> int screen_width=2C screen_length=3B >> full_screen =3D FALSE=3B >> if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) >> { >> printf("returning from GameMode\n")=3B >> glutLeaveGameMode()=3B >> glut_pane_id =3D glutCreateWindow("FourteenthStreetStudio")=3B >> glut_OpenGL_call_backs()=3B >> } >> #ifdef UBUNTU_PORT >> //system("wmctrl -r\"FourteenthStreetStudio\" -b >> remove=2Cfullscreen=2Csk= >>ip_taskbar")=3B >> #endif >> /*screen_width =3D glutGet(GLUT_SCREEN_WIDTH)=3B >> screen_length =3D glutGet(GLUT_SCREEN_HEIGHT)=3B >> switch(screen_width) >> { >> case 3840: // dual screen WUXGA >> glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C >> WINDOW_Y_ORIGIN)=3B >> glutReshapeWindow(1824=2C 1140)=3B // 16:10 >> break=3B >> case 3200: // dual screen UXGA >> glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C >> WINDOW_Y_ORIGIN)=3B >> glutReshapeWindow (1584=2C 990)=3B // 16:10 >> break=3B >> //etc >> } >> */ >>} >> >>// following modified from >>http://www.opengl.org/resources/code/samples/glu= >>t_examples/examples/cube.c >>/* Copyright (c) Mark J. Kilgard=2C 1997. */ >>/* This program is freely distributable without licensing fees >> and is provided without guarantee or warrantee expressed or >> implied. This program is -not- in the public domain. */ >>/* This program was requested by Patrick Earl=3B hopefully someone else >> will write the equivalent Direct3D immediate mode program. */ >>#include <GL/glut.h> >>GLfloat light_diffuse[] =3D /* Red diffuse light. */ >>{ >> 1.0=2C 0.0=2C 0.0=2C 1.0 >>}=3B >>GLfloat light_position[] =3D /* Infinite light location. */ >>{ >> 1.0=2C 1.0=2C 1.0=2C 0.0 >>}=3B >>GLfloat n[6][3] =3D /* Normals for the 6 faces of a cube. >>*/ >>{ >> {-1.0=2C 0.0=2C 0.0}=2C >> { 0.0=2C 1.0=2C 0.0 } =2C >> { 1.0=2C 0.0=2C 0.0 }=2C >> {0.0=2C -1.0=2C 0.0}=2C >> { 0.0=2C 0.0=2C 1.0 } =2C >> { 0.0=2C 0.0=2C -1.0 } >>}=3B >>GLint faces[6][4] =3D /* Vertex indices for the 6 faces of a >>c= >>ube. */ >>{ >> {0=2C 1=2C 2=2C 3}=2C >> { 3=2C 2=2C 6=2C 7 } =2C >> { 7=2C 6=2C 5=2C 4 }=2C >> {4=2C 5=2C 1=2C 0}=2C >> { 5=2C 6=2C 2=2C 1 } =2C >> { 7=2C 4=2C 0=2C 3 } >>}=3B >>GLfloat v[8][3]=3B /* Will be filled in with X=2CY=2CZ >>vert= >>exes. */ >>void >>drawBox(void) >>{ >> int i=3B >> for (i =3D 0=3B i < 6=3B i++) >> { >> glBegin(GL_QUADS)=3B >> glNormal3fv(&n[i][0])=3B >> glVertex3fv(&v[faces[i][0]][0])=3B >> glVertex3fv(&v[faces[i][1]][0])=3B >> glVertex3fv(&v[faces[i][2]][0])=3B >> glVertex3fv(&v[faces[i][3]][0])=3B >> glEnd()=3B >> } >>} >> >>void >>display(void) >>{ >> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)=3B >> drawBox()=3B >> glutSwapBuffers()=3B >>} >> >>void >>init(void) >>{ >> /* Setup cube vertex data. */ >> v[0][0] =3D v[1][0] =3D v[2][0] =3D v[3][0] =3D -1=3B >> v[4][0] =3D v[5][0] =3D v[6][0] =3D v[7][0] =3D 1=3B >> v[0][1] =3D v[1][1] =3D v[4][1] =3D v[5][1] =3D -1=3B >> v[2][1] =3D v[3][1] =3D v[6][1] =3D v[7][1] =3D 1=3B >> v[0][2] =3D v[3][2] =3D v[4][2] =3D v[7][2] =3D 1=3B >> v[1][2] =3D v[2][2] =3D v[5][2] =3D v[6][2] =3D -1=3B >> /* Enable a single OpenGL light. */ >> glLightfv(GL_LIGHT0=2C GL_DIFFUSE=2C light_diffuse)=3B >> glLightfv(GL_LIGHT0=2C GL_POSITION=2C light_position)=3B >> glEnable(GL_LIGHT0)=3B >> glEnable(GL_LIGHTING)=3B >> /* Use depth buffering for hidden surface elimination. */ >> glEnable(GL_DEPTH_TEST)=3B >> /* Setup the view of the cube. */ >> glMatrixMode(GL_PROJECTION)=3B >> gluPerspective( /* field of view in degree */ 40.0=2C >> /* aspect ratio */ 1.0=2C >> /* Z near */ 1.0=2C /* Z far */ 10.0)=3B >> glMatrixMode(GL_MODELVIEW)=3B >> gluLookAt(0.0=2C 0.0=2C 5.0=2C /* eye is at (0=2C0=2C5) */ >> 0.0=2C 0.0=2C 0.0=2C /* center is at (0=2C0=2C0) */ >> 0.0=2C 1.0=2C 0.)=3B /* up is in positive Y direction >> */ >> /* Adjust cube position to be asthetic angle. */ >> glTranslatef(0.0=2C 0.0=2C -1.0)=3B >> glRotatef(60=2C 1.0=2C 0.0=2C 0.0)=3B >> glRotatef(-20=2C 0.0=2C 0.0=2C 1.0)=3B >>} >> >>int >>main(int argc=2C char **argv) >>{ >> glutInit(&argc=2C argv)=3B >> glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)=3B >> glut_pane_id=3DglutCreateWindow("red 3D lighted cube")=3B >> switch_to_full_screen()=3B >> glutMainLoop()=3B >> return 0=3B /* ANSI C requires main to return int. >> *= >>/ >>} =0A= >>_________________________________________________________________=0A= >>Hotmail=AE has ever-growing storage! Don=92t worry about storage >>limits.=0A= >>http://windowslive.com/Tutorial/Hotmail/Storage?ocid=3DTXT_TAGLM_WL_HM_Tuto= >>rial_Storage_062009= >> >>------------------------------------------------------------------------------ >>Come build with us! The BlackBerry® Developer Conference in SF, CA >>is the only developer event you need to attend this year. Jumpstart your >>developing skills, take BlackBerry mobile applications to market and stay >>ahead of the curve. Join us from November 9-12, 2009. Register >>now! >>http://p.sf.net/sfu/devconf >>_______________________________________________ >>Freeglut-developer mailing list >>Freeglut-developer@... >>https://lists.sourceforge.net/lists/listinfo/freeglut-developer > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Freeglut-developer mailing list > Freeglut-developer@... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: GameMode behaviourJohn,
I have conducted a test which reports the following from freeglut 2.4.0 on Ubuntu Linux with feeble Intel 945GM graphics: GameMode 1920x1200:32@60 is possible GameMode is now active... returning from GameMode freeglut (./art_show): ERROR Function <glutReshapeWindow> called with no current window defined. The first three lines are from my code (art_show). The ERROR is emitted from freeglut. According to the documentation I have read, the windows that exist prior to entering GameMode are supposed to be restored almost as if nothing had happened. My standard set of call backs are reestablished immediately after calling glutLeaveGameMode() so it isn't that. I guess the thing to check is that when glutEnterGameMode() is called the first thing it should do is save the status of ALL the open windows and that when glutLeaveGameMode() is called they are restored. I'm about to try the same code on XP. Clive. -------------------------------------------------- From: "John F. Fay" <johnffay@...> Sent: Wednesday, November 04, 2009 4:48 AM To: "FreeGLUT developers list" <freeglut-developer@...> Subject: Re: [Freeglut-developer] GameMode behaviour > Clive, > > Many thanks for your contribution here. Is there anything > that I need to put into "freeglut" to get it to work on Ubuntu before > the next release? > > - John > > > At 11:19 AM 9/28/2009, you wrote: >>John=2C >>Sorry to hear about the losses in you immediate family... >>=20 >>I received good advice from someone [Member #20245] on the OpenGL forum=2C >>= >>who made small modifications to my code and got GameMode to run >>satisfactor= >>ily on Ubuntu. I have appended the modified code to the end of this email= >>=2C so that others can see what probably works. I have not yet tested this >>= >>myself. >>=20 >>It seems my system calls to "wmctrl" to remove the Ubuntu toolbars may >>have= >> upset things. I have also figured out that the network applet on the >> Ubunt= >>u toolbar=2C which has been a problem=2C can be hidden/disabled so that it >>= >>doesn't 'blink-through' the OpenGL renderings when using conventional >>glutF= >>ullScreen(). I now have a couple of solutions for truly full screen >>freeglu= >>t use=2C including the use of GameMode. >>=20 >>Now that I have confirmation that it works on Ubuntu I shall test it on >>the= >> feeble 945GM Intel hardware with both XP and Ubuntu. Intel's Ubuntu >> OpenGL= >> drivers for the 945GM are inferior to their XP drivers -- the former is >> on= >>ly OpenGL 1.3 -- so I may have an issue with the driver. >>=20 >>Clive. >>---------------------------------------- >> > Date: Sun=2C 27 Sep 2009 21:19:34 -0500 >> > To: freeglut-developer@... >> > From: johnffay@... >> > Subject: Re: [Freeglut-developer] GameMode behaviour >> > >> > Clive=2C >> > >> > Thanks for your input. Unfortunately there isn't a lot more >> > documentation beyond what you have found already. >> > >> > One thing that I seriously recommend is getting an >> > up-to-date copy of the source. We've been trying to get out a new >> > release for over a year now=2C but the main project admin is working >> > 16-hour days on his day job and I've been dealing with three deaths >> > in my immediate family plus some other stuff that is going on. But >> > we *are* working on it. When I can come up for air I will look at >> > your e-mail in more detail. >> > >> > - John >> > >> > >> > At 10:20 AM 9/6/2009=2C you wrote: >> > >> >>There is not a great deal of solid documentation to be found about >> >>Glut's >> >>GameMode. I found the following on the web but I wonder if it is a >> >>reliab= >>le >> >>explanation of how GameMode _should_ function? Most examples merely >> >>show = >>the >> >>application entering GameMode and never returning. I have an >> >>application >> >>that needs to go full-screen and also return to decorated window mode. >> >>I'= >>m >> >>working with freeglut 2.4.0 on both Win XP and Linux Ubuntu and with a >> >>variety of graphics hardware Nvidia 8800 to Intel 945GM. I get erratic >> >>behaviour -- sometimes the return from GameMode has the video driver >> >>very >> >>confused and a system has to be restarted -- on another platform the >> >>retu= >>rn >> >>takes several seconds. >> > >> > >>_______________________________________________ >> >>I tried your code with a few little changes and it worked fine for me. The >>= >>changes that I made were to remove the system calls and to call init() >>alon= >>g with the glut_OpenGL_call_backs() each time. I changed the code so it >>tog= >>gles between fullscreen and windowed mode with any key press (except esc >>wh= >>ich exits the program). Note I ran the following code on Ubuntu 9.04+GNOME >>= >>window manager with freeglut. I would be curious if you can compile and >>run= >> it without problems. >> >>Code:// >>http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=3Dshowfl= >>at&Number=3D263588#Post263588 >>#include <cstdio> >>#include <cstdlib> >>#include <GL/glut.h> >>void display(void)=3B >>void init(void)=3B >>void set_debug_window_size(void)=3B >>void switch_to_full_screen(void)=3B >>#define TRUE true >>#define FALSE false >>bool full_screen =3D FALSE=3B >>int glut_pane_id =3D 0=3B >>void SampleGameModeKeyboard( unsigned char cChar=2C int nMouseX=2C int >>nMou= >>seY ) >>{ >> static int toggleMode=3Dtrue=3B >> if( cChar =3D=3D 27 ) exit(0)=3B >> if (toggleMode) >> { >> set_debug_window_size()=3B >> toggleMode=3D!toggleMode=3B >> } >> else >> { >> switch_to_full_screen()=3B >> toggleMode=3D!toggleMode=3B >> } >>} >> >>void glut_OpenGL_call_backs() >>{ >> init()=3B >> glutKeyboardFunc( SampleGameModeKeyboard )=3B >> glutDisplayFunc(display)=3B >>}=3B >>void switch_to_full_screen(void) >>{ >> char mode_string[24]=3B >> full_screen =3D TRUE=3B >> sprintf(mode_string=2C "%dx%d:32@60"=2C glutGet(GLUT_SCREEN_WIDTH)=2C >> glutGet(GLUT_SCREEN_HEIGHT))=3B >> glutGameModeString(mode_string)=3B >> if(glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) >> { >> printf("GameMode %s is possible\n"=2C mode_string)=3B >> // destroys the current graphics window >> glutDestroyWindow(glut_pane_id)=3B >> glutEnterGameMode()=3B >> glut_OpenGL_call_backs()=3B >> // hide the cursor >> glutSetCursor(GLUT_CURSOR_NONE)=3B >> } >> else >> { >> printf("GameMode %s NOT possible\n"=2C mode_string)=3B >> glutFullScreen()=3B >> } >> #ifdef UBUNTU_PORT >> //system("wmctrl -r\"FourteenthStreetStudio\" -b >> add=2Cfullscreen=2Cskip_= >>taskbar")=3B >> #endif >> if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) >> { >> printf("GameMode is now active...\n")=3B >> } >> else >> { >> //printf("GameMode is NOT active\n")=3B >> } >>} >> >>/*-------------------------------------------------------------------------= >>- >>set the window's width and position for debugging >>Window managers (including gnome) >>adhere to a standard interface=2C the EWMH/NetWM specification. >>This allows programs that remote-control their functionality. >>And fortunately=2C someone already has written one called "wmctrl". >>--------------------------------------------------------------------------*= >>/ >>#ifdef __FREEGLUT__ >>#define WINDOW_X_ORIGIN 0 >>#define WINDOW_Y_ORIGIN 0 >>#else >>#define WINDOW_X_ORIGIN 4 >>#define WINDOW_Y_ORIGIN 24 >>#endif >>void set_debug_window_size(void) >>{ >> int screen_width=2C screen_length=3B >> full_screen =3D FALSE=3B >> if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) >> { >> printf("returning from GameMode\n")=3B >> glutLeaveGameMode()=3B >> glut_pane_id =3D glutCreateWindow("FourteenthStreetStudio")=3B >> glut_OpenGL_call_backs()=3B >> } >> #ifdef UBUNTU_PORT >> //system("wmctrl -r\"FourteenthStreetStudio\" -b >> remove=2Cfullscreen=2Csk= >>ip_taskbar")=3B >> #endif >> /*screen_width =3D glutGet(GLUT_SCREEN_WIDTH)=3B >> screen_length =3D glutGet(GLUT_SCREEN_HEIGHT)=3B >> switch(screen_width) >> { >> case 3840: // dual screen WUXGA >> glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C >> WINDOW_Y_ORIGIN)=3B >> glutReshapeWindow(1824=2C 1140)=3B // 16:10 >> break=3B >> case 3200: // dual screen UXGA >> glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C >> WINDOW_Y_ORIGIN)=3B >> glutReshapeWindow (1584=2C 990)=3B // 16:10 >> break=3B >> //etc >> } >> */ >>} >> >>// following modified from >>http://www.opengl.org/resources/code/samples/glu= >>t_examples/examples/cube.c >>/* Copyright (c) Mark J. Kilgard=2C 1997. */ >>/* This program is freely distributable without licensing fees >> and is provided without guarantee or warrantee expressed or >> implied. This program is -not- in the public domain. */ >>/* This program was requested by Patrick Earl=3B hopefully someone else >> will write the equivalent Direct3D immediate mode program. */ >>#include <GL/glut.h> >>GLfloat light_diffuse[] =3D /* Red diffuse light. */ >>{ >> 1.0=2C 0.0=2C 0.0=2C 1.0 >>}=3B >>GLfloat light_position[] =3D /* Infinite light location. */ >>{ >> 1.0=2C 1.0=2C 1.0=2C 0.0 >>}=3B >>GLfloat n[6][3] =3D /* Normals for the 6 faces of a cube. >>*/ >>{ >> {-1.0=2C 0.0=2C 0.0}=2C >> { 0.0=2C 1.0=2C 0.0 } =2C >> { 1.0=2C 0.0=2C 0.0 }=2C >> {0.0=2C -1.0=2C 0.0}=2C >> { 0.0=2C 0.0=2C 1.0 } =2C >> { 0.0=2C 0.0=2C -1.0 } >>}=3B >>GLint faces[6][4] =3D /* Vertex indices for the 6 faces of a >>c= >>ube. */ >>{ >> {0=2C 1=2C 2=2C 3}=2C >> { 3=2C 2=2C 6=2C 7 } =2C >> { 7=2C 6=2C 5=2C 4 }=2C >> {4=2C 5=2C 1=2C 0}=2C >> { 5=2C 6=2C 2=2C 1 } =2C >> { 7=2C 4=2C 0=2C 3 } >>}=3B >>GLfloat v[8][3]=3B /* Will be filled in with X=2CY=2CZ >>vert= >>exes. */ >>void >>drawBox(void) >>{ >> int i=3B >> for (i =3D 0=3B i < 6=3B i++) >> { >> glBegin(GL_QUADS)=3B >> glNormal3fv(&n[i][0])=3B >> glVertex3fv(&v[faces[i][0]][0])=3B >> glVertex3fv(&v[faces[i][1]][0])=3B >> glVertex3fv(&v[faces[i][2]][0])=3B >> glVertex3fv(&v[faces[i][3]][0])=3B >> glEnd()=3B >> } >>} >> >>void >>display(void) >>{ >> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)=3B >> drawBox()=3B >> glutSwapBuffers()=3B >>} >> >>void >>init(void) >>{ >> /* Setup cube vertex data. */ >> v[0][0] =3D v[1][0] =3D v[2][0] =3D v[3][0] =3D -1=3B >> v[4][0] =3D v[5][0] =3D v[6][0] =3D v[7][0] =3D 1=3B >> v[0][1] =3D v[1][1] =3D v[4][1] =3D v[5][1] =3D -1=3B >> v[2][1] =3D v[3][1] =3D v[6][1] =3D v[7][1] =3D 1=3B >> v[0][2] =3D v[3][2] =3D v[4][2] =3D v[7][2] =3D 1=3B >> v[1][2] =3D v[2][2] =3D v[5][2] =3D v[6][2] =3D -1=3B >> /* Enable a single OpenGL light. */ >> glLightfv(GL_LIGHT0=2C GL_DIFFUSE=2C light_diffuse)=3B >> glLightfv(GL_LIGHT0=2C GL_POSITION=2C light_position)=3B >> glEnable(GL_LIGHT0)=3B >> glEnable(GL_LIGHTING)=3B >> /* Use depth buffering for hidden surface elimination. */ >> glEnable(GL_DEPTH_TEST)=3B >> /* Setup the view of the cube. */ >> glMatrixMode(GL_PROJECTION)=3B >> gluPerspective( /* field of view in degree */ 40.0=2C >> /* aspect ratio */ 1.0=2C >> /* Z near */ 1.0=2C /* Z far */ 10.0)=3B >> glMatrixMode(GL_MODELVIEW)=3B >> gluLookAt(0.0=2C 0.0=2C 5.0=2C /* eye is at (0=2C0=2C5) */ >> 0.0=2C 0.0=2C 0.0=2C /* center is at (0=2C0=2C0) */ >> 0.0=2C 1.0=2C 0.)=3B /* up is in positive Y direction >> */ >> /* Adjust cube position to be asthetic angle. */ >> glTranslatef(0.0=2C 0.0=2C -1.0)=3B >> glRotatef(60=2C 1.0=2C 0.0=2C 0.0)=3B >> glRotatef(-20=2C 0.0=2C 0.0=2C 1.0)=3B >>} >> >>int >>main(int argc=2C char **argv) >>{ >> glutInit(&argc=2C argv)=3B >> glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)=3B >> glut_pane_id=3DglutCreateWindow("red 3D lighted cube")=3B >> switch_to_full_screen()=3B >> glutMainLoop()=3B >> return 0=3B /* ANSI C requires main to return int. >> *= >>/ >>} =0A= >>_________________________________________________________________=0A= >>Hotmail=AE has ever-growing storage! Don=92t worry about storage >>limits.=0A= >>http://windowslive.com/Tutorial/Hotmail/Storage?ocid=3DTXT_TAGLM_WL_HM_Tuto= >>rial_Storage_062009= >> >>------------------------------------------------------------------------------ >>Come build with us! The BlackBerry® Developer Conference in SF, CA >>is the only developer event you need to attend this year. Jumpstart your >>developing skills, take BlackBerry mobile applications to market and stay >>ahead of the curve. Join us from November 9-12, 2009. Register >>now! >>http://p.sf.net/sfu/devconf >>_______________________________________________ >>Freeglut-developer mailing list >>Freeglut-developer@... >>https://lists.sourceforge.net/lists/listinfo/freeglut-developer > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Freeglut-developer mailing list > Freeglut-developer@... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: GameMode behaviourClive,
Let me give you a couple more things to check. (1) The SVN head version is much changed from 2.4.0. Please make sure that the latest SVN version gives the same error. (2) There is a "CurrentWindow" variable that indicated which window is active. This is separate from the status of any individual window. The error is apparently triggered because the " CurrentWindow" variable is not set when "freeglut" leaves game mode. (See freeglut_window.c near line 1368 and freeglut_internal.h near line 785.) Thanks for chasing this down. John F. Fay Technical Fellow Jacobs Technology TEAS Group 850-883-1294 -----Original Message----- From: Clive McCarthy [mailto:CliveMcCarthy@...] Sent: Friday, November 06, 2009 4:53 PM To: FreeGLUT developers list Subject: Re: [Freeglut-developer] GameMode behaviour John, I have conducted a test which reports the following from freeglut 2.4.0 on Ubuntu Linux with feeble Intel 945GM graphics: GameMode 1920x1200:32@60 is possible GameMode is now active... returning from GameMode freeglut (./art_show): ERROR Function <glutReshapeWindow> called with no current window defined. The first three lines are from my code (art_show). The ERROR is emitted from freeglut. According to the documentation I have read, the windows that exist prior to entering GameMode are supposed to be restored almost as if nothing had happened. My standard set of call backs are reestablished immediately after calling glutLeaveGameMode() so it isn't that. I guess the thing to check is that when glutEnterGameMode() is called the first thing it should do is save the status of ALL the open windows and that when glutLeaveGameMode() is called they are restored. I'm about to try the same code on XP. Clive. -------------------------------------------------- From: "John F. Fay" <johnffay@...> Sent: Wednesday, November 04, 2009 4:48 AM To: "FreeGLUT developers list" <freeglut-developer@...> Subject: Re: [Freeglut-developer] GameMode behaviour > Clive, > > Many thanks for your contribution here. Is there anything > that I need to put into "freeglut" to get it to work on Ubuntu before > the next release? > > - John > > > At 11:19 AM 9/28/2009, you wrote: >>John=2C >>Sorry to hear about the losses in you immediate family... >>=20 >>I received good advice from someone [Member #20245] on the OpenGL >>= >>who made small modifications to my code and got GameMode to run >>satisfactor= >>ily on Ubuntu. I have appended the modified code to the end of this email= >>=2C so that others can see what probably works. I have not yet tested this >>= >>myself. >>=20 >>It seems my system calls to "wmctrl" to remove the Ubuntu toolbars may >>have= >> upset things. I have also figured out that the network applet on the >> Ubunt= >>u toolbar=2C which has been a problem=2C can be hidden/disabled so that it >>= >>doesn't 'blink-through' the OpenGL renderings when using conventional >>glutF= >>ullScreen(). I now have a couple of solutions for truly full screen >>freeglu= >>t use=2C including the use of GameMode. >>=20 >>Now that I have confirmation that it works on Ubuntu I shall test it on >>the= >> feeble 945GM Intel hardware with both XP and Ubuntu. Intel's Ubuntu >> OpenGL= >> drivers for the 945GM are inferior to their XP drivers -- the former is >> on= >>ly OpenGL 1.3 -- so I may have an issue with the driver. >>=20 >>Clive. >>---------------------------------------- >> > Date: Sun=2C 27 Sep 2009 21:19:34 -0500 >> > To: freeglut-developer@... >> > From: johnffay@... >> > Subject: Re: [Freeglut-developer] GameMode behaviour >> > >> > Clive=2C >> > >> > Thanks for your input. Unfortunately there isn't a lot more >> > documentation beyond what you have found already. >> > >> > One thing that I seriously recommend is getting an >> > up-to-date copy of the source. We've been trying to get out a new >> > release for over a year now=2C but the main project admin is >> > 16-hour days on his day job and I've been dealing with three deaths >> > in my immediate family plus some other stuff that is going on. But >> > we *are* working on it. When I can come up for air I will look at >> > your e-mail in more detail. >> > >> > - John >> > >> > >> > At 10:20 AM 9/6/2009=2C you wrote: >> > >> >>There is not a great deal of solid documentation to be found about >> >>Glut's >> >>GameMode. I found the following on the web but I wonder if it is a >> >>reliab= >>le >> >>explanation of how GameMode _should_ function? Most examples merely >> >>show = >>the >> >>application entering GameMode and never returning. I have an >> >>application >> >>that needs to go full-screen and also return to decorated window mode. >> >>I'= >>m >> >>working with freeglut 2.4.0 on both Win XP and Linux Ubuntu and with a >> >>variety of graphics hardware Nvidia 8800 to Intel 945GM. I get erratic >> >>behaviour -- sometimes the return from GameMode has the video driver >> >>very >> >>confused and a system has to be restarted -- on another platform the >> >>retu= >>rn >> >>takes several seconds. >> > >> > >>_______________________________________________ >> >>I tried your code with a few little changes and it worked fine for me. The >>= >>changes that I made were to remove the system calls and to call init() >>alon= >>g with the glut_OpenGL_call_backs() each time. I changed the code so it >>tog= >>gles between fullscreen and windowed mode with any key press (except esc >>wh= >>ich exits the program). Note I ran the following code on Ubuntu 9.04+GNOME >>= >>window manager with freeglut. I would be curious if you can compile and >>run= >> it without problems. >> >>Code:// >>http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=3Dshowfl= >>at&Number=3D263588#Post263588 >>#include <cstdio> >>#include <cstdlib> >>#include <GL/glut.h> >>void display(void)=3B >>void init(void)=3B >>void set_debug_window_size(void)=3B >>void switch_to_full_screen(void)=3B >>#define TRUE true >>#define FALSE false >>bool full_screen =3D FALSE=3B >>int glut_pane_id =3D 0=3B >>void SampleGameModeKeyboard( unsigned char cChar=2C int nMouseX=2C int >>nMou= >>seY ) >>{ >> static int toggleMode=3Dtrue=3B >> if( cChar =3D=3D 27 ) exit(0)=3B >> if (toggleMode) >> { >> set_debug_window_size()=3B >> toggleMode=3D!toggleMode=3B >> } >> else >> { >> switch_to_full_screen()=3B >> toggleMode=3D!toggleMode=3B >> } >>} >> >>void glut_OpenGL_call_backs() >>{ >> init()=3B >> glutKeyboardFunc( SampleGameModeKeyboard )=3B >> glutDisplayFunc(display)=3B >>}=3B >>void switch_to_full_screen(void) >>{ >> char mode_string[24]=3B >> full_screen =3D TRUE=3B >> sprintf(mode_string=2C "%dx%d:32@60"=2C >> glutGet(GLUT_SCREEN_HEIGHT))=3B >> glutGameModeString(mode_string)=3B >> if(glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) >> { >> printf("GameMode %s is possible\n"=2C mode_string)=3B >> // destroys the current graphics window >> glutDestroyWindow(glut_pane_id)=3B >> glutEnterGameMode()=3B >> glut_OpenGL_call_backs()=3B >> // hide the cursor >> glutSetCursor(GLUT_CURSOR_NONE)=3B >> } >> else >> { >> printf("GameMode %s NOT possible\n"=2C mode_string)=3B >> glutFullScreen()=3B >> } >> #ifdef UBUNTU_PORT >> //system("wmctrl -r\"FourteenthStreetStudio\" -b >> add=2Cfullscreen=2Cskip_= >>taskbar")=3B >> #endif >> if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) >> { >> printf("GameMode is now active...\n")=3B >> } >> else >> { >> //printf("GameMode is NOT active\n")=3B >> } >>} >> >>/*-------------------------------------------------------------------- >>- >>set the window's width and position for debugging >>Window managers (including gnome) >>adhere to a standard interface=2C the EWMH/NetWM specification. >>This allows programs that remote-control their functionality. >>And fortunately=2C someone already has written one called "wmctrl". >>---------------------------------------------------------------------- ----*= >>/ >>#ifdef __FREEGLUT__ >>#define WINDOW_X_ORIGIN 0 >>#define WINDOW_Y_ORIGIN 0 >>#else >>#define WINDOW_X_ORIGIN 4 >>#define WINDOW_Y_ORIGIN 24 >>#endif >>void set_debug_window_size(void) >>{ >> int screen_width=2C screen_length=3B >> full_screen =3D FALSE=3B >> if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) >> { >> printf("returning from GameMode\n")=3B >> glutLeaveGameMode()=3B >> glut_pane_id =3D glutCreateWindow("FourteenthStreetStudio")=3B >> glut_OpenGL_call_backs()=3B >> } >> #ifdef UBUNTU_PORT >> //system("wmctrl -r\"FourteenthStreetStudio\" -b >> remove=2Cfullscreen=2Csk= >>ip_taskbar")=3B >> #endif >> /*screen_width =3D glutGet(GLUT_SCREEN_WIDTH)=3B >> screen_length =3D glutGet(GLUT_SCREEN_HEIGHT)=3B >> switch(screen_width) >> { >> case 3840: // dual screen WUXGA >> glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C >> WINDOW_Y_ORIGIN)=3B >> glutReshapeWindow(1824=2C 1140)=3B // 16:10 >> break=3B >> case 3200: // dual screen UXGA >> glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C >> WINDOW_Y_ORIGIN)=3B >> glutReshapeWindow (1584=2C 990)=3B // 16:10 >> break=3B >> //etc >> } >> */ >>} >> >>// following modified from >>http://www.opengl.org/resources/code/samples/glu= >>t_examples/examples/cube.c >>/* Copyright (c) Mark J. Kilgard=2C 1997. */ >>/* This program is freely distributable without licensing fees >> and is provided without guarantee or warrantee expressed or >> implied. This program is -not- in the public domain. */ >>/* This program was requested by Patrick Earl=3B hopefully someone >> will write the equivalent Direct3D immediate mode program. */ >>#include <GL/glut.h> >>GLfloat light_diffuse[] =3D /* Red diffuse light. */ >>{ >> 1.0=2C 0.0=2C 0.0=2C 1.0 >>}=3B >>GLfloat light_position[] =3D /* Infinite light location. */ >>{ >> 1.0=2C 1.0=2C 1.0=2C 0.0 >>}=3B >>GLfloat n[6][3] =3D /* Normals for the 6 faces of a >>*/ >>{ >> {-1.0=2C 0.0=2C 0.0}=2C >> { 0.0=2C 1.0=2C 0.0 } =2C >> { 1.0=2C 0.0=2C 0.0 }=2C >> {0.0=2C -1.0=2C 0.0}=2C >> { 0.0=2C 0.0=2C 1.0 } =2C >> { 0.0=2C 0.0=2C -1.0 } >>}=3B >>GLint faces[6][4] =3D /* Vertex indices for the 6 faces >>c= >>ube. */ >>{ >> {0=2C 1=2C 2=2C 3}=2C >> { 3=2C 2=2C 6=2C 7 } =2C >> { 7=2C 6=2C 5=2C 4 }=2C >> {4=2C 5=2C 1=2C 0}=2C >> { 5=2C 6=2C 2=2C 1 } =2C >> { 7=2C 4=2C 0=2C 3 } >>}=3B >>GLfloat v[8][3]=3B /* Will be filled in with X=2CY=2CZ >>vert= >>exes. */ >>void >>drawBox(void) >>{ >> int i=3B >> for (i =3D 0=3B i < 6=3B i++) >> { >> glBegin(GL_QUADS)=3B >> glNormal3fv(&n[i][0])=3B >> glVertex3fv(&v[faces[i][0]][0])=3B >> glVertex3fv(&v[faces[i][1]][0])=3B >> glVertex3fv(&v[faces[i][2]][0])=3B >> glVertex3fv(&v[faces[i][3]][0])=3B >> glEnd()=3B >> } >>} >> >>void >>display(void) >>{ >> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)=3B >> drawBox()=3B >> glutSwapBuffers()=3B >>} >> >>void >>init(void) >>{ >> /* Setup cube vertex data. */ >> v[0][0] =3D v[1][0] =3D v[2][0] =3D v[3][0] =3D -1=3B >> v[4][0] =3D v[5][0] =3D v[6][0] =3D v[7][0] =3D 1=3B >> v[0][1] =3D v[1][1] =3D v[4][1] =3D v[5][1] =3D -1=3B >> v[2][1] =3D v[3][1] =3D v[6][1] =3D v[7][1] =3D 1=3B >> v[0][2] =3D v[3][2] =3D v[4][2] =3D v[7][2] =3D 1=3B >> v[1][2] =3D v[2][2] =3D v[5][2] =3D v[6][2] =3D -1=3B >> /* Enable a single OpenGL light. */ >> glLightfv(GL_LIGHT0=2C GL_DIFFUSE=2C light_diffuse)=3B >> glLightfv(GL_LIGHT0=2C GL_POSITION=2C light_position)=3B >> glEnable(GL_LIGHT0)=3B >> glEnable(GL_LIGHTING)=3B >> /* Use depth buffering for hidden surface elimination. */ >> glEnable(GL_DEPTH_TEST)=3B >> /* Setup the view of the cube. */ >> glMatrixMode(GL_PROJECTION)=3B >> gluPerspective( /* field of view in degree */ 40.0=2C >> /* aspect ratio */ 1.0=2C >> /* Z near */ 1.0=2C /* Z far */ 10.0)=3B >> glMatrixMode(GL_MODELVIEW)=3B >> gluLookAt(0.0=2C 0.0=2C 5.0=2C /* eye is at (0=2C0=2C5) */ >> 0.0=2C 0.0=2C 0.0=2C /* center is at (0=2C0=2C0) */ >> 0.0=2C 1.0=2C 0.)=3B /* up is in positive Y >> */ >> /* Adjust cube position to be asthetic angle. */ >> glTranslatef(0.0=2C 0.0=2C -1.0)=3B >> glRotatef(60=2C 1.0=2C 0.0=2C 0.0)=3B >> glRotatef(-20=2C 0.0=2C 0.0=2C 1.0)=3B >>} >> >>int >>main(int argc=2C char **argv) >>{ >> glutInit(&argc=2C argv)=3B >> glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)=3B >> glut_pane_id=3DglutCreateWindow("red 3D lighted cube")=3B >> switch_to_full_screen()=3B >> glutMainLoop()=3B >> return 0=3B /* ANSI C requires main to return >> *= >>/ >>} =0A= >>_________________________________________________________________=0A= >>Hotmail=AE has ever-growing storage! Don=92t worry about storage >>limits.=0A= >>http://windowslive.com/Tutorial/Hotmail/Storage?ocid=3DTXT_TAGLM_WL_HM _Tuto= >>rial_Storage_062009= >> >>---------------------------------------------------------------------- -------- >>Come build with us! The BlackBerry® Developer Conference in SF, CA >>is the only developer event you need to attend this year. Jumpstart your >>developing skills, take BlackBerry mobile applications to market and stay >>ahead of the curve. Join us from November 9-12, 2009. Register >>now! >>http://p.sf.net/sfu/devconf >>_______________________________________________ >>Freeglut-developer mailing list >>Freeglut-developer@... >>https://lists.sourceforge.net/lists/listinfo/freeglut-developer > > > ------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Freeglut-developer mailing list > Freeglut-developer@... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > ------------------------------------------------------------------------ ------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
|
|
Re: GameMode behaviourMy XP version is on an Nvidia 8800 but has exactly the same failure.
-------------------------------------------------- From: "Clive McCarthy" <CliveMcCarthy@...> Sent: Friday, November 06, 2009 2:52 PM To: "FreeGLUT developers list" <freeglut-developer@...> Subject: Re: [Freeglut-developer] GameMode behaviour > John, > I have conducted a test which reports the following from freeglut 2.4.0 on > Ubuntu Linux with feeble Intel 945GM graphics: > > GameMode 1920x1200:32@60 is possible > GameMode is now active... > returning from GameMode > > freeglut (./art_show): ERROR Function <glutReshapeWindow> called with > no > current window defined. > > The first three lines are from my code (art_show). The ERROR is emitted > from > freeglut. > > According to the documentation I have read, the windows that exist prior > to > entering GameMode are supposed to be restored almost as if nothing had > happened. My standard set of call backs are reestablished immediately > after > calling glutLeaveGameMode() so it isn't that. > > I guess the thing to check is that when glutEnterGameMode() is called the > first thing it should do is save the status of ALL the open windows and > that > when glutLeaveGameMode() is called they are restored. > > I'm about to try the same code on XP. > Clive. > > > -------------------------------------------------- > From: "John F. Fay" <johnffay@...> > Sent: Wednesday, November 04, 2009 4:48 AM > To: "FreeGLUT developers list" <freeglut-developer@...> > Subject: Re: [Freeglut-developer] GameMode behaviour > >> Clive, >> >> Many thanks for your contribution here. Is there anything >> that I need to put into "freeglut" to get it to work on Ubuntu before >> the next release? >> >> - John >> >> >> At 11:19 AM 9/28/2009, you wrote: >>>John=2C >>>Sorry to hear about the losses in you immediate family... >>>=20 >>>I received good advice from someone [Member #20245] on the OpenGL >>>forum=2C >>>= >>>who made small modifications to my code and got GameMode to run >>>satisfactor= >>>ily on Ubuntu. I have appended the modified code to the end of this >>>email= >>>=2C so that others can see what probably works. I have not yet tested >>>this >>>= >>>myself. >>>=20 >>>It seems my system calls to "wmctrl" to remove the Ubuntu toolbars may >>>have= >>> upset things. I have also figured out that the network applet on the >>> Ubunt= >>>u toolbar=2C which has been a problem=2C can be hidden/disabled so that >>>it >>>= >>>doesn't 'blink-through' the OpenGL renderings when using conventional >>>glutF= >>>ullScreen(). I now have a couple of solutions for truly full screen >>>freeglu= >>>t use=2C including the use of GameMode. >>>=20 >>>Now that I have confirmation that it works on Ubuntu I shall test it on >>>the= >>> feeble 945GM Intel hardware with both XP and Ubuntu. Intel's Ubuntu >>> OpenGL= >>> drivers for the 945GM are inferior to their XP drivers -- the former is >>> on= >>>ly OpenGL 1.3 -- so I may have an issue with the driver. >>>=20 >>>Clive. >>>---------------------------------------- >>> > Date: Sun=2C 27 Sep 2009 21:19:34 -0500 >>> > To: freeglut-developer@... >>> > From: johnffay@... >>> > Subject: Re: [Freeglut-developer] GameMode behaviour >>> > >>> > Clive=2C >>> > >>> > Thanks for your input. Unfortunately there isn't a lot more >>> > documentation beyond what you have found already. >>> > >>> > One thing that I seriously recommend is getting an >>> > up-to-date copy of the source. We've been trying to get out a new >>> > release for over a year now=2C but the main project admin is working >>> > 16-hour days on his day job and I've been dealing with three deaths >>> > in my immediate family plus some other stuff that is going on. But >>> > we *are* working on it. When I can come up for air I will look at >>> > your e-mail in more detail. >>> > >>> > - John >>> > >>> > >>> > At 10:20 AM 9/6/2009=2C you wrote: >>> > >>> >>There is not a great deal of solid documentation to be found about >>> >>Glut's >>> >>GameMode. I found the following on the web but I wonder if it is a >>> >>reliab= >>>le >>> >>explanation of how GameMode _should_ function? Most examples merely >>> >>show = >>>the >>> >>application entering GameMode and never returning. I have an >>> >>application >>> >>that needs to go full-screen and also return to decorated window mode. >>> >>I'= >>>m >>> >>working with freeglut 2.4.0 on both Win XP and Linux Ubuntu and with a >>> >>variety of graphics hardware Nvidia 8800 to Intel 945GM. I get erratic >>> >>behaviour -- sometimes the return from GameMode has the video driver >>> >>very >>> >>confused and a system has to be restarted -- on another platform the >>> >>retu= >>>rn >>> >>takes several seconds. >>> > >>> > >>>_______________________________________________ >>> >>>I tried your code with a few little changes and it worked fine for me. >>>The >>>= >>>changes that I made were to remove the system calls and to call init() >>>alon= >>>g with the glut_OpenGL_call_backs() each time. I changed the code so it >>>tog= >>>gles between fullscreen and windowed mode with any key press (except esc >>>wh= >>>ich exits the program). Note I ran the following code on Ubuntu >>>9.04+GNOME >>>= >>>window manager with freeglut. I would be curious if you can compile and >>>run= >>> it without problems. >>> >>>Code:// >>>http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=3Dshowfl= >>>at&Number=3D263588#Post263588 >>>#include <cstdio> >>>#include <cstdlib> >>>#include <GL/glut.h> >>>void display(void)=3B >>>void init(void)=3B >>>void set_debug_window_size(void)=3B >>>void switch_to_full_screen(void)=3B >>>#define TRUE true >>>#define FALSE false >>>bool full_screen =3D FALSE=3B >>>int glut_pane_id =3D 0=3B >>>void SampleGameModeKeyboard( unsigned char cChar=2C int nMouseX=2C int >>>nMou= >>>seY ) >>>{ >>> static int toggleMode=3Dtrue=3B >>> if( cChar =3D=3D 27 ) exit(0)=3B >>> if (toggleMode) >>> { >>> set_debug_window_size()=3B >>> toggleMode=3D!toggleMode=3B >>> } >>> else >>> { >>> switch_to_full_screen()=3B >>> toggleMode=3D!toggleMode=3B >>> } >>>} >>> >>>void glut_OpenGL_call_backs() >>>{ >>> init()=3B >>> glutKeyboardFunc( SampleGameModeKeyboard )=3B >>> glutDisplayFunc(display)=3B >>>}=3B >>>void switch_to_full_screen(void) >>>{ >>> char mode_string[24]=3B >>> full_screen =3D TRUE=3B >>> sprintf(mode_string=2C "%dx%d:32@60"=2C glutGet(GLUT_SCREEN_WIDTH)=2C >>> glutGet(GLUT_SCREEN_HEIGHT))=3B >>> glutGameModeString(mode_string)=3B >>> if(glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) >>> { >>> printf("GameMode %s is possible\n"=2C mode_string)=3B >>> // destroys the current graphics window >>> glutDestroyWindow(glut_pane_id)=3B >>> glutEnterGameMode()=3B >>> glut_OpenGL_call_backs()=3B >>> // hide the cursor >>> glutSetCursor(GLUT_CURSOR_NONE)=3B >>> } >>> else >>> { >>> printf("GameMode %s NOT possible\n"=2C mode_string)=3B >>> glutFullScreen()=3B >>> } >>> #ifdef UBUNTU_PORT >>> //system("wmctrl -r\"FourteenthStreetStudio\" -b >>> add=2Cfullscreen=2Cskip_= >>>taskbar")=3B >>> #endif >>> if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) >>> { >>> printf("GameMode is now active...\n")=3B >>> } >>> else >>> { >>> //printf("GameMode is NOT active\n")=3B >>> } >>>} >>> >>>/*-------------------------------------------------------------------------= >>>- >>>set the window's width and position for debugging >>>Window managers (including gnome) >>>adhere to a standard interface=2C the EWMH/NetWM specification. >>>This allows programs that remote-control their functionality. >>>And fortunately=2C someone already has written one called "wmctrl". >>>--------------------------------------------------------------------------*= >>>/ >>>#ifdef __FREEGLUT__ >>>#define WINDOW_X_ORIGIN 0 >>>#define WINDOW_Y_ORIGIN 0 >>>#else >>>#define WINDOW_X_ORIGIN 4 >>>#define WINDOW_Y_ORIGIN 24 >>>#endif >>>void set_debug_window_size(void) >>>{ >>> int screen_width=2C screen_length=3B >>> full_screen =3D FALSE=3B >>> if(glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) >>> { >>> printf("returning from GameMode\n")=3B >>> glutLeaveGameMode()=3B >>> glut_pane_id =3D glutCreateWindow("FourteenthStreetStudio")=3B >>> glut_OpenGL_call_backs()=3B >>> } >>> #ifdef UBUNTU_PORT >>> //system("wmctrl -r\"FourteenthStreetStudio\" -b >>> remove=2Cfullscreen=2Csk= >>>ip_taskbar")=3B >>> #endif >>> /*screen_width =3D glutGet(GLUT_SCREEN_WIDTH)=3B >>> screen_length =3D glutGet(GLUT_SCREEN_HEIGHT)=3B >>> switch(screen_width) >>> { >>> case 3840: // dual screen WUXGA >>> glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C >>> WINDOW_Y_ORIGIN)=3B >>> glutReshapeWindow(1824=2C 1140)=3B // 16:10 >>> break=3B >>> case 3200: // dual screen UXGA >>> glutPositionWindow(WINDOW_X_ORIGIN + (screen_width / 2)=2C >>> WINDOW_Y_ORIGIN)=3B >>> glutReshapeWindow (1584=2C 990)=3B // 16:10 >>> break=3B >>> //etc >>> } >>> */ >>>} >>> >>>// following modified from >>>http://www.opengl.org/resources/code/samples/glu= >>>t_examples/examples/cube.c >>>/* Copyright (c) Mark J. Kilgard=2C 1997. */ >>>/* This program is freely distributable without licensing fees >>> and is provided without guarantee or warrantee expressed or >>> implied. This program is -not- in the public domain. */ >>>/* This program was requested by Patrick Earl=3B hopefully someone else >>> will write the equivalent Direct3D immediate mode program. */ >>>#include <GL/glut.h> >>>GLfloat light_diffuse[] =3D /* Red diffuse light. */ >>>{ >>> 1.0=2C 0.0=2C 0.0=2C 1.0 >>>}=3B >>>GLfloat light_position[] =3D /* Infinite light location. */ >>>{ >>> 1.0=2C 1.0=2C 1.0=2C 0.0 >>>}=3B >>>GLfloat n[6][3] =3D /* Normals for the 6 faces of a cube. >>>*/ >>>{ >>> {-1.0=2C 0.0=2C 0.0}=2C >>> { 0.0=2C 1.0=2C 0.0 } =2C >>> { 1.0=2C 0.0=2C 0.0 }=2C >>> {0.0=2C -1.0=2C 0.0}=2C >>> { 0.0=2C 0.0=2C 1.0 } =2C >>> { 0.0=2C 0.0=2C -1.0 } >>>}=3B >>>GLint faces[6][4] =3D /* Vertex indices for the 6 faces of a >>>c= >>>ube. */ >>>{ >>> {0=2C 1=2C 2=2C 3}=2C >>> { 3=2C 2=2C 6=2C 7 } =2C >>> { 7=2C 6=2C 5=2C 4 }=2C >>> {4=2C 5=2C 1=2C 0}=2C >>> { 5=2C 6=2C 2=2C 1 } =2C >>> { 7=2C 4=2C 0=2C 3 } >>>}=3B >>>GLfloat v[8][3]=3B /* Will be filled in with X=2CY=2CZ >>>vert= >>>exes. */ >>>void >>>drawBox(void) >>>{ >>> int i=3B >>> for (i =3D 0=3B i < 6=3B i++) >>> { >>> glBegin(GL_QUADS)=3B >>> glNormal3fv(&n[i][0])=3B >>> glVertex3fv(&v[faces[i][0]][0])=3B >>> glVertex3fv(&v[faces[i][1]][0])=3B >>> glVertex3fv(&v[faces[i][2]][0])=3B >>> glVertex3fv(&v[faces[i][3]][0])=3B >>> glEnd()=3B >>> } >>>} >>> >>>void >>>display(void) >>>{ >>> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)=3B >>> drawBox()=3B >>> glutSwapBuffers()=3B >>>} >>> >>>void >>>init(void) >>>{ >>> /* Setup cube vertex data. */ >>> v[0][0] =3D v[1][0] =3D v[2][0] =3D v[3][0] =3D -1=3B >>> v[4][0] =3D v[5][0] =3D v[6][0] =3D v[7][0] =3D 1=3B >>> v[0][1] =3D v[1][1] =3D v[4][1] =3D v[5][1] =3D -1=3B >>> v[2][1] =3D v[3][1] =3D v[6][1] =3D v[7][1] =3D 1=3B >>> v[0][2] =3D v[3][2] =3D v[4][2] =3D v[7][2] =3D 1=3B >>> v[1][2] =3D v[2][2] =3D v[5][2] =3D v[6][2] =3D -1=3B >>> /* Enable a single OpenGL light. */ >>> glLightfv(GL_LIGHT0=2C GL_DIFFUSE=2C light_diffuse)=3B >>> glLightfv(GL_LIGHT0=2C GL_POSITION=2C light_position)=3B >>> glEnable(GL_LIGHT0)=3B >>> glEnable(GL_LIGHTING)=3B >>> /* Use depth buffering for hidden surface elimination. */ >>> glEnable(GL_DEPTH_TEST)=3B >>> /* Setup the view of the cube. */ >>> glMatrixMode(GL_PROJECTION)=3B >>> gluPerspective( /* field of view in degree */ 40.0=2C >>> /* aspect ratio */ 1.0=2C >>> /* Z near */ 1.0=2C /* Z far */ 10.0)=3B >>> glMatrixMode(GL_MODELVIEW)=3B >>> gluLookAt(0.0=2C 0.0=2C 5.0=2C /* eye is at (0=2C0=2C5) */ >>> 0.0=2C 0.0=2C 0.0=2C /* center is at (0=2C0=2C0) */ >>> 0.0=2C 1.0=2C 0.)=3B /* up is in positive Y direction >>> */ >>> /* Adjust cube position to be asthetic angle. */ >>> glTranslatef(0.0=2C 0.0=2C -1.0)=3B >>> glRotatef(60=2C 1.0=2C 0.0=2C 0.0)=3B >>> glRotatef(-20=2C 0.0=2C 0.0=2C 1.0)=3B >>>} >>> >>>int >>>main(int argc=2C char **argv) >>>{ >>> glutInit(&argc=2C argv)=3B >>> glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)=3B >>> glut_pane_id=3DglutCreateWindow("red 3D lighted cube")=3B >>> switch_to_full_screen()=3B >>> glutMainLoop()=3B >>> return 0=3B /* ANSI C requires main to return >>> int. >>> *= >>>/ >>>} =0A= >>>_________________________________________________________________=0A= >>>Hotmail=AE has ever-growing storage! Don=92t worry about storage >>>limits.=0A= >>>http://windowslive.com/Tutorial/Hotmail/Storage?ocid=3DTXT_TAGLM_WL_HM_Tuto= >>>rial_Storage_062009= >>> >>>------------------------------------------------------------------------------ >>>Come build with us! The BlackBerry® Developer Conference in SF, CA >>>is the only developer event you need to attend this year. Jumpstart your >>>developing skills, take BlackBerry mobile applications to market and stay >>>ahead of the curve. Join us from November 9-12, 2009. Register >>>now! >>>http://p.sf.net/sfu/devconf >>>_______________________________________________ >>>Freeglut-developer mailing list >>>Freeglut-developer@... >>>https://lists.sourceforge.net/lists/listinfo/freeglut-developer >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and >> focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Freeglut-developer mailing list >> Freeglut-developer@... >> https://lists.sourceforge.net/lists/listinfo/freeglut-developer >> > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Freeglut-developer mailing list > Freeglut-developer@... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Freeglut-developer mailing list Freeglut-developer@... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |