opengl

From Direct3d to OpenGL

I currently rewrite an old Visual Basic application in java, a large part of the work involves replacing Direct3d with jogl. Since I have no experience in dealing with Direct3d and only minimal experience using Opengl, I am stuck on finding appropriate replacements for the api calls. Are there any good guides/tutorials or references? ...

access violation in wglMakeCurrent

Sometimes in my OpenGL application I get an access violation in the following API call: wglMakeCurrent(NULL, NULL); The application only has one single thread, and I've checked that before that call, both the DC and HGLRC that are currently used are correct and valid. There are three different windows with OpenGL content, and they're...

openGL camera zoom / scale around point and pan

I've implemented a camera (model view) in my 2D opengl application and am having some issues with scaling around a point and also scaling around a point in combination with panning. Both work with the mouse. Panning works with a mouse drag, and scale to point zooms in/out around the current mouse location. Panning works fine as long a...

OpenGL and infinite light position?

Is it possible to shade the polygons so every polygon would be rendered with the same light angle, no matter which their position is relative to the light? I need to move my sun light, but the map is exteremely large, and i dont want the light looks any different in any other location, should be symmetric everywhere. ...

How can I use graphical resources (stored in res\drawable folders) from NDK?

Hello! I need to use openGL in NDK, and I need to load and use some images (PNG), and maybe other files. These files are stored in res\drawable, res\drawable-hdpi, but I cannot access them with fopen()... There is a way to do this? Can somebody give me a piece of code for my problem, because it is quite urgent. Thank you very much, and...

How do I add joystick support into OpenGL?

I want to add joystick support into an openGL application. Is there any class that can help me? Thanks in advance. ...

OpenGL Textures wont work unless made between two pieces of code which isn't what I want.

Hello, I'm making a game with python and OpenGL. I was making it with pygame but I realised quick enough that it was too slow. I've made a class which I want to reasonably act like the Surface class for pygame, where Surface objects can be blitted to other Surface objects. I'm wishing to use framebuffers for rendering textures to texture...

Is OpenGL on Android a battery killer?

Hey, I'm currently implementing a software keyboard ( using some sophisticated prediction ), and drawing it using canvas is insufficient in terms of perfomance. I'm getting frame drawing times well above 100ms, which is clearly unacceptable. The keyboard itself consists of about 33 keys, each of them drawn using drawRoundRect and a sim...

how to make an X11 window in freeglut api un-movable/un-draggable and un-resizable

Hi, I am using the freeglut OpenGL api to create an opengl context. The window that is created is through the glutCreateWindow() function.. I want that somehow the resulting window is made un-movable/un-draggable and un-resizable.. any way to achieve this? Thanks. ...

OpenGL Video Memory Usage

Hello, is there an API or profiler application that can track the video memory usage of my application? I am using C++/OpenGL on Windows, but I am open to suggestions on other platforms as well. ...

When Should One Call glGetError ?

glLoadIdentity says GL_INVALID_OPERATION is generated if glLoadIdentity is executed between the execution of glBegin and the corresponding execution of glEnd. But GL_INVALID_OPERATION is a flag returns by glGetError. My question is, when should we call glGetError ( in order to know whether we are calling opengl in correct s...

Cocoa and OpenGL, How do I set a GLSL vertex attribute using an array?

I'm fairly new to OpenGL, and I seem to be experiencing some difficulties. I've written a simple shader in GLSL, that is supposed to transform vertices by given joint matrices, allowing simple skeletal animation. Each vertex has a maximum of two bone influences (stored as the x and y components of a Vec2), indices and corresponding weigh...

switches in ubuntu to use math3d.h

Hey, i was doing an opengl program and it so happens i had to use some functions in the math3d.h header and i copied it to the local directory and included inlcude "math3d.h" but i get an error transform.cpp:(.text+0x3da): undefined reference to `m3dRotationMatrix44(float*, float, float, float, float)' collect2: ld returned 1 exit sta...

an in built function to draw a torus in opengl glut

hey, i am using opengl and i was wondering if there was an inbuilt function in opengl to draw a torus? Thanks i advance ...

What is the major difference between freeglut and glut

hey, i started programming with glut and i have been reading posts about freeglut bettering glut which is better and why? Thanks in advance ...

why does not my opengl program work?

Hey guys i was writing a program to draw a square in my XY plane and make it rotate 360 degree but it is not working. since i am in my initial stages of my opengl it is too hard for me to debug it myself void setupRC() { glClearColor(0,0,1,1); glColor3f(1,0,0); } void timerfunc(int value) { glutPostRedisplay()...

Fast way to convert array of points into triangle strip?

I have an array of CGPoints (basic struct with two floats: x and y). I want to use OpenGL ES to draw a textured curve using these points. I can do this fine with just two points, but it gets harder when I need to make a line from several points. Currently I draw a line horizontally, calculate its angle from the points given, and then ro...

How can I make a ball of light in openGL?

I'm trying to make a orb of light (Like a sun) but I can't seem to make it visible at all. I'll give you some snipets of code I have. It's in Java LWJGL, so it might look a little different. private float lightAmbient[] = { 0.0f, 1.0f, 1.0f, 1.0f }; // Ambient Light Values ( NEW ) private float lightDiffuse[] = { 1.0f, 1.0f, 1.0f, ...

a doubt on gluPerspective

Hey, gluPerspective is very tricky for me. i mean, where are we placing the camera to adjust it near and far. on the +ve z looking at the origin or on the -ve z looking at the origin ive been experimenting whateva changes i make i seem to get the same output can somebody put it in an easy to understand way? ive been having big prob...

Problem with gluPerspective using opengl

Hey, I was doing my opengl program and I happen to have a problem, can you find what is the matter with it? It rotates a plane with the y axis as the centre when I am using glortho it is working fine, but gluPerspective it is not. There is some problem with the gluPerspective because when I change the angle to 0 I can just see s...