Mail Archives: djgpp/1997/04/28/20:14:24
> I'm pretty sure that the overhead of a virtual function call could cause
> you some problems. It's OK to use virtual function for setup or
> something but don't use it for putpixel or linedraw.
I have some quibbles related to this topic.
Okay I'm REALLY new to C++ (not C, just C++), so I'd like some hints from
experienced C++ people. I'm trying to code everything in C++ tradition
now (even though I'll probably only by writing game-type stuff) - since
it looks quite smart!
The way I was going to do it was to have a screen mode class for whatever
mode I'm in (just 320x200x256 to start with), with three private buffers
(for triple-buffering), but a public reference to the current buffer to
draw in. So it's just as quick as the best C equivalent for putpixel and
getpixel, and I can write seperately whatever line drawing routine I
want, but I can switch modes (VESA or whatever when I find out how it all
works!) completely independantly of the rest.
The screen mode class will do all the stuff like set up the screen
interrupt code and find the most recently draw screen to chuck on
0xa0000.
What I need to know (before I start on this daunting task), is whether
all of this is in C++ 'tradition' or whether I'm going to run into
trouble somewhere.
--
David Hampson
e-mail : ma6djh AT bath DOT ac DOT uk
Uni Page : http://www.bath.ac.uk/~ma6djh/
- Raw text -