opengl-es

iOS OpenGL using parameters for glTexImage2D to make a UIImage?

耗尽温柔 提交于 2019-12-11 02:37:54
问题 I am working through some existing code for a project i am assigned to. I have a successful call to glTexImage2D like this: glTexImage2D(GL_TEXTURE_2D, 0, texture->format, texture->widthTexture, texture->heightTexture, 0, texture->format, texture->type, texture->data); I would like create an image (preferably a CGImage or UIImage ) using the variables passed to glTexImage2D , but don't know if it's possible. I need to create many sequential images(many of them per second) from an OpenGL view

Creating a gl texture outside of GLSurfaceView.Renderer?

和自甴很熟 提交于 2019-12-11 02:23:57
问题 Is there a way to create gl textures outside of my implementation of GLSurfaceView.Renderer? I've only been able to create textures in the onSurfaceCreated method, since that's where I have access of the GL10 gl variable. It's limiting me because I can't create open gl textures on demand in my code and have to create everything in that method. Alternatively, is there a way to get at the GL10 gl variable outside of the GLSurfaceView.Renderer? Or is there even another way to create gl textures?

Adapting Grafika RecordFBOActivity to work with Android GPUImage

柔情痞子 提交于 2019-12-11 02:21:23
问题 I have an application that is using the Android port of GPUImage as the OpenGL Renderer and manager of several filters. It currently does not have a video implementation, so I am trying to adapt the RecordFBOActivity from the Google grafika repository to work with the GPUImage architecture. The base GPUImage class manages the GLContext and GLSurfaceView, and the GPUImageRenderer class implements the Renderer class. This is the class where I am trying to adapt the RenderThread from the

Drawing shape on button click using OpenGL in android

白昼怎懂夜的黑 提交于 2019-12-11 02:19:59
问题 As new to the android OpenGL section.I had downloaded the sample example given on site Displaying Graphics with OpenGL ES so run the downloaded sample and its running with an error and display the output as expected. I had do draw the triangle in the GLSurfaceview and its working fine. The screenshot for the triangle drawn:- Now as the requirement change i have to draw the triangle onclick of the imageview but not on starting the application. Here is the screenshot for the above mention

Preventing devices without a GL extension from downloading app from Google Play

隐身守侯 提交于 2019-12-11 02:19:50
问题 Is it possible to make an app unavailable for devices without a specific OpenGL ES extension on Google Play store? Since <supports-gl-texture> takes the extension name, not the texture format, can it be exploited for generic GLES extensions? 回答1: Yes I believe there is, for example: <uses-feature android:glEsVersion="0x00020000" android:required="true" /> This statement will prevent devices that do not support OpenGL es 2.0 from seeing your app in the playstore. Try this: String extensions =

Drawing a 3D cube and rotating it [duplicate]

浪尽此生 提交于 2019-12-11 02:16:23
问题 This question already has an answer here : Where to start openGL ES to create and rotate a cube in an iPhone? [closed] (1 answer) Closed 6 years ago . For an iOS app I want to draw a 3D cube and be able to rotate it with swipe gestures. Where can I find a tutorial or something for such a basic scenario? All I can find are deep reads for openGL but I think there must be something easier? 回答1: Cocos3d is a good framework to start with, and rather simple to use. Check the demo for examples, I

2D OpenGL ES Metaballs on android

时光怂恿深爱的人放手 提交于 2019-12-11 02:14:18
问题 I have an array of points (balls) in 2D-space which I want to be displayed as 2D Metaballs. For learning purposes I implemented it on a canvas by create an array which represents each pixel iterate through this array and set a value depending on the distance to every ball for each pixel iterate again and remove everything below a threshold That works fine but is extremely slow, as expected. I am pretty new to OpenGL and played around with various samples but I did not manage to make 2D OpenGL

Max programs in GLSL ES

喜你入骨 提交于 2019-12-11 02:09:37
问题 What is the maximum number of programs that can be compiled in GLSL ES? So lets say I create 100 fragment shaders, each is a different effect. So at runtime I compile all of them and dynamically I swap them with glUseProgram. I assume that everytime I compile a new GLSL-ES program it holds in somwhere in the GPU. Is there any maximum number of the amount of active compiled programs? 回答1: There is no maximum limit. Only limitation is available memory or other resources that is controlled by

Opengl Iphone SDK: How to tell if you're touching an object on screen?

放肆的年华 提交于 2019-12-11 02:08:49
问题 First is my touchesBegan function and then the struct that stores the values for my object. I have an array of these objects and I'm trying to figure out when I touch the screen if I'm touching an object on the screen. I don't know if I need to do this by iterating through all my objects and figure out if I'm touching an object that way or maybe there is an easier more efficient way. How is this usually handled? -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [super

iPhone OpenGL ES texture unit

五迷三道 提交于 2019-12-11 01:57:28
问题 I am new to writing OpenGL ES for the iPhone. I am trying to render yuv texture, but am very confused by the concept of a texture unit. If I change the glUniform1i's second parameter with different combination, the resulting image is different. My question is how is this 0 or 1 texture unit configured? What is the right way of using it? Edit: Stupid me... forgot to call this: glTexParameteri(GL_TEXTURE_2D, GL_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_MAG_FILTER, GL_NEAREST);