M
mickCyber
Hi
aren't those two pointers? What is my fault?
Thanks Michael
aren't those two pointers? What is my fault?
Thanks Michael
Hi
aren't those two pointers? What is my fault?
Thanks Michael
Thanks for further help
Without at least a few lines of the code that actually produces
the error message, further help will be more or less impossible.
However, as always, FAQ 5.8 applies.
What do you mean?
First error here in the code:
VertexTextureIndex *ret = malloc(sizeof(VertexTextureIndex));
Thanks Paul now i get three lines before end at:
Thanks Jonathan
changed the code a bit. Better so?
typedef struct {
void *VertexTextureIndexMakeEmpty(int x,int y);
void *VertexTextureIndexMake(int x, int y, int UINT_MAX);
GLuint originalVertex;
GLuint textureCoords;
GLuint actualVertex;
void *greater;
void *lesser;
VertexTextureIndex::VertexTextureIndexMake (GLuint inVertex, GLuint
inTextureCoords, GLuint inActualVertex)
//static inline VertexTextureIndex * VertexTextureIndexMake (GLuint
inVertex, GLuint inTextureCoords, GLuint inActualVertex)
{
VertexTextureIndex *ret = new VertexTextureIndex;
//1 VertexTextureIndex *ret = (VertexTextureIndex *)
malloc(sizeof(VertexTextureIndex));
//2 VertexTextureIndex *ret = malloc(sizeof(VertexTextureIndex));
ret->originalVertex = inVertex;
ret->textureCoords = inTextureCoords;
ret->actualVertex = inActualVertex;
ret->greater = NULL;
ret->lesser = NULL;
return ret;}
//#define VertexTextureIndexMakeEmpty(x,y) VertexTextureIndexMake(x, y,
UINT_MAX)
// recursive search function - looks for a match for a given combination
of vertex and
// texture coordinates. If not found, returns UINT_MAX
static inline GLuint VertexTextureIndexMatch(VertexTextureIndex *node,
GLuint matchVertex, GLuint matchTextureCoords)
{
if (node->originalVertex == matchVertex && node->textureCoords ==
matchTextureCoords)
return node->actualVertex;
if (node->greater != NULL)
{
GLuint greaterIndex = VertexTextureIndexMatch(node->greater,
matchVertex, matchTextureCoords);
----------
after the struct (next line) I get this error:
Multiple markers at this line
- Syntax error
- ISO C++ forbids declaration of ‘VertexTextureIndexMake’ with no type
- cannot define member function
‘OpenGLWaveFrontMaterial::VertexTextureIndex::VertexTextureIndexMake’
within
‘OpenGLWaveFrontMaterial’
Thanks Michael
pragma is C specific?
what about #define at the bottom?
I've commented
that line and defined in struct VertexTextureIndex. Correct? Well
later on I get an error that
"VertexTextureIndexMakeEmpty‘VertexTextureIndexMakeEmpty’ was not
declared in this scope"
Those structs are inside another class, ok in C++?
Thanks again
#pragma mark -
#pragma mark VertexTextureCombinations
#pragma mark -
struct VertexTextureIndex {
void *VertexTextureIndexMakeEmpty(int x,int y);
void *VertexTextureIndexMake(int x, int y, int UINT_MAX);
[snip]GLuint originalVertex;
GLuint textureCoords;
GLuint actualVertex;
VertexTextureIndex *greater;
VertexTextureIndex *lesser;
};
{
VertexTextureIndex *ret = new VertexTextureIndex; [snip]
ret->originalVertex = inVertex;
ret->textureCoords = inTextureCoords;
ret->actualVertex = inActualVertex;
ret->greater = NULL;
ret->lesser = NULL;
return ret;}
Many thanks Michael now it looks so:
-------
class VertexTextureIndex {
public:
VertexTextureIndex(GLuint inVertex, GLuint inTextureCoords, GLuint
UINT_MAX);
~VertexTextureIndex();
static VertexTextureIndex* MakeEmpty(GLuint x,GLuint y);
static VertexTextureIndex* Make(GLuint x,GLuint y,GLuint z);
// void *VertexTextureIndexMakeEmpty(int x,int y);
// void *VertexTextureIndexMake(int x, int y, int UINT_MAX);
GLuint originalVertex;
GLuint textureCoords;
GLuint actualVertex;
VertexTextureIndex *greater;
VertexTextureIndex *lesser;
};
VertexTextureIndex::VertexTextureIndex(GLuint inVertex, GLuint
inTextureCoords, GLuint inActualVertex = UINT_MAX);
{
originalVertex(inVertex);
textureCoords (inTextureCoords );
actualVertex ( inActualVertex );
greater();
lesser ();
}
[snip]
VertexTextureIndex* VertexTextureIndex::Make(GLuint inVertex, GLuint
inTextureCoords, GLuint inActualVertex)
{
------------
In the middle at: VertexTextureIndex::VertexTextureIndex I get:
cannot declare member function
‘OpenGLWaveFrontMaterial::VertexTextureIndex::VertexTextureIndex’ within
‘OpenGLWaveFrontMaterial’
and on the last line:
cannot define member function
‘OpenGLWaveFrontMaterial::VertexTextureIndex::Make’ within
‘OpenGLWaveFrontMaterial’
Many thanks again
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.