By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,706 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,706 IT Pros & Developers. It's quick & easy.

class attribute problem

P: n/a
Hello!

I am trying to implement a simple class attribute which worked a
thousand times before but now it fails everytime.

I have a class like this:

class OpenGLWidget :public QGLWidget{
Q_OBJECT
private:
...
GLuint fboID;
...
}

in the constructor I simply set this->fboID=0;

later I try to execute this statement:

static GLuint fbo=0;
glGenFramebuffersEXT(1,&fbo);
this->fboID=fbo;

unfortunately the debugger tells me that fbo becomes 1 (which is
perfectly fine) but fboID stays 0. any suggestions?

cheers,

david
Oct 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"David Zellhoefer" <d.**********@fhtw-berlin.de> wrote in message
news:3r************@news.dfncis.de...
Hello!

I am trying to implement a simple class attribute which worked a thousand
times before but now it fails everytime.

I have a class like this:

class OpenGLWidget :public QGLWidget{
Q_OBJECT
private:
...
GLuint fboID;
...
}

in the constructor I simply set this->fboID=0;

You should generally prefer a constructor initialization list to assignment
in the constructor.
later I try to execute this statement:

static GLuint fbo=0;
glGenFramebuffersEXT(1,&fbo);
this->fboID=fbo;

unfortunately the debugger tells me that fbo becomes 1 (which is perfectly
fine) but fboID stays 0. any suggestions?


There's really not enough info here to go on. Can you provide more of the
code, especially the context [i.e., method] where these three lines reside?

Perhaps your debugger is seeing a different fboID? Or a different fbo? You
might try using some kind of output statement instead of relying on the
debugger. (BTW, why are you prefacing assignments to fboID with "this."?
Just a style thing?)

-Howard

Oct 19 '05 #2

P: n/a

"Howard" <al*****@hotmail.com> wrote in message
news:jUr5f.461098$5N3.192664@bgtnsc05-
(BTW, why are you prefacing assignments to fboID with "this."? Just a
style thing?)


(Typo...Naturally, I meant "this->" in that question.)

-Howard

Oct 19 '05 #3

P: n/a
Howard wrote:
"David Zellhoefer" <d.**********@fhtw-berlin.de> wrote in message
news:3r************@news.dfncis.de...
Hello!

I am trying to implement a simple class attribute which worked a thousand
times before but now it fails everytime.

I have a class like this:

class OpenGLWidget :public QGLWidget{
Q_OBJECT
private:
...
GLuint fboID;
...
}

in the constructor I simply set this->fboID=0;

You should generally prefer a constructor initialization list to assignment
in the constructor.

later I try to execute this statement:

static GLuint fbo=0;
glGenFramebuffersEXT(1,&fbo);
this->fboID=fbo;

unfortunately the debugger tells me that fbo becomes 1 (which is perfectly
fine) but fboID stays 0. any suggestions?

There's really not enough info here to go on. Can you provide more of the
code, especially the context [i.e., method] where these three lines reside?

Perhaps your debugger is seeing a different fboID? Or a different fbo? You
might try using some kind of output statement instead of relying on the
debugger. (BTW, why are you prefacing assignments to fboID with "this."?
Just a style thing?)

-Howard


well, the problem is solved. it was more a problem of my debugger that
didn't update the values or maybe my compiler that wrote the values
later on. no idea. but it works now although i cannot rely on the
debugger. thanks anyhow!

david
Oct 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.