opengl-es

GLSurfaceView transparent background

此生再无相见时 提交于 2019-12-11 09:13:42
问题 I'm using min3D library in my project to visualize a 3D model. This library is based in openGL. For this, I defined a renderer which manages the GLSurfaceView. At this moment, I see the 3D model in my app, but the background of the surface view is black, and my goal is to make it transparent, this way I would only see the 3D model without the black background. The min3D library examples, as other SO questions and info I've readed about this, tell that the way to achieve this is by doing this:

gl.h & glext.h not found

孤街浪徒 提交于 2019-12-11 09:09:53
问题 While trying to execute a program based on C++ in android via NDK platform, the compilation is giving error that 'gl.h' and 'glext.h' header files are not found, as I have included both of them in my C++ code. M using android-ndk-r8 and compiling it with Cygwin. here s my code: **ANDROID.MK** LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := NDK1 FILE_LIST := $(wildcard $(LOCAL_PATH)/*.cpp) LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) include $(BUILD_SHARED_LIBRARY) ---

OpenGL Color Index for iPhone's OpenGL ES 1.1?

孤街浪徒 提交于 2019-12-11 09:09:30
问题 Is it possible to use color pallettes in openGL ES 1.1? I'm currently developing a game which has player sprites, and the player sprites need to be able to be changed to different teams' colors. For example, changing the shirts' colors but not the face colors, which rules out simple hue rotation. Is this possible, or will this have to be implemented manually (modifying the texture data directly)? 回答1: It's not a hardware feature of the MBX but a quick check of gl.h for ES 1.x from the iPhone

Draw Square with OpenGL ES for iOS

喜欢而已 提交于 2019-12-11 08:58:22
问题 I am trying to draw a rectangle using the GLPaint example project provided by apple. I have tried modifying the vertices but cannot get a rectangle to appear on the screen. The finger painting works perfectly. Am I missing something in my renderRect method? - (void)renderRect { [EAGLContext setCurrentContext:context]; glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); // Replace the implementation of this method to do your own custom drawing. static const GLfloat squareVertices[] = {

Drawing many textured particles quickly in OpenGL ES 1.1

為{幸葍}努か 提交于 2019-12-11 08:57:58
问题 I'm trying to render some particle effects in Android using OpenGL. Each particle will be a billboarded textured quad and each particle is rendered with a rotation (i.e. around the z axis). I'm restricted to using OpenGL ES 1.1 so point sprites and pixel shaders aren't an option. What is a fast way of rendering and updating the positions of many particles (e.g. 100 to 5000)? I know that using an OpenGL draw call for each particle is going to be very slow but I'm confused at how to use things

How to draw a line inside the fish movement (OpenGLES in iPhone)?

拥有回忆 提交于 2019-12-11 08:27:16
问题 Am working in a simple iPhone game application using OpenGLES framework. I facing an "EXC Bad Access" error while draw a line on the images . Here i will explain you what i did and what i tried in my project. Step:1 I draw a Background Image used GL_TRIANGLE_STRIP . Here is my sample code, - (void)viewDidLoad { [super viewDidLoad]; self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; Test = NO; Test1 = NO; if (!self.context) { NSLog(@"Failed to create ES context"); }

NSString drawInRect: and drop shadows on iOS

依然范特西╮ 提交于 2019-12-11 08:22:47
问题 I'm using [NSString drawInRect:] to draw text to a texture and everything works fine until I add drop shadows. They appear correctly, but are often clipped by the rect I'm drawing to. The issue is that [NSString sizeWithFont:] doesn't know about the drop shadows since they are applied via CGContextSetShadowWithColor(...) . Here is the code I'm using (fluff removed): CGSize dim = [theString sizeWithFont:uifont]; ... CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f);

how i can use gldrawelements for many squares?

♀尐吖头ヾ 提交于 2019-12-11 08:20:27
问题 I am developing a 2D Open GL game and i have to draw many squares on screen for a tilemap, with a diferent glTexCoordPointer from the texture. Now, I don't know how to use Gldrawelements for draw many squares, which would be the structure of the indices if I want to draw many squares? And, how can I put each array (vertices), which contains the coordinates of each square on the vertexbuffer ? Also, will it be possible to set different glTexCoordPointer for each square in just one call to the

How to draw a line inside the ball movement in OpenGLES?

ぃ、小莉子 提交于 2019-12-11 08:19:24
问题 Currently i am working in ball game app using OpenGLES in iphone, Using GL_TRIANGLE_STRIP to draw ball and movement action from left to right, then GL_LINES to draw a line, but the line cannot draw inside the ball movement, how to solve this? I tried the sample code: #1 - (void)update { self.timeSinceLastSpawn += self.timeSinceLastUpdate; self.timeSinceLastSpawn = 0; if (self.timeSinceLastSpawn > 2.0) { [self target]; // Call the Method target } for (SGGSprite * sprite in self.children) /

how to specify point sprite texture coordinates in OpenGL ES 1.1?

…衆ロ難τιáo~ 提交于 2019-12-11 08:16:28
问题 I'm writing a particle system that uses point sprites in OpenGL ES 1.1 on iOS. Everything works great until I try to texture the point sprites... when I render, each sprite is colored by the top left pixel of the texture I'm loading (rather than displaying the image). I've tried different images and different sizes and always get the same result. setup code (taken from GLPaint example): CGImageRef brushImage; CGContextRef brushContext; size_t width, height; GLubyte *brushData; brushImage =