opengl-es

Why am I not getting a grey background in this program

本秂侑毒 提交于 2019-12-10 12:15:23
问题 I followed the tutorial on this page: http://iphone-3d-programming.labs.oreilly.com/ch01.html I got down to the part where it says, "Compile and build and you should now see a solid gray screen. Hurray!" However, when I ran the program, I just get a black screen. These are what the files look like: HelloArrowAppDelegate.h #import <UIKit/UIKit.h> #import "GLView.h" @interface HelloArrowAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *m_window; GLView* m_view; } @end

Media Codec and Rendering using GLSurfaceview, Optimization for OnDrawFrame

情到浓时终转凉″ 提交于 2019-12-10 11:48:44
问题 I am using media codec for encoding frame coming from camera and render it using gl surface view. my ondrawframe looks like this public void onDrawFrame(GL10 unused) { float[] mtx = new float[16]; GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); surface.updateTexImage(); surface.getTransformMatrix(mtx); mDirectVideo.draw(surface); saveRenderState(); delegate.mInputSurface.makeCurrent(); mDirectVideo.draw(surface); delegate.swapBuffers(); restoreRenderState(); } So here

Drawing multiple cubes at random positions in opengl es android

非 Y 不嫁゛ 提交于 2019-12-10 11:38:39
问题 Using OpenGL ES I am rendering a simple cube class that draws it at the centre of the screen. However, I want to be able to draw multiple such cubes on the screen at random positions but don't know how to. Here is the my custom surface view that renders the cube as a private class. I haven't included my main ActivityManager since its not the concern. public class TouchSurfaceView extends GLSurfaceView { private final float TRACKBALL_SCALE_FACTOR=52.0f; private final float TOUCH_SCALE_FACTOR

How to use glDrawTex*

眉间皱痕 提交于 2019-12-10 11:27:52
问题 I want to take a .png image and use it as the background for my GLView. I've heard that glDrawTex* was the best way, but I've searched the internet and haven't found a single example of how to use it (at least not one that has worked for me). Any help? 回答1: Although the OES_draw_texture extension is a good enough way to draw a background because it may sometimes be a little faster than using geometry, I'd recommend against using it too heavily on the basis that iPhones don't implement it

How to use fragment shader to draw sphere ilusion in OpenGL ES?

只谈情不闲聊 提交于 2019-12-10 11:25:52
问题 I am using this simple function to draw quad in 3D space that is facing camera. Now, I want to use fragment shader to draw illusion of a sphere inside. But, the problem is I'm new to OpenGL ES, so I don't know how? void draw_sphere(view_t view) { set_gl_options(COURSE); glPushMatrix(); { glTranslatef(view.plyr_pos.x, view.plyr_pos.y, view.plyr_pos.z - 1.9); #ifdef __APPLE__ #undef glEnableClientState #undef glDisableClientState #undef glVertexPointer #undef glTexCoordPointer #undef

android OpenGL ES simple Tile generator performance problem

此生再无相见时 提交于 2019-12-10 11:22:46
问题 following this question : Best approach for oldschool 2D zelda-like game Thank to previous replies, and with a major inspiration from http://insanitydesign.com/wp/projects/nehe-android-ports/ , i started to build a simple Tile Generator for my simple 2D zelda-like game project. I can now generate a map with the same textured tile, using 2 for(..) imbricated iterations to draw horizontal and vertical tiles, and got some basic DPAD key input listeners to scroll over the x and y axis. but now im

LibGDX Stencil Buffers while using SpriteBatch

不想你离开。 提交于 2019-12-10 11:17:01
问题 This is a continuation of my previous problem and post, seen here. Thanks to the answer I received there I feel I was able to get a little closer to my goal, as well as further my learning of OpenGL, but shortly after figuring out the basics of working with stencil buffers, I've run into a problem. It seems that when I draw a sprite to the stencil buffer, it draws the entire square area, rather than just the pixels that aren't fully transparent as I had ignorantly hoped. I vaguely understand

Converting glReadBuffer() / glDrawBuffer() calls into OpenGL ES

浪尽此生 提交于 2019-12-10 11:16:09
问题 I'm having trouble understanding how to port glReadBuffer() & glDrawBuffer() calls into Open GL ES 1.1. Various forum posts on the internet just say "use VBOs," without going into more depth. Can you please help me understand an appropriate conversion? Say I have: glReadBuffer(GL_FRONT); followed by glDrawBuffer(GL_BACK_LEFT); state->paint(state_id, f); How can I write the pixels out? 回答1: glReadBuffer and glDrawBuffer just set the source and target for subsequent drawing operations. Assuming

iDevice slows render when there's no interaction

狂风中的少年 提交于 2019-12-10 11:09:45
问题 I'm making an application in C# Xamarin that uses a iPhoneOSGameView for rendering some video stream I receive from the network. The problem is that after around 10 seconds without any user interaction with the screen, the frame rate drops significantly. It seems that the iDevice is going into some sort of power saving mode. When I interact with the screen (e.g. I pull down the top bar menu (iOS menu)), the frame rate goes back up, just like the iDevice realized I was actually using the

Android 7 GraphicBuffer alternative for direct access to OpenGL texture memory

穿精又带淫゛_ 提交于 2019-12-10 10:46:34
问题 The only way to get profit from the fact, that mobile devices have shared memory for CPU and GPU was using GrphicBuffer . But since Android 7 restrict access to private native libs (including gralloc) it is impossible to use it any more. The question - is there any alternative way to get direct memory access to texture's pixel data? I know, that something simmilar can be done using PBO (pixel buffer object). But it still does additional memory copy, wich is undesirable. Especially if we know,