freeglut

Can't get Freeglut to work with Haskell on Windows

谁都会走 提交于 2019-12-17 16:50:54
问题 Here is my source code I'm trying to get to work: In Main.hs: import Graphics.Rendering.OpenGL import Graphics.UI.GLUT import Bindings import Data.IORef main = do (progname,_) <- getArgsAndInitialize createWindow "Hello World" reshapeCallback $= Just reshape keyboardMouseCallback $= Just keyboardMouse angle <- newIORef 0.0 displayCallback $= display idleCallback $= Just idle mouseWheelCallback $= Just mouseWheel mainLoop In Bindings.hs: module Bindings where import Graphics.Rendering.OpenGL

How to change freeglut main window icon in C++?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 18:21:55
问题 I have a DLL written in C++ that uses FreeGlut to visualize some data. I want to change the icon of the main (free)glut window. I've read that it is impossible, but in the docs I see: GLUT_ICON - specifies the icon that goes in the upper left-hand corner of the freeglut windows. How can I change icon for (free)glut window, if possible? 回答1: OK, I did it: Create a Resource for the project and add an 32x32 icon (edit it or import). This icon will get the ID equal to IDI_ICON1 . Include the

GLFW opens OpenGL 3.2 context but Freeglut can't - why?

流过昼夜 提交于 2019-12-13 11:43:08
问题 I am working on a Mac, I've got FreeGlut compiled and installed, but I can't seem to get the OpenGL 3.2 context with it. However, I can get it without any problem while using GLFW. So in GLFW, this code works perfectly fine: glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2); glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwOpenWindow(500, 500, 8, 8, 8, 8, 24, 8, GLFW_WINDOW) But with FreeGlut, this code fails(on

How to use FreeGLUT glutMouseWheelFunc in PyOpenGL program?

拟墨画扇 提交于 2019-12-12 01:31:43
问题 I have installed PyOpenGL from here for 64-bit Python 3.x and Windows 7. I am able to write and execute a PyOpenGL program that uses glutMouseFunc to listen to mouse button clicks: from OpenGL.GLUT import * from OpenGL.GL import * # Imagine the typical glut init functions here ... glutMouseFunc( mouse ) Now, I want to read the scroll wheel of the mouse too. I have done this before in C++ using FreeGLUT, which exposes a glutMouseWheelFunc . I checked and I can see freeglut32.vc9.dll and

How to close and reopen a GLUT window in a loop?

我与影子孤独终老i 提交于 2019-12-11 14:04:43
问题 I am doing a simple OpenGL freeglut project where I need to close an OpenGL window and when given a command, reopen it in the initial state (Like a game staring again when the replay button is pressed). I want to do something like this - while (c == 'y') { glutDisplayFunc(display); glutMouseFunc(mouse); glutMainLoop(); printf ("Want to play again? (y/n)\n"); scanf ("%c", &c); } How can I do this? I saw about glutDestroyWindow() somewhere but couldn't figure out how to use that in my case. 来源:

Type 'GLchar' could not be resolved

南笙酒味 提交于 2019-12-11 13:35:33
问题 I'm using Eclipse, MinGW, and I have compiled freeglut and glew and copied their libraries, DLLs, and header files into the proper locations (MinGW/include/GL, MinGW/lib, Windows/SysWOW64). I have also linked the libraries (freeglut64, opengl32, glew32, glu32) in Eclipse under the MinGW C++ Linker. Here is my code... --CharGame.cpp-- #include <stdlib.h> #include <stdio.h> #include <string.h> #include <GL/glew.h> #include <GL/freeglut.h> #include "CharGame.h" #define WINDOW_TITLE "CharGame"

Freeglut glew glutIdleFunc cause lag

a 夏天 提交于 2019-12-11 07:42:51
问题 I'm just starting out with freeglut and glew and getting it running was already quite hard for me. So now I started coding with tutorials from swiftless and I had a square displayed worked fine. Now I got to the point where I want to make the square move with the arrow keys. From the point I inserted the glutIdleFunc it started lagging. I cant move the window or click on anything else for about a minute. If I try draging the window then it moves after about 2 min. I tried doing this with the

Why is glReadPixels so slow and are there any alternative?

泄露秘密 提交于 2019-12-11 03:24:29
问题 I need to take sceenshots at every frame and I need very high performance (I'm using freeGlut). What I figured out is that it can be done like this inside glutIdleFunc(thisCallbackFunction) GLubyte *data = (GLubyte *)malloc(3 * m_screenWidth * m_screenHeight); glReadPixels(0, 0, m_screenWidth, m_screenHeight, GL_RGB, GL_UNSIGNED_BYTE, data); // and I can access pixel values like this: data[3*(x*512 + y) + color] or whatever It does work indeed but I have a huge issue with it, it's really slow

How can I generate a screenshot when glReadPixels is empty?

给你一囗甜甜゛ 提交于 2019-12-11 03:16:57
问题 I have a program which runs in a window using OpenGL (VS2012 with freeglut 2.8.1). Basically at every time step (run via a call to glutPostRedisplay from my glutIdleFunc hook) I call my own draw function followed by a call to glFlush to display the result. Then I call my own screenShot function which uses the glReadPixels function to dump the pixels to a tga file. The problem with this setup is that the files are empty when the window gets minimised. That is to say, the output from

CMake finds the correct library, but VC++ attempts to link with something else

旧城冷巷雨未停 提交于 2019-12-11 01:09:13
问题 I have a CMake module to locate FreeGLUT: FIND_PATH(FREEGLUT_INCLUDE_DIR NAMES GL/freeglut.h) FIND_LIBRARY(FREEGLUT_LIBRARY NAMES freeglut freeglut_static) SET(FREEGLUT_LIBRARIES ${FREEGLUT_LIBRARY}) SET(FREEGLUT_INCLUDE_DIRS ${FREEGLUT_INCLUDE_DIR}) INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(FreeGLUT DEFAULT_MSG FREEGLUT_LIBRARY FREEGLUT_INCLUDE_DIR) MARK_AS_ADVANCED(FREEGLUT_INCLUDE_DIR FREEGLUT_LIBRARY) It works fine and locates freeglut_static.lib when I