projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't show window when creating menu (better fix then making it very small and hiding...
[freeglut]
/
progs
/
demos
/
CallbackMaker
/
CallbackMaker.c
diff --git
a/progs/demos/CallbackMaker/CallbackMaker.c
b/progs/demos/CallbackMaker/CallbackMaker.c
index
43c31ba
..
e280148
100644
(file)
--- a/
progs/demos/CallbackMaker/CallbackMaker.c
+++ b/
progs/demos/CallbackMaker/CallbackMaker.c
@@
-8,6
+8,7
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <string.h>
static int sequence_number = 0 ;
static int sequence_number = 0 ;
@@
-80,15
+81,19
@@
Mod2Text(int mods, char *text)
if (mods&GLUT_ACTIVE_CTRL)
strcat(text,"CTRL");
if (mods&GLUT_ACTIVE_SHIFT)
if (mods&GLUT_ACTIVE_CTRL)
strcat(text,"CTRL");
if (mods&GLUT_ACTIVE_SHIFT)
+ {
if (text[0])
strcat(text,"+SHIFT");
else
strcat(text,"SHIFT");
if (text[0])
strcat(text,"+SHIFT");
else
strcat(text,"SHIFT");
+ }
if (mods&GLUT_ACTIVE_ALT)
if (mods&GLUT_ACTIVE_ALT)
+ {
if (text[0])
strcat(text,"+ALT");
else
strcat(text,"ALT");
if (text[0])
strcat(text,"+ALT");
else
strcat(text,"ALT");
+ }
if (!text[0])
strcat(text,"none");
if (!text[0])
strcat(text,"none");
@@
-213,7
+218,7
@@
Display(void)
static void
Warning(const char *fmt, va_list ap)
{
static void
Warning(const char *fmt, va_list ap)
{
- printf("%6d Warning callback:\n");
+ printf("%6d Warning callback:\n",++sequence_number);
/* print warning message */
vprintf(fmt, ap);
/* print warning message */
vprintf(fmt, ap);
@@
-223,10
+228,11
@@
static void
Error(const char *fmt, va_list ap)
{
char dummy_string[STRING_LENGTH];
Error(const char *fmt, va_list ap)
{
char dummy_string[STRING_LENGTH];
- printf("%6d Error callback:\n");
+ printf("%6d Error callback:\n",++sequence_number);
/* print warning message */
vprintf(fmt, ap);
/* print warning message */
vprintf(fmt, ap);
+ printf("\n");
/* terminate program, after pause for input so user can see */
printf ( "Please enter something to exit: " );
/* terminate program, after pause for input so user can see */
printf ( "Please enter something to exit: " );
@@
-650,6
+656,7
@@
main(int argc, char *argv[])
/* callbacks, settings and menus for this window */
SetWindowCallbacks( 1 );
glutIgnoreKeyRepeat(GL_TRUE);
/* callbacks, settings and menus for this window */
SetWindowCallbacks( 1 );
glutIgnoreKeyRepeat(GL_TRUE);
+ glutSetIconTitle("Icon Test - Callback Demo");
subMenuA = glutCreateMenu( MenuCallback );
glutAddMenuEntry( "Sub menu A1 (01)", 11 );
subMenuA = glutCreateMenu( MenuCallback );
glutAddMenuEntry( "Sub menu A1 (01)", 11 );