Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:14:40+00:00 2026-06-14T04:14:40+00:00

In C#, inside the OpenGL context of Esri ArcMap dynamic display (immediate mode), I

  • 0

In C#, inside the OpenGL context of Esri ArcMap dynamic display (immediate mode), I try to create textures:

GL.glEnable(GL.GL_TEXTURE_2D);
uint[] textures = new uint[1];
GL.glBindTexture(1, textures[0]);
uint error = GL.glGetError();

The value of error is 1281 (invalid value).

I’ve checked – it’s not in between glBegin/glEnd calls, and the context is valid. I also used GLIntercept to check the calls and errors, but it seems to give me false negatives (I compare the full call list to the errors and the errors just doesn’t match – only things like glEnd called before glBegin while the full function lists shows nothing like that ever happened).

I suspect it’s a driver problem. I run an ATI Radeon 2400 Pro on a Win7 64 (the app is 32bit). The ESRI version I use is 9.3.1 sp1.

I’ve Google’d it quite a lot and even looked at http://www.opengl.org/wiki/Common_Mistakes but I can’t find anything that resembles my problem.

It doesn’t seem to happen in all programs that base on that code, but it happens constantly on some, so I’m really confused about it.

What should I check next?

EDIT:

I started eliminating code that was running before that error (long before, actually) and found that if when drawing a polygon, (a polygon that has nothing to do with that texture and that is drawn using glVertexPointer and glDrawArrays, no texture related at all), I remove the glLineWidth that is found before drawing that polygon, I get no error when binding the texture.

Now I know that’s silly, and it makes no sense, and it’s either a huge problem in the driver or in my understanding of OpenGL, but I can’t figure out which 🙂

I was very careful with the elimination and it’s really just that line in that specific function:

GL.glDisable(GL.GL_TEXTURE_2D);
GL.glPushMatrix();
GL.glLoadIdentity();

GL.glLineWidth(someWidthParameter); // <-- The only line I comment.

GL.glEnableClientState(GL.GL_VERTEX_ARRAY);

GL.glTranslate(...);
GL.glScale(...);

GL.glVertexPointer(...);
GL.glDrawArrays(...)

GL.glDisableClientState(GL.GL_VERTEX_ARRAY);

GL.glPopMatrix();
GL.glEnable(GL.GL_TEXTURE_2D);

So now I’m even more confused than before… Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:14:41+00:00Added an answer on June 14, 2026 at 4:14 am

    Found the problem:

    Apparently, one of the values passed to the glLineWidth was zero, which is not allowed.
    The first glGetError I used was after setting that value to zero was at the bind texture, so I thought it was related to that.

    I’m ashamed it took me that long to figure that out 🙂

    And I certainly need better OpenGL debugging tools – apparently GLIntercept could have detect it but didn’t, but since it was the only usable tool for me it had to do.

    Sorry I had to bother you all and thank you for your help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to create a spinning square inside of xcode using opengl but instead
I'm programming this game in OpenGL, mostly working inside an single EAGLView (I'm not
In the context of a Java/OpenGL application I am drawing a black wired only
I'm developing a simple IDE that has a embed, non-QT OpenGL renderer inside it.
I work on an MFC app containing OpenGL context.I am new to MFC that
I use openGl ES 2.0. When I load 3d model, it looks turned inside
Im getting this Error when loading an ESRI map inside the Android Environment. This
So when I create a new Qt project inside Qt Creator I'm only asked
I run openCL /openGL program which uses wxWidget as gui enviroment Inside object of
http://www.opengl.org/wiki/Rendering_Pipeline_Overview says that primitives that lie on the boundary between the inside of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.