delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/28/20:14:24

Newsgroups: comp.os.msdos.djgpp
From: ma6djh AT bath DOT ac DOT uk (D J Hampson)
Subject: Re: Style AND speed in C++? How? Please, I need some radical ideas on this one!
Organization: School of Mathematical Sciences, University of Bath, UK
Message-ID: <E99Cn8.J2u.C.amo@bath.ac.uk>
References: <c=GB%a=_%p=Indigo_Active_Vi%l=CRIANLARICH-970421130655Z-367 AT crianlarich DOT Indigo>
<5ji1vt$51i AT info DOT service DOT rug DOT nl>
Mime-Version: 1.0
Date: Sat, 26 Apr 1997 18:28:20 GMT
Lines: 31
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019