J
JoeC
I created a simple graphic and I store them in arrays of differnet
objects. I know that I am using windows libraries but my question has
nothing to do with that. Here is the heading of my graphic object:
#include<windows.h>
#include<iostream>
#include<string>
#ifndef GRAPHIC_H
#define GRAPHIC_H
class graphic{
int btmap;
int lr,ud; //Diminsion (size) of the graphic
HBITMAP hbitmap;
HDC hdc, hdcmem;
public:
graphic();
graphic(BYTE c[]);
void SetGr(BYTE c[]);
void display(HWND, int, int);
};
#endif
And I want to use my graphic here:
graphic gr;
for(int l2 = 0; l2 < num; l2++){
for(int l1 = 0; l1 < num; l1++){
gr = maze->display(l2, l1); //get the gr object from the
container
gr.display(hwnd, l1*spacing, l2*spacing);
//calls the display function from the graphic.
Basicaly I want to return the graphic from the container. Do I need a
copy constructor or to overload = operator or do I need a copy
constructor? Basically how do I get this to work or how could I do
this better.
objects. I know that I am using windows libraries but my question has
nothing to do with that. Here is the heading of my graphic object:
#include<windows.h>
#include<iostream>
#include<string>
#ifndef GRAPHIC_H
#define GRAPHIC_H
class graphic{
int btmap;
int lr,ud; //Diminsion (size) of the graphic
HBITMAP hbitmap;
HDC hdc, hdcmem;
public:
graphic();
graphic(BYTE c[]);
void SetGr(BYTE c[]);
void display(HWND, int, int);
};
#endif
And I want to use my graphic here:
graphic gr;
for(int l2 = 0; l2 < num; l2++){
for(int l1 = 0; l1 < num; l1++){
gr = maze->display(l2, l1); //get the gr object from the
container
gr.display(hwnd, l1*spacing, l2*spacing);
//calls the display function from the graphic.
Basicaly I want to return the graphic from the container. Do I need a
copy constructor or to overload = operator or do I need a copy
constructor? Basically how do I get this to work or how could I do
this better.