Questions tagged [glteximage2d]

72 questions
3
votes
2 answers

How to catch glTexImage2D error when resolution is incompatible?

I am trying to catch the error that comes from incompatible image texture resolution in glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, img->width, img->height, 0, GL_RGB, GL_UNSIGNED_BYTE, imgdata); 1. Compatible resolution, working fine = 1024x1024,…
maxpayne
  • 1,111
  • 2
  • 21
  • 41
2
votes
1 answer

Android OpenGL ES 2.0 -- glReadPixels() and glTexImage2D() drawing a black texture?

I'm working on some Android code for caching and redrawing a framebuffer object's color buffer between the loss and recreation of EGL contexts. Development is primarily happening on a Xoom tablet running Honeycomb. Anyway, what I'm trying to do…
2
votes
0 answers

Android OpenGL - glTexImage2D causing crash using ByteBuffer wrapped over byte[] with offset

Problem: Passing a ByteBuffer wrapping a byte[] containing image data into GLES20.glTexImage2D(...) is working for me if and only if the ByteBuffer has no offset - otherwise (if there's an offset set) it crashes unhelpfully with something…
Mete
  • 5,495
  • 4
  • 32
  • 40
2
votes
1 answer

Create A Solid Color Texture In OpenGL

I have a question regarding creating textures without a file. My goal is to make a function that takes a vec3 color as an input and returns a texture ID for that texture. This is what I have so far, but it gives odd outputs which has stripes of…
CodeMan
  • 99
  • 6
2
votes
2 answers

pass data between shader programs

Ok I'm going to keep this as simple as possible. I want to pass data between shader programs. I'm using readPixels currently to do that but I feel it may be slowing operations down and I'm exploring faster options. what my program does: program1…
2
votes
0 answers

webgl texture on expo gives black screen

I'm trying webGL for the first time, thing is I am working on Expo with the expo-gl package, aiming to build a filter component for photo editing. So far, I have been able to create a context successfully. When creating the shaders everything works…
2
votes
2 answers

Fastest 2D frame rate possible with android NDK, my try included, better options available?

Fastest 2D frame rate possible with android NDK, my try included, better options available? I used the NDK and OpenGL ES 2.0 to display a frame as a texture on a GL_TRIANGLE_STRIP. This was done on a HTC Desire, same hardware as Nexus One. I tried…
user346617
  • 21
  • 1
  • 3
2
votes
2 answers

Using OpenGL GL.TexSubImage2D for NPOT Textures results in artifacts

I'm using OpenGL through OpenTK in C# and try to load textures from generic bitmaps. My driver does not support NPOT Textures so what I do is allocate a POT Texture with GL.TexImage2D and fill it with my bitmap through GL.TexSubImage2D. However I…
Flamefire
  • 5,313
  • 3
  • 35
  • 70
2
votes
3 answers

Puzzels about glteximage2d using gl_luminance

I met some problem about using gl_luminance to define FBO. Here is the code i used, generateRenderToTexture(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, _maskTexture, _imageWidth, _imageHeight, false); related code is as follows, TextureBuffer…
user3500496
  • 97
  • 1
  • 9
2
votes
1 answer

Returning result of stbi_load function and using it for glTexImage2D causes memory violation

I've a problem with the stbi library and I thought, maybe you have an idea why this isn't working. I have declared a function like this: bool LoadTextureFile(std::string file, unsigned char ** pixel_data, int * width, int * height, int * n); In…
MANiC
  • 103
  • 2
  • 9
2
votes
3 answers

use glTexImage2D draw 63*63 image

In the android,use this code is worked: glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, content.width, content.height, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, content.pixels); but in the iOS not work, this code only draw 64 *64(power of…
yinchonging
  • 27
  • 1
  • 7
2
votes
2 answers

GL_UNSIGNED_SHORT_5_6_5 undeclared?

I have a problem loading a texture using SDL library. Usually I make programs on Linux but I try to create a code that is compatible with Visual Studio also. On Linux are everything OK but on Visual Studio it crashes in "GL_UNSIGNED_SHORT_5_6_5" in…
Nebula
  • 41
  • 9
2
votes
2 answers

OpenGL glGetTexImage2d type parameter?

reading the docs i see that the glGetTexImage2d() function has a 'type' parameter. The docs say that the type parameter "specifies the data type of the pixel data" and gives some examples of types such as GL_INT, GL_BYTE, etc. but what does it mean…
horseyguy
  • 29,455
  • 20
  • 103
  • 145
2
votes
1 answer

glTexImage2D much slower on Android 4.2.2 than 4.2.0

We recently upgraded our Android devices from 4.2.0 to 4.2.2 only to realize that everything is now stuttering madly. On Android 4.2.0 or lower, this call required roughly 15 ms. glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0,…
BlueVoodoo
  • 3,626
  • 5
  • 29
  • 37
2
votes
1 answer

Python From array of floats to texture

I need to create a texture from matrix of floats([0..1]). Texture should show a grey squares, but only show a white rectangle :( I have this code: def _generate_image(self): i_len = len(self._data)*Config().get_pixels_per_tile() j_len =…