Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / lock pixels?

Author
Message
EvilKnuckles 666
20
Years of Service
User Offline
Joined: 23rd Jun 2003
Location:
Posted: 31st May 2004 01:36
What's this do? how exactly do you use it? Are there any examples or code snippets someone can send me?

http://esotericbasic.dbspot.com
Mentor
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 31st May 2004 11:55
lock pixels speeds up drawing and reading the screen in 2D, try this

sync on:sync rate 60:set text opaque
t=timer()
for i=1 to 400
for l=1 to 300
dot i,l
next l
next i
t=timer()-t
do
text 100,100,str$(t)
sync
loop

will display the time taken to fill a 400,300 box with pixels (120000 of them), then run this

sync on:sync rate 60:set text opaque
t=timer()
lock pixels
for i=1 to 400
for l=1 to 300
dot i,l
next l
next i
unlock pixels
t=timer()-t
do
text 100,100,str$(t)
sync
loop

and notice the slight time difference, don`t forget to unlock pixels after you have locked them though.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
EvilKnuckles 666
20
Years of Service
User Offline
Joined: 23rd Jun 2003
Location:
Posted: 31st May 2004 20:25
can u use that for placing images, writing text, or drawing boxes and stuff

http://esotericbasic.dbspot.com
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st May 2004 20:36
It speeds up access for dot, line, circle, and direct access to the bitmap that you lock.

Anything that is 3D accellerated is not sped up, and could cause a crash of your app. This covers box, images, sprites and 3D objects.

The ones that I don't know about are text and bitmap copies, so You'll need to try those yourself.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
EvilKnuckles 666
20
Years of Service
User Offline
Joined: 23rd Jun 2003
Location:
Posted: 31st May 2004 21:17 Edited at: 31st May 2004 21:18
i just tested it, it works to text and box too =)

or at least it doesn't crash the program, i don't know if it makes it faster of not..

http://esotericbasic.dbspot.com
Mentor
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 31st May 2004 23:29
it doesn`t make text any faster, boxes should be sped up though since they are a 2d drawing operation.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.
3ddd
20
Years of Service
User Offline
Joined: 14th Apr 2004
Location: Orlando, FL
Posted: 1st Jun 2004 19:04
Quote: "It speeds up access for dot, line, circle, and direct access to the bitmap that you lock."


So, would there be any benefit in using it if you are using the Paste Image and Sprite commands and not Line, Dot, Circle, etc?


He's evil, but, he'll die. I like it.

Login to post a reply

Server time is: 2024-05-19 08:43:58
Your offset time is: 2024-05-19 08:43:58