Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to catch glTexImage2D error when resolution is incompatible?
    primarykey
    data
    text
    <p>I am trying to catch the error that comes from incompatible image texture resolution in </p> <pre><code>glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, img-&gt;width, img-&gt;height, 0, GL_RGB, GL_UNSIGNED_BYTE, imgdata); 1. Compatible resolution, working fine = 1024x1024, 1920x1200, 1920x1080, 704x891 2. Incompatible resolutions, all giving error = 2058x1734, 1018x1280, 591x602, etc. </code></pre> <p>I don't know why glTexImage2D is working fine with #1 resolutions and giving error with #2 resolutions. I couldn't extract the resolution pattern that it follows means that some resolution are working fine and some not. I don't know why.</p> <p>Now the issue is, if user try to create a texture with incompatible resolution then OpenGL should catch the error and I should get 0 if texture is not created but glTexImage2D is not returning anything so we are unable to make something secure for user OK. "This resolution is not supported, do not use it." But the issue is OpenGL doesn't not catch the glTexImage2D error.</p> <p>During run-time execution </p> <pre><code>cout&lt;&lt;until here working fine..&lt;&lt;endl; glTexImage2D(......) run-time execution stops here and windows gives not responding error. cout&lt;&lt;"output of something that never executed"&lt;&lt;endl; Here If I use glGetError() it never works. Because windows gives error in glTexImage2D. </code></pre> <p>So, is anybody know how can I catch glTexImage2D error. If it gives error then I display OK "Dont use this Image, Use another one." and return 0.</p> <p>How to achieve this task ? I also thought about to restrict the user in only some resolutions but this isn't the solution. Right ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload