2 Questions ?
SetWindowText(hWnd, display)
This sets text to the window itself.
What is the command to display the text in the window?
#2
I'm trying to create some fog, and I get a list of errors.
When I try and write the fog start, fog end, fog thickness etc.
: error C2065: 'fogMode' : undeclared identifier
: error C2065: 'fogfilter' : undeclared identifier
: error C2109: subscript requires array or pointer type
: error C2501: 'glFogi' : missing storage-class or type specifiers
: error C2373: 'glFogi' : redefinition; different type modifiers
: see declaration of 'glFogi'
: error C2078: too many initializers
There are 4 like this.
I have no idea how to fix it either.
Please help,
BLades
#1: There is no equivalent SetXText command to display text within the window. Text inside a window is much more flexible than text in the titlebar and as a result there are several ways of doing it. See NeHe lessons #13, #14, #15 and #43.
#2: I think you need to take a step back here. It looks like you haven't gotten to grips with c++ coding. Might be an idea to take a break from OpenGL and brush up on the basics.
error C2065: 'fogMode' : undeclated identifier
fogMode is a variable. You need to declare it and define it before you can use it. The compiler is telling you that you're trying to use a variable before it has been declared.
error C2109: subscript requires array or pointer type
You must be trying to index into something that is not indexable. For example, the following code will probably produce this error:
You can only index into arrays (you can also index on a pointer, but only because C++ has no way of knowing that it isn't an array, and on an object which has overloaded operator[], but I wouldn't worry about that for now), i.e.:
error C2501: 'glFogi' : missing storage-class or type specifiers
I think by this point you've managed to confuse the compiler and it's totally lost the plot. Alternatively you might be trying to call glFogi from an invalid location.
If after looking through some C++ tutorials and getting to grips a bit more with the language you still have problems you can't fix then post some source code (using [code] tags for short code snippets and [source] tags for long code snippets).
Good luck,
Enigma
#2: I think you need to take a step back here. It looks like you haven't gotten to grips with c++ coding. Might be an idea to take a break from OpenGL and brush up on the basics.
error C2065: 'fogMode' : undeclated identifier
fogMode is a variable. You need to declare it and define it before you can use it. The compiler is telling you that you're trying to use a variable before it has been declared.
error C2109: subscript requires array or pointer type
You must be trying to index into something that is not indexable. For example, the following code will probably produce this error:
int unindexable;unindexable[0] = 1;
You can only index into arrays (you can also index on a pointer, but only because C++ has no way of knowing that it isn't an array, and on an object which has overloaded operator[], but I wouldn't worry about that for now), i.e.:
int* indexable1 = new int[1];indexable1[0] = 1;delete[] indexable1;int indexable2[1];indexable2[0] = 1;int* indexable3 = new int;indexable3[0] = 1;delete indexable3;
error C2501: 'glFogi' : missing storage-class or type specifiers
I think by this point you've managed to confuse the compiler and it's totally lost the plot. Alternatively you might be trying to call glFogi from an invalid location.
If after looking through some C++ tutorials and getting to grips a bit more with the language you still have problems you can't fix then post some source code (using [code] tags for short code snippets and [source] tags for long code snippets).
Good luck,
Enigma
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement