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 7003127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:01:19+00:00 2026-05-27T21:01:19+00:00

I have the following header file: #ifndef CLASSES_H #define CLASSES_H class Mouse // Handles

  • 0

I have the following header file:

#ifndef CLASSES_H
#define CLASSES_H

class Mouse // Handles clicking of the mouse

{

private:



public:

Mouse()
{

    // Constructor

}

void handle_input(int x, int y) // Takes arguments of xloc and yloc of the mouse          pointer
{



}

};

class Game_Grid

{

private:



public:



};

class Red_Jewel // Is a circle shape

{

private:

int offset;

public:

Red_Jewel(int offset)
{

    this -> offset = offset;

}

void draw()
{

    glColor(256,0,0); // Red


}

};

class Green_Jewel // Is a triangle shape

{

private:

int offset;

public:

Green_Jewel(int offset)
{

    this -> offset = offset;

}

void draw()
{

    glColor(0,256,0); // Green

}

};

class Blue_Jewel // Is a square shape

{

private:

int offset;

public:

Blue_Jewel(int offset)
{

    this -> offset = offset;

}

void draw()
{

    glColor(0,0,256); // Blue

}

};

// Define objects here; circle jewel, triangle jewel, square jewel, the game grid

#endif // CLASSES_H

which is being included in a .cpp main file that has the following inclusions:

#include <SDL/SDL.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "classes.h" // objects within the game
#include <iostream>

The use of glColor() in the header file is giving me “Was not declared in this scope” error even when I include all of the above headers in the header file. I have never experienced this before and don’t know why I am getting the errors.

Thanks for any and all help!

  • 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-05-27T21:01:20+00:00Added an answer on May 27, 2026 at 9:01 pm

    The call you are looking for is glColor3ub(255,0,0); not glColor(255,0,0);

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

Sidebar

Related Questions

I have the following C++-class: // Header-File class A { public: A(); private: B
I have the following header file: #ifndef DATABASE_H #define DATABASE_H #include <vector> #include <iostream>
If I have the following in a header file: Foo.h Foo { public: static
I have the following in header file. namespace silc{ class pattern_token_map { /* Contents
Consider the following header file example: shared_example.h #ifndef SHARED_EX #define SHARED_EX const int Shared_Int
I have C header file containing the following type definition: // example.h typedef struct
Let's say I have the following HTML: <table id=foo> <th class=sortasc>Header</th> </table> <table id=bar>
All, i have the following model defined, class header(models.Model): title = models.CharField(max_length = 255)
I have created UITableCellView class called NoteCell . The header defines the following: #import
I have the following chunk of a header file BKE_mesh.h: /* Connectivity data */

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.