Solved

Scrolling

Posted on 1997-09-22
5
261 Views
Last Modified: 2012-05-04
What is the best way to write a scrolling routine for Turbo/C.  Using the putpixel command gives me a frame rate of about 1 per sec. with a 166mmx.  Or, where is a good library collection for C where I might find such a routine.  My main interest is in DOS game programming.
0
Comment
Question by:jason_brown
5 Comments
 
LVL 3

Expert Comment

by:jaba
ID: 1255027
Did you try to move contents of the vido memory ? Its more fast method.
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1255028
You don't want to use putpixel because you're doing things one at a time. To optimize things, you want to do as much stuff in bigger blocks as possible. For example, instead of moving pixels, try moving entire lines. Another possibility is to use the hardware to your advantage. The VGA card has scrolling built-in. If you want to use this method, then you will need to look at any of the graphics book by Michael Abrash e.g. _Zen Of Graphics Programming_.

0
 

Author Comment

by:jason_brown
ID: 1255029
I would need more information about moving a whole line at once.  Do you mean as in redefining ascii characters and printing them or using a compression algorithym?  I just thought there might be  a nice routine that does it all for you without me having to know how to use dos calls and interupts.  I'm lazy in that way I guess, I would still like a URL of a good graphics library for TURBO C, though.
0
 
LVL 1

Accepted Solution

by:
navigator010897 earned 50 total points
ID: 1255030
There are a couple of good libraries you can use - one is FastGraph (there is a shareware fully functional version available) and there is another package by another group called Ground Up Software - their package Ground Up Graphics (GUG) is still available free (they also have a FANTASTIC audio package that I have messed around with - I Was very impressed) their site is:  http://www.groundup.com/gug.html

My strongest suggestion is to move to a 32bit compiler like Watcom.  It makes game programming 1000% simpler.  I did some scrolling code on my own, thought it out - and made it work almost on the first try (worked on the third) in 32 bit FLAT memory mode - never got it quite right in standard memory models.

I am not sure if GUG is 32 bit only - I've only looked at it a while back, and still have the notes on it.  

I do know - although FastGraph is a retail package (~250) - it is a fantastic package, will access Mode X, scrolling, super fast pixel blits to the screen, etc.  - I own this package, and I like it.

I have written stuff for Mode 13h (320x200) that has been pretty fast, and very smooth, but like I said before, scrolling only really worked well for me in 32bit flat mode when I was doing my own code.

That is the nice thing about FastGraph - it can do it without having Flat mode memory models - it actually re-shapes video memory so it is a bit bigger then the screen, and then uses page flipping to create ultra smooth - crisp scrolling effects.  You can get the persons book that includes the shareware version of FastGraph - it is called :  Action Arcade, it is written by Diana (I think is her first name, can't read the book this far away at the moment) Gruber (last name I am sure of) - it has tons of source and explanation on how to make the scrolling smooth.

If you want to do 13h scrolling in 32bit flat mode, and would like to see some code, I'd be happy to share as I am not a professional game programmer (just tinkered a little to see:)
0
 

Author Comment

by:jason_brown
ID: 1255031
Thanks for the encouragement.  I'll check out that library.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question