|
-
Oct 17th, 2001, 02:13 AM
#1
Thread Starter
Fanatic Member
OpenGL? 
But seriously, you could try to do it with BitBlt or something, but I don't think it's fast enough for fullscreen tiled games. If you really want fast (and I know you don't want to hear this), try learning DirectX. For 2D, I still recommend DX7. It's a bit though when starting, but once you get to know it a little better, it's easy (and fast ). In case you haven't heard of it yet, go to http://www.vbexplorer.com/directx4vb/, it's a great source of information.
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Oct 17th, 2001, 10:23 PM
#2
Member
All right, I'll check into that website and give a try to Directx...
And I have a question about BitBlt, too. I began toying with it a few days ago, and it does the job all right, with the mask and everything... But when I tried, the source picture needed to be on the screen, or else the destination pic would show just like the original... Can't I make that original invisible? There has to be a way...
- Dr. Cossack
Interordi.com: Internet tools, programming, games, and more!
-
Oct 18th, 2001, 02:32 AM
#3
Thread Starter
Fanatic Member
Did you set AutoRedraw on the PictureBox to true? I think that solves the problem...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Oct 18th, 2001, 05:10 AM
#4
transcendental analytic
Store the scroll offset vector,
in redraw routine inlcude the scroll offset, by in nested loops increment tile and screen offsets starting from scroll offset ending at scrolloffset + screen offset (assuming scrolloffset is in pixels, otherwyas it's tileoffset)after inner loop, reset inner loop increment to scrolloffset component
in the input routine (mouse or keyboard) add an offset to the scroll vector.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 18th, 2001, 10:35 PM
#5
Member
PsychoMark: Thanks, that did the trick. I completely forgot about that option...
kedaman: Err, what are you talking about? I don't understand...
- Dr. Cossack
Interordi.com: Internet tools, programming, games, and more!
-
Oct 18th, 2001, 10:44 PM
#6
Good Ol' Platypus
Err, what are you talking about? I don't understand...
It's kedaman what do you expect?
But if you looked at it and read it through maybe once or twice, he's giving you an alternate solution for your problem (I think...)!
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Oct 19th, 2001, 01:11 AM
#7
transcendental analytic
alternative?
I thought you wanted some fundamentals of scrolling...
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 20th, 2001, 06:31 PM
#8
Frenzied Member
All right, I had a simple tile engine in DX running at about 60 FPS, and after using this technique, it ran at 800 FPS!!! 
VB Code:
Dim TileX as Long, TileY as Long
TileX = 0
TileY = 0
For X = 0 To 19
For Y = 0 To 14
'Here, the coordinates where you should blt to are NOT X*TileWidth and Y*TileHeight, but TileX and TileY. In this example, you're avoiding 600 multiplications with additions so it's a LOT faster :)
TileY = TileY + TileHeight
Next Y
TileX = TileX + TileWidth
TileY = 0
Next X
Try it, maybe the FPS won't be the same, but it will at least be 1000% faster than the old method
-
Oct 20th, 2001, 06:40 PM
#9
transcendental analytic
Originally posted by Jotaf98
All right, I had a simple tile engine in DX running at about 60 FPS, and after using this technique, it ran at 800 FPS!!! 
VB Code:
Dim TileX as Long, TileY as Long
TileX = 0
TileY = 0
For X = 0 To 19
For Y = 0 To 14
'Here, the coordinates where you should blt to are NOT X*TileWidth and Y*TileHeight, but TileX and TileY. In this example, you're avoiding 600 multiplications with additions so it's a LOT faster :)
TileY = TileY + TileHeight
Next Y
TileX = TileX + TileWidth
TileY = 0
Next X
Try it, maybe the FPS won't be the same, but it will at least be 1000% faster than the old method
ewww
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 20th, 2001, 07:03 PM
#10
Frenzied Member
Is it sarcasm I'm smelling?...
-
Oct 20th, 2001, 07:11 PM
#11
transcendental analytic
Originally posted by Jotaf98
Is it sarcasm I'm smelling?...
of course but never mind, there was a time when i did it that way too, but that was way back in the 90's
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 20th, 2001, 07:20 PM
#12
Frenzied Member

What do you mean? How do you make it now?...
-
Oct 20th, 2001, 10:22 PM
#13
Member
Hey, I'm still at that level of programming, okay?
Jotaf98, can you just give me a sample of the BitBlt line that goes with that code? I want to make sure I'm not doing something bad :P
- Dr. Cossack
Interordi.com: Internet tools, programming, games, and more!
-
Oct 21st, 2001, 05:26 PM
#14
Frenzied Member
-
Oct 23rd, 2001, 02:47 PM
#15
Member
All right Jotaf, I tried it today, and it worked pretty well The basic engine still isn't complete, so I can't tell how fast it will be at the end, but it does a decent job. Thanks
- Dr. Cossack
Interordi.com: Internet tools, programming, games, and more!
-
Oct 23rd, 2001, 02:58 PM
#16
Frenzied Member
You're welcome
-
Oct 24th, 2001, 02:37 PM
#17
Hyperactive Member
your first question..
Code:
Private Sub Picture1_MouseDown(X...)
Picture1.PlacePicture Image1.Picture, X, Y
End Sub
This is just a quick version, Image1 holds the tile. Also, make sure that AutoRedraw is True for Picture1.
[vbcode]
' comment
Rem remark
[/vbcode]
-
Oct 24th, 2001, 05:22 PM
#18
Frenzied Member
That's for VB.Net, right?
-
Nov 26th, 2001, 11:37 PM
#19
Hyperactive Member
Originally posted by Jotaf98

What do you mean? How do you make it now?...
This post above was directed to Kedaman..
i'd like to hear the answer, too
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|