I would like to copy an array of pixel data (colors) into a texture. Please could someone point me in the right direction? I have looked on google but all of the tutorials are for OpenGL, rather than OpenGL ES. Thanks 🙂
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s about the same as in OpenGL:
glGenTextures(1, &textureID);glBindTexture(GL_TEXTURE_2D, textureID);glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixeldata);After that you can applay the texture to your geometry. Of course, the texture has to have the right dimensions (power of 2, square), pixel format and so on.