Jump to content

Additional 2d Drawing Commands


Einlander
 Share

Recommended Posts

I would like something like Context::DrawPoly( {table of Vec2()} )

 

While doing the 2d drawing, I found that using a scanline fill will IMMENSELY cripple the engine. if you scan-line draw (line by line) 3 squares on screen, you can see an fps drop from 200fps down to 40. and about 7fps if you use debug.

 

This would help reduce the amount of code needed for gui libraries, and help raise the fps count.

  • Upvote 1
Link to comment
Share on other sites

Not sure if I follow... Are taking about filled rectangles? Its already possible with Context::DrawRect(int x, int y, int width, int height, int style=0). 1 should draw a filled rect.

Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)

Link to comment
Share on other sites

This find and conversion from Einlander seems to work just fine in Leadwerks: http://www.leadwerks.com/werkspace/topic/11746-2d-polygon-fill/

 

post-14-0-54018200-1423184883.jpg

 

Edit - I see what Einlander is referring to - as you draw multiples it will drop the framerate significantly, but maybe not surprising as there are multiple loops occuring for each 'polyfillcontex' command. Granted if i wanted a star to be rendered i would just have an image drawn to a quad as it would be extremely cheap compared to any other method.

  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...