opengl

OpenGL graphics editor...implementation of eraser tool

i'm writing a menu-based OpenGL graphics editor.It is pretty basic. Every time i choose a new option in the pop-down menu, the older drawing disappears,this doesn't allow me to use the eraser tool...could anybody tell me how to solve this problem?thanx ...

Dislpay List and transformation

Greetings! I have this question. Whenever, I enter a transformation (gltranslate, glrotate, glscale) within a display list, the transformation remains as a command within the display list. Everytime the display list is rendered, it will calculate all and over again. Is there a way, I can make an opengl transformation and the transfor...

OpenGL GL_LINE_STRIP gives error 1281 (Invalid value) after glEnd.

I have no idea what is wrong with the simple code. The function is for use with python and ctypes. extern "C" void add_lines(bool antialias,GLdouble coordinates[][2],int array_size,GLdouble w,GLdouble r,GLdouble g, GLdouble b,GLdouble a){ glDisable(GL_TEXTURE_2D); if (antialias){ glEnable(GL_LINE_SMOOTH); //Enable line s...

How do you set a live video feed as an OpenGL RenderTarget or framebuffer?

i would like to take a live video feed from a video camera or 2 to do split screen stuff and render on top of them. How can i capture the input of the video? i found some old code that uses pbuffers.. is this still the optimal way of doing it? i guess their is a lot that depends on the connection interface, whether it is USB or fire wi...

gluNewQuadric() before opengl's initialization

Hello, I'm working on a c++ code that uses SDL/opengl. Is this possible to create a pointer to a quadric with gluNewQuadric() before having initialized opengl with SDL_SetVideoMode? The idea is to create a class with a (pointer to a) quadric class member that has to be instantiate before the SDL_SetVideoMode call. This pointer is ini...

OpenGL code to render ribbon diagrams for protein

Hey all, I am looking to render ribbon diagrams of proteins using OpenGL and C++. Does anyone know if any open source code for this already exists, or if there are good guides to do this? If not, I'd prefer to figure it out myself ;) but I didn't want to reinvent the wheel, especially if the wheel was free. EDIT: thanks for the respo...

Store 3d models in game, the best way

What is the best method to store 3d models in game ? I store in vectors: vector triangles (each triangle contain number of texcords, numer of vertex and number of normal), vector points; vector normals; vector texCords; ...

opengl glfrustum function implement

would somebody tells me how that glfrustum matrix generated? i know about that matrix can be set many ways, but why that one? thanks ...

Memory Size Allocation on GPU - opengl texture loading question

I'm loading pixels from an image which is 32 w by 32 height. The format I'm loading them in is ARGB via java. When I bind this to the video card, I can expect that the video card might use somewhere around 32*32*4 bytes, or 4K. Similarly, 1024 w, 1024 h would be 1024*1024*4 = 4MB. Is my understanding correct? Now I understand wh...

OpenCL or OpenGL – which one to use?

My Problem involves a black and white image with a black area in the middle. I never worked with OpenGL or OpenCL before so I do not know which one to chose. I want to put some white circles over the area and check at the end whether the whole image is white. I will try many combinations so I want to use the GPU because of its parallelis...

Draw OpenGL on the windows desktop without a window

I've seen things like this and I was wondering if this was possible, say I run my application and it will show the render on whatever is below it. So basically, rendering on the screen without a window. Possible or a lie? Note: Want to do this on windows and in c++. ...

OpenGL Motion blur with the accumulation buffer in WxWidgets

Hello, I'm trying to achieve a motion blur effect in my OpenGL application. I read somewhere this solution, using the accumulation buffer: glAccum(GL_MULT, 0.90); glAccum(GL_ACCUM, 0.10); glAccum(GL_RETURN, 1.0); glFlush(); at the end of the rendering loop. But nothing happens... What am I missing ? Additions after genpfault ...

Why is there no circle or ellipse primitive in openGL?

Hey guys. Circles are one of the basics geometric entities. Yet there is no primitives defined in openGl for this like lines or polygons. Why so? Its a little annoying to include custom headers for this all the time! Any specific reason to omit it? ...

OpenGL fast texture drawing with vertex buffer objects. Is this the way to do it?

Hello. I am making a 2D game with OpenGL. I would like to speed up my texture drawing by using VBOs. Currently I am using the immediate mode. I am generating my own coordinates when I rotate and scale a texture. I also have the functionality of rounding the corners of a texture, using the polygon primitive to draw those. I was thinking...

Trying to convert openGL to MFC coordinates and having Problems with "gluProject"

To clarify things, what i am trying to do is to get the openGL coordinates and manipulate them in my mfc code. not to get an openGL object. i'm using the mfc to control the position of the objects in the openGL. Hi, i'm trying to find the naswer on the web and can't find a full solution that i can use and that will work... I'm develop...

What language to use for developing a tiled map editor?

Hello. I'm working on a 2D tiles-based games mixing 3D models, which I achieved using OpenGL and C++. I would like to know what language should I use for creating a map editor, it needs to be easy-to-use and with a form designer or something alike, and with an easily embedded rendering engine. If you would say I should use a language, I ...

ANY material writen in/for DELPHI around the graphics topic?

Does anyone knows ANY material writen in/for DELPHI around the graphics topic? Planning to build a software for medical imaging processing . Thinking in 3D UI to absorve the power of nvidias GTX graphics card, and some real-time 2D processing integrated with high-end scanners. Please dont take this as a "rant" but, we have zillions of ...

OpenGL Vertex Buffer Object code giving bad output.

Hello. My Vertex Buffer Object code is supposed to render textures nicely but instead the textures are being rendered oddly with some triangle shapes. What happens - http://godofgod.co.uk/my_files/wrong.png What is supposed to happen - http://godofgod.co.uk/my_files/right.png This function creates the VBO and sets the vertex and textu...

Is it safe to make GL calls with multiple threads?

I was wondering if it was safe to make GL calls with multiple threads. Basically I'm using a GLUtesselator and was wondering if I could divide the objects to draw into 4 and assign a thread to each one. I'm just wondering if this would cause trouble since the tesselator uses callback functions. Can 2 threads run the same callback at th...

When should I use indexed arrays of OpenGL vertices?

I'm trying to get a clear idea of when I should be using indexed arrays of OpenGL vertices, drawn with gl[Multi]DrawElements and the like, versus when I should simply use contiguous arrays of vertices, drawn with gl[Multi]DrawArrays. (Update: The consensus in the replies I got is that one should always be using indexed vertices.) I hav...