glfw

static compile glfw

偶尔善良 提交于 2019-12-23 17:49:24
问题 I'm trying to compile glfw as static link on Linux Mint (based on Ubuntu 10.04) using GCC 4.4.3. Inside my project directory i got "external/glfw" which contains glfw 2.7.1 source. I've compiled it by running "make x11-install" which gives: /usr/local/include/GL/glfw.h /usr/local/lib/libglfw.a /usr/local/lib/pkgconfig/libglfw.pc i also got this simple code in test.c: #include <stdio.h> #include <stdlib.h> #include "external/glfw/include/GL/glfw.h" int main( int argc, char const* argv[] ) { if

OpenGL 3.3 on Mac OSX El Capitan with LWJGL

会有一股神秘感。 提交于 2019-12-23 17:43:29
问题 I am currently trying to create an OpenGL 3.3 context in LWJGL 3 on my Macbook Pro mid 2014. My sourcecode to initialize the window looks like this: if (!glfwInit()) { Logger.addError("GLFW", "init failed"); } glfwDefaultWindowHints(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_CORE_PROFILE, GL_TRUE); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // glfwWindowHint(GLFW_SAMPLES, 2); ID = glfwCreateWindow(width

OpenGL depth problem

江枫思渺然 提交于 2019-12-23 15:13:52
问题 I'm having problem with rendering depth in OpenGL Following code is a simple example of code in which problem occurs. It renders 2 trapezoids in same place, and one of them rotates. But the rotating one is always displayed on top, even though it should go behind the first trapezoid while rotating. I guess I messed up something with initializing OpenGL. Also while searching through stackoverflow i found a post where someone suggested to execute following code and see the output. int depth;

Warning: corrupt .drectve at end of def file

好久不见. 提交于 2019-12-23 07:57:18
问题 I installed glew, glfw and glm in eclipse cdt(c++) with the gcc/mingw, all statically. All works fine, but I don't like the warning in the output console of eclipse: Warning: corrupt .drectve at end of def file How I can fix and hide this warning ? What does it mean ? And what I noticed is, that this warning comes only, if I call the 'glewInit' function. 回答1: When I ran into this problem it was because I was linking against incompatible MSVC libs. A comment by keltar helped me through this

0:1(10): error: GLSL 3.30 is not supported. ubuntu 18.04 c++

杀马特。学长 韩版系。学妹 提交于 2019-12-22 01:29:52
问题 I am trying to draw a triangle on the window with openGL GLFW library. Here is my complete code #include <GL/glew.h> #include <GLFW/glfw3.h> #include <iostream> using namespace std; static unsigned int compileShader ( unsigned int type, const string& source ){ unsigned int id = glCreateShader ( type ); const char* src = source.c_str(); glShaderSource ( id, 1, &src, nullptr ); glCompileShader ( id ); int result = 0; glGetShaderiv ( id, GL_COMPILE_STATUS, &result ); if ( result == GL_FALSE ){

Compiling GLFW with Visual Studio 2012

天大地大妈咪最大 提交于 2019-12-21 23:29:28
问题 The Issue As apparently many people (including here on Stackoverflow), I have run into some trouble compiling, and specifically linking, my C++ OpenGL code with the GLFW library on Visual Studio (I am using v11.0 AKA 2012 Ultimate). Here is the error list: Error 1 error LNK2019: unresolved external symbol __imp__glfwInit referenced in function _main C:\Users\Dennis\MyOpenGL\OpenGL1\OpenGL1\Main.obj OpenGL1 Error 2 error LNK2019: unresolved external symbol __imp__glfwTerminate referenced in

GLFW get screen height/width?

三世轮回 提交于 2019-12-21 03:58:41
问题 Playing around with OpenGL for a while, using the freeglut library, I decided that I will use GLFW for my next training project instead, since I was told that GLUT was only designed for learning purposes and should not be used professionally. I had no problems with linking the lib to my NetBeans project and it compiles just fine, using mingw32 4.6.2. However, I am running into difficulties trying to position the window at the center of the screen. Under freeglut, I previously used:

Cannot deploy GLFW 3.2

烂漫一生 提交于 2019-12-21 02:34:29
问题 So this one is a doozie; I've got a pretty large OpenGL solution, written in version 3.2 core with GLSL 1.5 in Windows 7. I am using GLEW and GLM as helper libraries. When I create a window, I am using the following lines: // Initialize main window glewExperimental = GL_TRUE; glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); // Use OpenGL Core v3.2 glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2); glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); if(!glfwOpenWindow(Game:

Opening a fullscreen OpenGL window

ⅰ亾dé卋堺 提交于 2019-12-20 10:47:22
问题 I am tring to open an OpenGL full screen window using GLFW on linux red-hat. I have a desktop that spans two monitors with total resolution of 3840*1080. I have two problems: 1. The window is opened just on one monitor with maximum window width of 1920 (the width of a single monitor). 2. The maximum height of the window is 1003 (which I think is the height of the screen minus the height of the task bar and the top bar). This is the code I use to open the window: if (glfwInit() == GL_FALSE)

Simple triangle using OpenGL and GLFW [duplicate]

╄→гoц情女王★ 提交于 2019-12-20 07:22:06
问题 This question already has an answer here : How do I create an OpenGL 3.3 context in GLFW 3 (1 answer) Closed 5 years ago . I wrote a small program to display a simple triangle using vertex buffer. For the windowing i'm using glfw, my environment is Mac 10.9, XCode 5. The window appears black but the triangle isn't paint. Here the code: #include <GLFW/glfw3.h> #include <OpenGL/gl.h> #include <iostream> int main(int argc, const char * argv[]) { GLFWwindow* window; if (!glfwInit()) { return -1;