diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-05-05 19:25:01 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-05-05 19:33:28 +0200 |
| commit | 38e1d6b099e8a19271f023ec31f98bb9c7a39e40 (patch) | |
| tree | 0d7a3c56c9bc97741ec094e8af3015fdf0180581 /examples/OpenGL3-glut-test.cxx | |
| parent | dea8a93bc2dc359bbcfd33889592660ee0089075 (diff) | |
Fix Visual Studio compiler warnings, make output visible...
on Windows w/o a console device ("DOS"/Debug window) if OpenGL3 is
not available.
Diffstat (limited to 'examples/OpenGL3-glut-test.cxx')
| -rw-r--r-- | examples/OpenGL3-glut-test.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/OpenGL3-glut-test.cxx b/examples/OpenGL3-glut-test.cxx index a5060feee..311a02603 100644 --- a/examples/OpenGL3-glut-test.cxx +++ b/examples/OpenGL3-glut-test.cxx @@ -1,7 +1,7 @@ // // Tiny OpenGL v3 + glut demo program for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2022 by Bill Spitzak and others. +// Copyright 1998-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -25,6 +25,7 @@ # include <GL/glew.h> #endif #include <FL/glut.H> +#include <FL/fl_ask.H> #include <stdio.h> #include <stdlib.h> @@ -207,10 +208,14 @@ int main (int argc, char* argv[]) #endif int gl_version_major; const char *glv = (const char*)glGetString(GL_VERSION); - fprintf(stderr, "OpenGL version %s supported\n", glv); sscanf(glv, "%d", &gl_version_major); + fprintf(stderr, "OpenGL version %s supported\n", glv); if (gl_version_major < 3) { fprintf(stderr, "\nThis platform does not support OpenGL V3\n\n"); + fflush(stderr); + // ensure that users see a message on Windows w/o console output: + fl_alert("OpenGL version %s supported.\n" + "This platform does not support OpenGL V3!",glv); exit(1); } initShaders(); |
