opengl-es

Android. OpenGL ES draw screen size square in ortho projection

≡放荡痞女 提交于 2019-12-25 14:49:20
问题 I'm new in openGL ES. I read simple tutorials but i have problem with setup Ortho and draw screen size square. Could you provide simple code as example ? 回答1: A nice usage of the orthographic projection is that you can specify how big influence a single float will have in your application when you're setting your vertex data. For example, consider this explanation: float right = 5.0f float top = 4.0f glOrthof(0.0f, right, 0.0f, top); In the image above; an object that has a quad (built from

Android. OpenGL ES draw screen size square in ortho projection

别来无恙 提交于 2019-12-25 14:49:13
问题 I'm new in openGL ES. I read simple tutorials but i have problem with setup Ortho and draw screen size square. Could you provide simple code as example ? 回答1: A nice usage of the orthographic projection is that you can specify how big influence a single float will have in your application when you're setting your vertex data. For example, consider this explanation: float right = 5.0f float top = 4.0f glOrthof(0.0f, right, 0.0f, top); In the image above; an object that has a quad (built from

Blank screen when using gluOrtho2D

ε祈祈猫儿з 提交于 2019-12-25 14:48:55
问题 First, sorry if my English is bad :( I'm currently trying to make game in Android, and using this link to start with. When I learned that we can use gluOrtho2D to draw parallel 2D (the tutorial using perspective), I switch my code. But it display nothing but blank screen. This is my code: public class GLRenderer implements Renderer{ private Triangle triangle; private Square square; private Context context; /** Constructor for GL * @return */ public GLRenderer(Context context) { this.context =

Libgdx Android - GL Thread (NullPointerException) & Missing Class File

妖精的绣舞 提交于 2019-12-25 10:19:30
问题 i'm using the LibGdx framework to create a game and I'm using Eclipse 4.4 (Luna). Whilst i'm debugging my application this method is breaking. @Override public void run() { setName("GLThread " + getId()); if (LOG_THREADS) { Log.i("GLThread", "starting tid=" + getId()); } try { guardedRun(); } catch (InterruptedException e) { // fall thru and exit normally } finally { sGLThreadManager.threadExiting(this); } } inside the GLSurfaceView Android class, with the stack trace: Thread [GLThread 232]

Can I avoid using offsetof in the following?

夙愿已清 提交于 2019-12-25 10:02:53
问题 Following another question from me, here is a specific example where I want to avoid offsetof . For using with glVertexAttribPointer , I have to use offsetof for the last parameter. glVertexAttribPointer(GLKVertexAttribColor, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid *) offsetof(Vertex, _color)); Vertex is a class. Is there a way I can avoid using this one? I tried with pointer to members, but no luck. Cannot compile in the following glVertexAttribPointer(GLKVertexAttribColor, 3,

Open GL ES creating Off-screen

心不动则不痛 提交于 2019-12-25 09:44:43
问题 I am stuck with the following while creating OFF-SCREEN surface using OpenGL ES 2.0 : 1. How to create Off-Screen surface using eglCreatePixmapSurface()? 2. eglCreatePixmapSurface() API takes EGLNativePixmaptype as parameter, what is EGLNativePixmaptype ? how to find its Structure definiton? Can i make it on my own? ( In my Code base its declare as void * ) 3.Once the drawing is done on a Native Pixmap surface, how to access my Native Pixmap data? I have searched in internet alot but could

Open GL ES creating Off-screen

本小妞迷上赌 提交于 2019-12-25 09:44:08
问题 I am stuck with the following while creating OFF-SCREEN surface using OpenGL ES 2.0 : 1. How to create Off-Screen surface using eglCreatePixmapSurface()? 2. eglCreatePixmapSurface() API takes EGLNativePixmaptype as parameter, what is EGLNativePixmaptype ? how to find its Structure definiton? Can i make it on my own? ( In my Code base its declare as void * ) 3.Once the drawing is done on a Native Pixmap surface, how to access my Native Pixmap data? I have searched in internet alot but could

Is it possible to combine 2 opengl EXTERNAL_OES texture together?

不羁岁月 提交于 2019-12-25 09:24:15
问题 I am just wondering if it is possible to combine 2 GLES11Ext.GL_TEXTURE_EXTERNAL_OES texture and access them at the same time in the fragment shader? 回答1: Bind it as a GL_TEXTURE_EXTERNAL_OES texture Use uniform samplerExternalOES tex0 and tex1 instead of sampler2D 来源: https://stackoverflow.com/questions/41818314/is-it-possible-to-combine-2-opengl-external-oes-texture-together

How to figure out which GLSL (ESSL) version Qt uses on my PC?

只谈情不闲聊 提交于 2019-12-25 09:18:31
问题 I'm using ESSL (OpenGL ES Shading language) via Canvas3D in Qt. On my machine I run Windows and have set the following: QGuiApplication::setAttribute(Qt::AA_UseOpenGLES); in main() , which means that GL calls get translated by Qt to GL ES calls, which get translated by ANGLE to Direct3D calls. At least I believe that's what it means. I'm using the following test QML code to see what OpenGL version is used: Text { text: OpenGLInfo.majorVersion + "." + OpenGLInfo.minorVersion } This displays "2

iOS. OpenGL. Fill area with gradient under curve line

China☆狼群 提交于 2019-12-25 09:16:57
问题 I need to create a sound wave animation like Siri (SiriAnim) With OpenGL I'v got a shape of wave: Here is my code: @property (strong, nonatomic) EAGLContext *context; @property (strong, nonatomic) GLKBaseEffect *effect; // ..... - (void)setupGL { [EAGLContext setCurrentContext:self.context]; glEnable(GL_CULL_FACE); self.effect = [[GLKBaseEffect alloc] init]; self.effect.useConstantColor = GL_TRUE; self.effect.constantColor = GLKVector4Make(0.0f, 1.0f, 0.0f, 1.0f); } // ..... - (void)glkView: