opengl

Creating many polygons with OpenGL is slow?

I want to draw many polygons to the screen but i'm quickly noticing that it slows down quickly. As a test I did this: for(int i = 0; i < 50; ++i) { glBegin( GL_POLYGON); glColor3f( 0.0f, 1, 0.0f ); glVertex2f( 500.0 + frameGL.GetCameraX(), 0.0f + frameGL.GetCameraY()); glColor3f( 0.0f, 1.0f, 0.0f ); glVertex2f( 9...

textures and vertex arrays with OpenGL?

Basically what I'd like to do is make textured NGONS. I also want to use a tesselator (GLU) to make concave and multicontour objects. I was wondering how the texture comes into play though. I think that the tesselator will return verticies so I will add these to my array, that's fine. But my vertex array will contain more than one poly...

Texturing and Texture Mapping GLUTess Polygons?

How exactly does one provide texture coordinates and bind a texture for a GLUTess polygon? Thanks ...

GLTessellator crashing

I'v followed a tutorial to get the GLU tesselator working. It works except the interpolation for colors of new points causes a crash after creating a random polygon(error reading from memory...) This is my callback where it crashes: void CALLBACK combineCallback(GLdouble coords[3], GLdouble *vertex_data[4], GLfloat weight[4], ...

Suggest an Alternative for glTranslate() load on CPU.

I have been working on a project of OpenGL. Here I just display a boat moving along with some option's for view change.. Its a 2D program. The thing is I have used many glTranslate functions for moving the boat in the code. It works properly in Windows(DEV-CPP) but when executed in Fedora it has a very very very slow movement for boat. W...

Windowless OpenGL

Hi, I would like to have a windowless OpenGL context (on both GNU/linux with Xorg and Windows). I'm not going to render anything but only call functions like glGetString, glCompileShader and similar. I've done some goggling but not come up with anything useful, except creating a hidden window; which seems like a hack to me. So does an...

opengl: question about glutMainLoop()

can somebody explain how does glutMainLoop work? and second question, why glClearColor(0.0f, 0.0f, 1.0f, 1.0f); defined after glutDisplayFunc(RenderScene); cause firstly we call glClear(GL_COLOR_BUFFER_BIT); and only then define glClearColor(0.0f, 0.0f, 1.0f, 1.0f); int main(int argc, char* argv[]) { glutInit(&argc, argv); ...

background colour in opengl

I want to change background color of the window after pressing the button, but my program doesn't work, can somebody tell me why, thanks in advance int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(800, 600); glutInitWindowPosition(30...

Java2D OpenGL Hardware Acceleration Doesn't Work

It doesn't work with OpenGL with even the simplest of programs. Here is what I am doing.. java -Dsun.java2d.opengl=True -jar Java2Demo.jar (Java2Demo.jar is usually included with the JDK..) The text output is: OpenGL pipeline enabled for default config on screen 0 When I don't pass in the above VM argument things work fine (but...

Can I use Blender to create 3D wall image viewer application under Linux?

Hi, Is that possible to use Blender to create Cooliris-like 3D wall image viewer application under Linux? I don't see many people use Blender (BGE) to create desktop application, so I am wondering if this is possible. People normally use Blender for modeling/movie and game engine. I can not find a good way to create 3D application in L...

OpenGL Mipmapping: how does OpenGL decide on map level?

Hi, I am having trouble implementing mipmapping in OpenGL. I am using OpenFrameworks and have modified the ofTexture class to support the creation and rendering of mipmaps. The following code is the original texture creation code from the class (slightly modified for clarity): glEnable(texData.textureTarget); glBindTexture(t...

Opengl problem with texture in model from obj

Hello! I writing small program in OpenGL, and I have problem ( textures are skew, and I dont know why, this model work in another obj viewer) What I have: http://img696.imageshack.us/i/obrazo.png/ What I want http://img88.imageshack.us/i/obraz2d.jpg/ Code of project (I use devil for images): #pragma once #include <windows.h> ...

Trouble shooting openGL text textures not showing up correctly cross platform

I have been tasked with solving a problem that is outside of my domain of knowledge and I was hoping I could get some troubleshooting advice from someone more experienced with openGL (I have very little experience with openGL). We are working on a cross platform application that is implemented in a common lisp implementation called ccl....

OpenGL Not drawing

I am using GLFW as GUI for OpenGL projects. I am using my red book and testing code and well the first bit of code doesn't work at all. I want to say this is a GLFW problem because I don't have this problem in JOGL. #include <iostream> #include "GL/glfw.h" #ifndef MAIN #define MAIN #include "GL/gl.h" #include "GL/glu.h" #endif using nam...

Set clipping rectangle for OpenGL?

I'm making a drawing application with WINAPI and OpenGL. To make things more efficient I only redraw the region needed so I invalidateRect(hwnd,myRect,false). I know OpenGL does self clipping but I want to do that for my rect. I want it to clip itself for the region I invalidated to make things even more efficient. Thanks ...

OpenGL Nothing will Display

Why can't I get anything to display with this code? #include <iostream> #include "GL/glfw.h" #ifndef MAIN #define MAIN #include "GL/gl.h" #include "GL/glu.h" #endif using namespace std; void display(); int main() { int running = GL_TRUE; glfwInit(); if( !glfwOpenWindow( 640,480, 0,0,0,0,0,0, GLFW_WINDOW ) ) { ...

Colored sphere in OpenGL

Ok so here's link to code in c++ http://pastebin.com/nfPmd0um (with polish comments ;) I would like to make a sphere divided by four planes. Each part of sphere should have a different color. At the moment it displays only 2 colored parts. I know that something's wrong with that part of code in Display() function: glEnable (GL_CLIP_PLAN...

Getting values of an object after a call to rotatef c++

Hi, I need to access the X,Y values of a vertex object after Ive rotated it (with glRotate3f). How is it possible? I need em to solve an object collision problem where collisions will be sending objects in an angle related direction based upon objects rotation degrees. edit:: Ok, Ive come close to find a way. Lets assume X and Y and d...

Multi-monitor application in C++ and Opengl

hi, I'm developing an application in C++ on Windows and i don't know in Openlg how to initialize several devices or screens for an multi-monitor application. Thanks Paul ...

OpenGL Shader Compile Error

I'm having a bit of a problem with my code for compiling shaders, namely they both register as failed compiles and no log is received. This is the shader compiling code: /* Make the shader */ Uint size; GLchar* file; loadFileRaw(filePath, file, &size); const char * pFile = file; const GLint pSize = size; newCashe.shader = glCreat...