Mail Archives: djgpp/1999/07/26/09:50:24
How are u? hope all is ok! ;)
well... i am currently switching from C to C++! I
have a C program that i want to transform into
object-oriented approach! but i have one simple (I
hope! :)) question!
I had an .asm file compiled and linked with my
program! This file contained a function called
line()... here is its prototype...
void line(int x1,int y1,int x2,int y2,char color,void*
well... back is the back buffer.... and it is global!
line() was called from several other parts in my
program... (e.g. in gui.c and in main.c!)
well... now, to make it into object oriented, the
function line should be a member of the Class called
'screen'! the back buffer also should be a member of
the 'screen' Class...
So... where is the problem?
well... other objects (e.g. gui) should NOT have
access to the backbuffer data structure! OOP
principles are clear! Classes should never export data
structures! it should export a method to modify this
so... back will be hidden from other classes!! they
will not be able to call line()!
so... is there a way so that i can make the .asm file
*see* the member back of the Class called 'screen'? so
that it can modify it? line() is a member of the
class... but, how can i persuade the *assembler* (NASM
Any suggestions are welcome! Thanx in advance!
Mohamed El Dawy
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
- Raw text -