?
Solved

Scrolling

Posted on 1997-09-22
5
Medium Priority
?
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 100 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

762 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