02-19-2005, 06:13 PM
Hey, I would like to know about freebasic with bitmap images, not .bmp files.
I remember some documents that cover read data statements to load a bitmap to the screen and also working with BLOAD and BSAVE to save the data to a file in binary form. I also remember that qbasic supported page filpping with screen mode 7 and screen mode 13 allowed higher possible colors with no page filpping.
After going over the graphics doc included with freebasic, I'm finding it a little hard to follow for this method of making Side Scrollers, RPGs, etc...has this way been tossed aside do to coding with DirectX and OpenGL?
With that being said, can freebasic allow you to do it the old way and if so, what changes do you need to make as a programmer to the code old code for it to compile correctly with fbc?
1: BLOAD and BSAVE an image file such as 10x10 with Read Data.
2: Which screen mode must be set and what information needs to be added for seting up the screen mode?
Then you would make another file, use the BLOAD to load that image.pix into memory and on to the screen etc...
My question is how do you convert this qb code to make it work on fbc?
Thanks...
I remember some documents that cover read data statements to load a bitmap to the screen and also working with BLOAD and BSAVE to save the data to a file in binary form. I also remember that qbasic supported page filpping with screen mode 7 and screen mode 13 allowed higher possible colors with no page filpping.
After going over the graphics doc included with freebasic, I'm finding it a little hard to follow for this method of making Side Scrollers, RPGs, etc...has this way been tossed aside do to coding with DirectX and OpenGL?
With that being said, can freebasic allow you to do it the old way and if so, what changes do you need to make as a programmer to the code old code for it to compile correctly with fbc?
1: BLOAD and BSAVE an image file such as 10x10 with Read Data.
2: Which screen mode must be set and what information needs to be added for seting up the screen mode?
Code:
qbasic code that worked
screen 13 '320x200
aSize = 10 * 10 / 2 + 1
dim image(aSize) as integer
x1=10
y1=10
'place bitmap on screen
for y = 1 to y1
for x = 1 to x1
read z
pset (x,y)z
next y
next x
'grab bitmap
get (1,1)-(10,10),image
bSize = 10 * 10 + 4
'save bitmap
DEF SEG = VARSEG(image(0))
bsave "image.pix", VARPTR(image(0)), bSize
Data "0,0,0,0,0,0,0,0,0,0" 'etc...10 across 10 down
....
....
....
Data "0,0,0,0,0,0,0,0,0,0"
Then you would make another file, use the BLOAD to load that image.pix into memory and on to the screen etc...
My question is how do you convert this qb code to make it work on fbc?
Thanks...