Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Soft corners

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Soft corners
CodeStepper
Member #14,495
August 2012
avatar

Is there any way to soft primitives corners?
For example:

Rounded rectangle:

al_draw_filled_rounded_rectangle( 100, 100, 400, 250, 20, 20, al_map_rgb( 90, 60, 90 ) );

Triangle ( hmm... )

al_draw_filled_triangle( 100, 50, 50, 150, 150, 200, al_map_rgb( 90, 60, 90 ) );

Circle ( there are no corners, but... :P )

al_draw_filled_circle( 100, 100, 80, al_map_rgb( 90, 60, 90 ) );

Like antyaliasing or something like this

Trent Gamblin
Member #261
April 2000
avatar

Multisampling. Before you create your display make calls like:

al_set_new_display_option(ALLEGRO_SAMPLE_BUFFERS, 1, ALLEGRO_SUGGEST);
al_set_new_display_option(ALLEGRO_SAMPLES, 4, ALLEGRO_SUGGEST);

CodeStepper
Member #14,495
August 2012
avatar

Thank you :)

EDIT:
------------------------------------
WoW!
I just installed Windows 8, and this not working!

What the...
I try with ALLEGRO_REQUIRE, but it's not working too...

LennyLen
Member #5,313
December 2004
avatar

Just be careful with drawing rounded corners on rectangles. If your game becomes successful, Apple may sue you.

CodeStepper
Member #14,495
August 2012
avatar

What has Apple to rounded corners?

Thomas Fjellstrom
Member #476
June 2000
avatar

What has Apple to rounded corners?

They have a patent on rounded rectangles.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

CodeStepper
Member #14,495
August 2012
avatar

So what about multisampling, why it doesn't work :/

Matthew Leverton
Supreme Loser
January 1999
avatar

Are you drawing to the display back buffer directly?

CodeStepper
Member #14,495
August 2012
avatar

Before creating display

...
al_set_new_display_option(ALLEGRO_SAMPLE_BUFFERS, 1, ALLEGRO_SUGGEST);
al_set_new_display_option(ALLEGRO_SAMPLES, 4, ALLEGRO_SUGGEST);

ALLEGRO_DISPLAY *display = al_create_new_display( 800, 600 );
...

EDIT:
Sorry, i missunderstood youd question :D
Yes, i'm drawind directly...

But in windows 7 everything is ok... Grr...

Arthur Kalliokoski
Second in Command
February 2005
avatar

nvmnd

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

CodeStepper
Member #14,495
August 2012
avatar

I tried:

I try with ALLEGRO_REQUIRE, but it's not working too...

Neil Roy
Member #2,229
April 2002
avatar

LennyLen said:

Just be careful with drawing rounded corners on rectangles. If your game becomes successful, Apple may sue you.

LMAO... what an insane world we live in.

Arthur Kalliokoski
Second in Command
February 2005
avatar

They need to sue MS for their use of rounded corners in Microsoft Bob.

{"name":"bobgay.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/5\/f5f86279813bf559ee5270534e8fccfb.gif","w":351,"h":310,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/5\/f5f86279813bf559ee5270534e8fccfb"}bobgay.gif

[EDIT]

From the same website, it says Apple sued Digital Research for look and feel concerning GEM 1.1 back in 1985.

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

CodeStepper
Member #14,495
August 2012
avatar

Ops... what a mess :-/

I don't do from now any programs with rounded corners in rectangles o.O

Arthur Kalliokoski
Second in Command
February 2005
avatar

I seriously doubt Apple would mess with small fry like us.

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

Thomas Fjellstrom
Member #476
June 2000
avatar

Technically the patent they have is on the shape of the ipad and iphone. Not on rounded rectangles in software.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Arthur Kalliokoski
Second in Command
February 2005
avatar

Back on the farm we had a stove from the '50's that had rounded corners all over the place. :P "Streamlined", they called it, even though it didn't move.

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

Matthew Leverton
Supreme Loser
January 1999
avatar

They have a patent on rounded icons aligned in a grid:

http://www.google.com/patents/USD604305

Dizzy Egg
Member #10,824
March 2009
avatar

I love it when the 'graphics department' (hmm) at j0rb do me a border with rounded rectangles. It's clear to me but so, so painfully unclear to them that selecting a rounded-rectangle in photoshop and dragging the horizontal twice as far as the vertical, then doing so but smaller to create and edge will result in horrid, out of shape corners. I'm not sure why that's relevant. I guess I want to say F**K YOU to my graphics department on a platform they won't ever visit.

So F**K YOU, useless tossers. I could do your job in 1/8th of the time, with superior results. So there.

Phew. Now, where am I....

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

Arthur Kalliokoski
Second in Command
February 2005
avatar

Dizzy Egg said:

selecting a rounded-rectangle in photoshop and dragging the horizontal twice as far as the vertical, then doing so but smaller to create and edge will result in horrid, out of shape corners.

Couldn't they just select a middle part of the rectangle and stretch that?

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

Dizzy Egg
Member #10,824
March 2009
avatar

Yeah, I know, I know...

...trust me, I know.

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

Neil Roy
Member #2,229
April 2002
avatar

They have a patent on rounded icons aligned in a grid:http://www.google.com/patents/USD604305

Who the hell are handing out such bogus patents?! That's crazy. Most of the things listed there are so generic it's not funny.

Like:

Aug 23, 1994	Sep 10, 1996	Prosoft Corporation	Windowed computer display

in 1994?! Seriously?! When the Commodore Amiga was out with an all window display, heck so was Windows, all before 1994. O.o

I would ignore the patents, fuck 'em. That would be my response as well. I'm not wealthy so I have zip to lose. I'm making rounded corners just out of spite now! ;)

Matthew Leverton
Supreme Loser
January 1999
avatar

They patent everything and see what sticks. If you had money, you could too.

e.g., The gap I display between your last read post and the next one would be filed away as a great invention.

Neil Roy
Member #2,229
April 2002
avatar

e.g., The gap I display between your last read post and the next one would be filed away as a great invention.

I know I am always amazed at that gap. How you ever came up with such a genius idea is beyond the comprehension of this mere mortal. :o

Johan Halmén
Member #1,550
September 2001

Isn't the rounded corner a design thing? Such things should not need to be patented. It's kind of art work and is as such protected as soon as the artist has created the art work. I mean' this would put everything in right perspective.

Here:
{"name":"interface-msw103.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/6\/d65b06ee6f378a4679a9ffa62c5e65db.jpg","w":500,"h":273,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/6\/d65b06ee6f378a4679a9ffa62c5e65db"}interface-msw103.jpg

{"name":"img_02.gif","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/1\/6128bc6e33c1286afbcb2837bf06ecc9.gif","w":523,"h":369,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/1\/6128bc6e33c1286afbcb2837bf06ecc9"}img_02.gif

Two interfaces with rounded buttons. One wouldn't say that one is stolen from the other. There's more to it than only the rounded corners.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

 1   2 


Go to: