opengl-es

Can I mix OpenglES with standard Cocoa widgets on an iPhone app?

In case this is possible, it would be nice to see some examples! Thanks, rui ...

Rotating an object in OpenGL ES for iPhone [translate to origin --> rotate --> translate back is not working]

I recently started working with OpenGL ES for the iPhone, and I am having a bit of trouble with it. I want to be able to rotate an object with your fingers. My problem is that I have my object placed at (0, 0, -3), and I would like to rotate it about its center. I know that I need to translate back to the origin, rotate, and then bring i...

Set orientation of volume indicator for iPhone glES game.

I'm subclassing UIView using the standard EAGLView framework. When I detect orientation changes, I just add a rotation to my OpenGL stack. However, when the user adjusts the volume using the physical iPhone buttons, the volume indicator is (naturally) not rotated by the GL stack. How do I rotate the volume indicator? ...

my first shader in WebGL

Hello, I am writing my first shader in WebGL. I was wondering if the GLSL language has any way to evaluate if an attribute or a uniform is null. According to the specs it does not support to do something like if (attributeX) { dothis(); } else{ dothat(): } And I think it would be a waste to write a bool attribute for each of these...

OpenGLES - Rendering a background image only once and not wiping it

Hello, first time asking a question here but been watching others answers for a while. My own question is one for improving the performance of my program. Currently I'm wiping the viewFrameBuffer on each pass through my program and then rendering the background image first followed by the rest of my scene. I was wondering how I go about...

how to use glCopyImage2D

I'm trying something like glEnable(texture_2d) glBindTexture glCopyTexImage2D glDisable(GL_TEXTURE_2D); I think glCopyTexImage2D won't work with a non-power of two image, so that's one problem; I've also tried glReadPixels, but it's too slow for my purposes. Thanks! ...

Draw text in iPhone openGL ES using just objective-c

A need to draw some text in openGL and then make rotations and translations over it. Need to use just objective-c. Any help? ...

Track opengl texture memory in Android

How do I track the memory used by OpenGL textures in Android? I understand the texture memory is on the Video RAM, but do they get swapped in with the RAM? If I call glGenTextures and do not call glDeleteTextures, how does it impact the memory usage of my current process? ...

frame rate on the iphone using mach_absolute_time

Hi, I have the following code, and wanted to get other set of eyes to make sure I have written the right code to calculate the frame rate of a scene. Could you please chime in? This is written for the iPad using SDK 3.2. thanks! - (void)drawView:(id)sender { mach_timebase_info_data_t timer; mach_timebase_info(&timer); uint64_t t1...

GL: Autogenerating some, but not all, mipmap levels?

I have a texture that I'd like to have relatively fine control over for the two or three largest mipmap levels, but at smaller sizes, I'm happy to have GL generate the mipmaps for me based on the smallest one that I've uploaded, on down to 1x1. Is this possible? FWIW, I'm on iPhone OS with GL ES 1.1 with this. I've tried to enable GL_GE...

Matrix stack capacity is a little in Android NDK.

I created renderer and loader of DirectX8 retained mode on iPhone/iPod/iPad/MacOSX/Windows. DirectX8 retained mode format is scene graph style, and hierarchy so deep. So, only Android NDK OpenGLES was occurred GL error code 0x503,0x0504(command stack over flow or under flow). Is stack capacity of android a little? Who tried to check cap...

Develop for OpenGL ES on the desktop

I'm developing a desktop OpenGL application, and I want to make sure it'll be compatible to OpenGL ES, so that it'll be easier to port it to mobile platforms later. What's the best way to make sure I'm using only the OpenGL ES specifications in my software? ...

Best way to handle graphics on iPhone game

I will be writing a game and a friend will be doing all the graphics. What is the best way to handle the graphics in the game? We dont want to draw things, we will have all the images done before the time. Which is the best way to have these images displayed? I have read and looked at tutorials on opengl es and see that they are all...

Expected specifier-qualifier-list before... Error in C++/Objective-C iPhone project

So I'm going through the first tutorial in O'Reilly's iPhone 3D Programming book. At this point in the tutorial, it pulls all the OpenGL ES stuff into a seperate c++ interface. I have followed the book to the letter, as far as I can tell, yet I can't seem to figure out this compiler error. I'm fairly new to C++ (mostly C# in the past), s...

Mixed type iPhone project(navigation and opengl es)

I would like to have the menu part of my game a navigation style application, customized as I want. Then when the player starts the game it should load the game and run like an opengl es application. How is this done? is it 2 types of apps joined? Im thinking keeping all the xib files for the menus etc. but I am not sure how to connec...

iPhone shader profiling

I'm using a series of shaders to perform realtime image processing on the iPhone (3GS/4/iPad). The fps isn't what I'd like it to be. Are there any tools that I can use to help me work out what the bottlenecks are? ...

How to use opengl es sharegroup to share a render buffer for screen mirroring on the ipad?

I'm trying to do screen mirroring on the iPad with opengl 1.1. I've got to the point of setting up the external window and view. I'm using opengl on the first screen, and I've read that I can setup a shared render buffer, but since I'm somewhat of an opengl beginner I'm having some trouble getting something up and running that can share...

Core Graphics OR OpenGL ES for 3d texture drawing

So here is my Objective : Suppose I have a photo of my house... I want to create a wall or fence out side my house on my garden... but i want to see how it looks before creating it. So 1> User selects type of structure (wall, fence, sideways, etc etc ) 2> User selects Texture type/Color etc 3> User choose the Path Or area 4> user ...

Call to check if a current EGLContext exists in Android

I'm trying to find a way to check to see if a current EGLContext exists and is ready to use on Android. By specification, I've tried using ((EGL10)EGLContext.getEGL()).eglGetCurrentContext() and then comparing it to EGL10.EGL_NO_CONTEXT (tried .equals() and != ). However, even though through debugging it 'seems' that it is returning an...

question about switching shader programs (ES 2)

Hello guys, I'm trying to write a rather simple opengl es 2 program. I have two different shaders, one renders a solid color rectangle to the screen, the other one renders a texture mapped rectangle. I want to first draw the solid color rectangle, and then on top of it, draw the texture mapped rectangle. glUseProgram(program1); ...