I have no idea what is going on here, first, the code:
#pragma once
#include <stdio.h>
//#include <stdafx.h>
#include <allegro5/allegro.h>
//#include <allegro_image.h>
class DisplayController
{
public:
int bitmapx;
int bitmapy;
// ALLEGRO_DISPLAY display;
ALLEGRO_BITMAP *crosshairs;
ALLEGRO_EVENT ev;
ALLEGRO_EVENT_QUEUE *event_queue;
void display()
{
this->event_queue = al_create_event_queue();
al_register_event_source(event_queue, al_get_mouse_event_source());
al_wait_for_event(event_queue, &ev);
this->crosshairs = al_load_bitmap("crosshairs.bmp");
if(!crosshairs)
{
fprintf(stderr,"Bitmap is null!");
al_rest(2.0);
}
if(ev.type == ALLEGRO_EVENT_MOUSE_AXES || ev.type == ALLEGRO_EVENT_MOUSE_ENTER_DISPLAY)
{
bitmapx = (ev.mouse.x -60);
bitmapy = (ev.mouse.y -60);
al_draw_bitmap(crosshairs,bitmapx,bitmapy,0);
al_flip_display();
}
//al_rest(2.0);
}
bool mouseClicked()
{
if(ev.type == ALLEGRO_EVENT_MOUSE_BUTTON_UP)
{
return true;
}
else
{
return false;
}
}
void DisplayController()
{
//this->display = new ALLEGRO_DISPLAY;
this->bitmapx = 0;
this->bitmapy = 0;
}
void ~DisplayController()
{
}
};
So when I call that display function from main (objectName->display()), I get the private member error message, even though I've explicity stated that the function is public about 6 lines above! There's nothing in that class declared as private so why does the compiler seem to think it's private?