I've been stuck with this since last night, and for the life of me, I haven't been able to figure out why this is happening. I must be missing something very simple.
I'm making an OpenGL program. In this program, I'm making a DialogBox class. Below is the code:
//---------------------------------------------------------------
//DialogBox.h
//---------------------------------------------------------------
#include <vector>
class DialogBox
{
private:
float X; float Y; float Z;
float Width;
float Height;
float RED;
float GREEN;
float BLUE;
float ALPHA;
int currentLine;
int maxLines; //How many lines of text this dialog box can hold
int maxChars; //How many chars each line of text can hold
std::vector< std::vector<char> >Text; //Text contents of the Dialog Box
unsigned int vertexArray_DialogBox;
unsigned int vertexBuffer_DialogBox;
public:
DialogBox();
DialogBox(float width, float height);
void draw();
void draw(float x, float y, float z);
};
//------------------------------------------------------------------------
//DialogBox.cpp
//------------------------------------------------------------------------
#include <iostream>
#include "DialogBox.h"
DialogBox::DialogBox()
{
X = 0.0f; Y = 0.0f; Z = 0.0f;
Width = 1.0f;
Height = 1.0f;
RED = 0.0f;
GREEN = 1.0f;
BLUE = 1.0f;
ALPHA = 1.0f;
//For HELVETICA_18 ----------------------
static const float letter_width = 0.03f;
static const float letter_height = 0.04f;
static const float line_height = 0.1f;
//---------------------------------------
maxLines = Height / line_height - 4;
maxChars = Width / letter_width - 2;
Text.resize(maxLines);
for(int i = 0; i < maxLines; i++)
{
Text[i].resize(maxChars);
}
}
DialogBox::DialogBox(float width, float height)
{
Width = width;
Height = height;
//The rest of the initialization codes
}
void DialogBox::draw()
{
//OpenGL Drawing codes
}
void DialogBox::draw(float x, float y, float z)
{
X = x; Y = y; Z = z;
draw();
}
And the compiler threw this error message:
I have been pulling my hairs out, but I couldn't figure out what the compiler were referring to. It must be something really simple (like a typo in the codes or something like that). Thank you in advance for your help.