Imagination PowerVR SDK Blog

How to use glTexStorage2D for pvr format?


#1

Hi
In this web site descripte that glTexStorage2D is like

for (i = 0; i < levels; i++) {
glTexImage2D(target, i, internalformat, width, height, 0, format, type, NULL);
width = max(1, (width / 2));
height = max(1, (height / 2));
}
But pvr format use glCompressedTexImage2D not glTexImage2D.

If I know wroung or you know other function
please let me know as soon as posible.


#2

oops, website is missing.

https://www.opengl.org/sdk/docs/man/html/glTexStorage2D.xhtml


#3

If I’m following correctly you’re looking for an API function similar to glTexStorage2D that maps a compressed texture?



I’m not aware of one that exists, but you should be able to define your own using the snippet of code in that documentation page. It would look something like:


for (i = 0; i < levels; i++) {<br />
glCompressedTexImage2D(target, i, internalformat, width, height, 0, format, type, NULL);<br />
width = max(1, (width / 2));<br />
height = max(1, (height / 2));<br />
}