Results 1 to 2 of 2

Thread: About texImage2D

  1. #1

    About texImage2D

    I am confused why this interface needs the parameter "format":
    void texImage2D(GLenum target, GLint level, GLenum internalformat,GLenum format, GLenum type, ImageData pixels);
    I can not find a way to get the format of a Image object using javascript.
    So to load a Image into a texture I have to assume the image has a specified format.
    Why not remove the parameter "format" from the interface and just let the browser implementation to check it automatically so that the developers can load any supported format into one texture.

  2. #2

    Re: About texImage2D

    PS: I'm talking about:
    void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData pixels);

    not the following one(this interface does need a parameter to indicate the format of the pixel data):
    void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView pixels);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •