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.

AppGameKit Classic Chat / Antialiased draw commands

Author
Message
Jambo B
14
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 6th Jan 2018 14:43
Hi all,

I'm trying to use the drawbox command to draw a graph, unfortunately the draw commands don't seem to antialias and therefore the lines/boxes look different depending on the size of the window (see pic attached).

Is there any way to antialias the lines to improve how this looks?

Thanks as always for any help.

James

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 6th Jan 2018 14:48
Doesnt setantialiasmode do anything for you?

Do you have a sample so can see something in action
Jambo B
14
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 6th Jan 2018 15:05
Hadn't seen setantialias mode before! Unfortunately it doesn't seem to affect the drawing commands.
puzzler2018
User Banned
Posted: 6th Jan 2018 15:24
This command only applies to the back buffer, so maybe use swap, render commands with draw commands together with this command

Ill do some testing
Jambo B
14
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 6th Jan 2018 15:54
Thanks, Puzzler2018.

Here's some code:



James
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 6th Jan 2018 18:07 Edited at: 6th Jan 2018 18:31
2 things...

1) You could just use the DrawLine command then your graph lines will be one pixel wide regardless of the window resizing.

2) The draw commands dont antialias. They draw whole pixels only.
You can render to a Render image and then scale that to the screen so that antialiasing is done for you though.
Like this....

but that involves creating a render image of a fixed size (Eg..1024x1024 in the image above) then displaying that on a sprite on the resized window


Also: Your using integers I think?? So your calculations for iIncrement might get truncated if you change your constants so they arent easily divisible. Floats might be good here.
Jambo B
14
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 6th Jan 2018 20:14
Bengismo - great idea using the render image - I'll try that, thanks very much!

James

Login to post a reply

Server time is: 2024-04-25 00:59:53
Your offset time is: 2024-04-25 00:59:53