Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (juanex, AndrewAMD), 988 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Creating a draw function like in paint #303480
12/29/09 09:25
12/29/09 09:25
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Hi,
One of our forummembers in our gamestudio community has a problem. I tried to solve it, but i have no clue why it doesnt work.

He's trying to create a paint-like draw function.
The problem: even with 500FPS(my own system) its not possible to draw a connected line while moving the mouse fast.

Code:
function malen() 
{ 
if(mouse_left || key_space) 
{ 
pixel = pixel_for_vec(vector(blau,gruen,rot),100,888); 
pixel_to_bmap(malbmp,mouse_cursor.x,mouse_cursor.y,pixel); 
draw_counter += 1;
if(draw_counter >= 500/25)
{
draw_counter = 0;
bmap_unlock(malbmp); 
wait(1);	
bmap_lock(malbmp,0); 
}
} 
}



I change dthe code so that the map is updatet only 25 times a second(500 is my system fps, i'll change the example to a flexible one as soon as it works)

mouse_sync is enabled, and still not possible. When moving the mouse very fast, it draws points here and there but not a connected line(at 500 FPS o.o)

Maybe someone knows how to improve.

Greets
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Creating a draw function like in paint [Re: Rackscha] #303699
12/31/09 16:27
12/31/09 16:27
Joined: Oct 2009
Posts: 149
Germany
M
muffel Offline
Member
muffel  Offline
Member
M

Joined: Oct 2009
Posts: 149
Germany
Der Trick an dieser Sache ist, dass man eine Linie zwischen der jetztigen und der letzten Maus Position zeichnet.

Frag mich, wenn du jetzt noch den Code brauchst oder etwas nicht verstehst.

Welche Community? Ist das eine Deutsche Community?

muffel

Re: Creating a draw function like in paint [Re: muffel] #303774
01/01/10 22:06
01/01/10 22:06
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Jop is ne deutsche(schau mal im pm kasten, weiß nicht wie hier die verlinkungsregeln sind),
Das mit dem linienzeichnen hatte ich ihm auch schon vorgeschlagen, allerdings wundere ich mich bei 500 FPS übe update rate der maus oder die anzahl der schreiboperationen in die bmap pro sekunde o.O. Besonders da ha per hardware cursor die position MEHRMALS pro frame geupdatet werden soll ?!


MFG
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development


Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1