Allegro.cc - Online Community

Allegro.cc Forums » The Depot » OpenLayer 1.8 Released

Credits go to Arvidsson, Bob, Carrus85, Chris Katko, Edward Sheets, Evert, FMC, fuzinavl, Hrvoje Ban, juvinious, kazzmir, Krzysztof Kluczek, Mandrake Root Produc, Mark Oates, Mika Halttunen, miran, Mordredd, Phr00t, Rampage, ReyBrujo, Richard Phipps, Sepiroth, Thomas Fjellstrom, Tobi Vollebregt, Ultio, and Zaphos for helping out!
This thread is locked; no one can reply to it. rss feed Print
OpenLayer 1.8 Released
juvinious
Member #5,145
October 2004
avatar

Putting this up on CVS, since you have a SF page for it, would help others assist you in development and adding features. They can submit patches, which you can review and test and then append them to the current cvs. SF also provides a means for bug reporting which can assist you in problem tracking, monitoring, and prioritizing.
Moving your page to openlayer.sf.net is allot easier to remember as well. ;P
For more info on using and setting up cvs on SF here is a link:
CVS
It would be great to see this progress to where we can just download the source and compile with current libs, thus getting rid of the need to re-distribute other libs.

__________________________________________
Paintown

fuzinavl
Member #4,105
December 2003
avatar

There's lite and full OL versions ( source with and without libs ).

Precompiled libs are so easy though. If I had to compile 6 support libraries, I wouldn't touch openlayer.

Sin & Cos tables (8192 elements each) would speed up circle drawing, but the extra logic required might make the code less maintainable. :-/
I wouldn't change the interface; just have the inner workings use tables.
1600x1200 resolution
1600+1200+1600+1200-4 = 5594 perimeter pixels < 8192 elements

calculating dA for ellipses: I'd calculate it from the longer side because a thin, 3 pixel wide ellipse would become very short (when it should be long)
Or... render 90 degrees of the ellipse at a time if calculating dA from the short side.

linelistGradient direction: Would the
direction of the gradient be across it's thickness (for curved lasers and whatnot), or
along it's length with a color info array (for movement trails, etc.) ?
Or 2 versions of the function?

redundant function removal:
Disk replaces CircleOutline?
LineList replaces PolygonOutline?

arc prototype-proposal revision:

Slice        ( x, y, radius, color, start_angle, end_angle, accuracy );
SliceGradient( x, y, radius, innerCol, outerCol, start_angle, end_angle, accuracy );
Arc          ( x, y, inner_rad, outer_rad, color, start_angle, end_angle, accuracy );
ArcGradient  ( x, y, inner_rad, outer_rad, innerCol, outerCol, start_angle, end_angle, accuracy );

Maybe just let ArcGradient(); Cover them all

__________________________
fuzinavl@hotmail.com (Pittsburgh)
__http://fuzinavl.tripod.com/__

Carrus85
Member #2,633
August 2002
avatar

Precompiled libs are easy, UNLESS you happen to want to compile the library using a newer patched version of a library...

On a serious note, it would probably be a bit more prudent to supply the precompiled version of the library seperately, and allow persons to download and compile the program and all of the libraries themselves if they so desire.

FMC
Member #4,431
March 2004
avatar

Great work :)

I've read the thread and it seems this didn't come out: could you add a directory with examples(much like allegro)?

[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites]
Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

I've read the thread and it seems this didn't come out: could you add a directory with examples(much like allegro)?

Actually I said I'm writing a series of simple demos, which are quite like the examples in Allegro ;) I've actually posted one of them in this thread.

Quote:

redundant function removal:

I don't think I'm going to remove those. Actually a lot of rendering functions would benefit from LineLists and CircleOutline does in fact use Disk.

Quote:

Or 2 versions of the function?

That's probably the best way.

Quote:

calculating dA for ellipses:

This calls for some testing. I could also use something like the average as well. Also, there's a minium dA set already such that very small primitives wouldn't look ugly.

Quote:

arc prototype-proposal revision:

Yeah, I like that one better. Though I'll change the argument names to upperCaseNotation. ;)

Quote:

Sin & Cos tables (8192 elements each) would speed up circle drawing

With today's hardware I'm not that sure. For some reason I've never been too fond of sin/cos lookup tables.

Quote:

Putting this up on CVS, since you have a SF page for it, would help others assist you in development and adding features. They can submit patches, which you can review and test and then append them to the current cvs.

Sounds good, I already signed up to the system. Now I'll just have to find out the best way to add the files there.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

FMC
Member #4,431
March 2004
avatar

Quote:

Actually I said I'm writing a series of simple demos, which are quite like the examples in Allegro I've actually posted one of them in this thread.

Err... i did say it SEEMS :P
Great work :)

[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites]
Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain

fuzinavl
Member #4,105
December 2003
avatar

Quote:

Or 2 versions of the linelistGradient function?
That's probably the best way.

Now that I think about it, curved lasers are a very specific case.
Coders could support them themselves with gradient polygons or multiple linelists:
first linelist blue thickness 5
then linelist lightblue thickness 3
finally linelist white thickness 1

So... the more important LineListGradient version would receive an array of color data. Another candidate for templates?

I know I'm getting fussy about minimizing the number of functions available. I just don't want to see openlayer get bloated and confusing. Just clean and simple like it is now. :)

gfx.CircleOutline( 400.0, 300.0, 280.0, Rgba::BLUE, 35.0); :D:D

__________________________
fuzinavl@hotmail.com (Pittsburgh)
__http://fuzinavl.tripod.com/__

Tobi Vollebregt
Member #1,031
March 2001

Quote:

Quote:
Sin & Cos tables (8192 elements each) would speed up circle drawing
With today's hardware I'm not that sure. For some reason I've never been too fond of sin/cos lookup tables.

It doesn't make sense to add lookup tables IMHO. If you really care about speed you put the circle in a display list and resize it using matrix scaling operations.

You could even create an array of display lists for different levels of detail.

________________________________________
website || Zipfile reader @ Allegro Wiki || Download zipfile reader

fuzinavl
Member #4,105
December 2003
avatar

ArcGradient ;D WORKS!!!!!!!!!!!!!

1void GfxRend::ArcGradient( float x, float y, float innerRad, float outerRad, Rgba innerCol,
2 Rgba outerCol, float startAngle, float sweepAngle, float accuracy ) {
3 
4 glDisable( GL_TEXTURE_2D );
5
6 float da = GetAngleIcrement( outerRad, accuracy );
7
8 //Under OL 1.82, " - sweepAngle" fixes reversed angle direction
9 float endAngle = startAngle - sweepAngle;
10 
11 float temp;
12 if(endAngle < startAngle){
13 temp = startAngle;
14 startAngle = endAngle;
15 endAngle = temp;
16 }
17
18 glBegin( GL_QUADS );
19 float prevIX = x + cos(startAngle) * innerRad;
20 float prevIY = y + sin(startAngle) * innerRad;
21
22 float prevOX = x + cos(startAngle) * outerRad;
23 float prevOY = y + sin(startAngle) * outerRad;
24
25 for( float a = startAngle; a < endAngle; a += da ) {
26 float cosa = cos(a);
27 float sina = sin(a);
28
29 float newIX = x + cosa * innerRad;
30 float newIY = y + sina * innerRad;
31
32 float newOX = x + cosa * outerRad;
33 float newOY = y + sina * outerRad;
34
35 innerCol.Select();
36 glVertex2f( newIX, newIY );
37 glVertex2f( prevIX, prevIY );
38
39 outerCol.Select();
40 glVertex2f( prevOX, prevOY );
41 glVertex2f( newOX, newOY );
42
43 prevIX = newIX;
44 prevIY = newIY;
45
46 prevOX = newOX;
47 prevOY = newOY;
48 }
49
50 innerCol.Select();
51 glVertex2f( x + cos(endAngle) * innerRad, y + sin(endAngle) * innerRad);
52 glVertex2f( prevIX, prevIY );
53
54 outerCol.Select();
55 glVertex2f( prevOX, prevOY );
56 glVertex2f( x + cos(endAngle) * outerRad, y + sin(endAngle) * outerRad);
57 glEnd();
58
59 if( Settings::TextureMappingUsed() )
60 glEnable( GL_TEXTURE_2D );
61 
62} // (yay)

__________________________
fuzinavl@hotmail.com (Pittsburgh)
__http://fuzinavl.tripod.com/__

Fladimir da Gorf
Member #1,565
October 2001
avatar

Heh, thanks for the code! Like I said it's no job to modify the existing functions to get the Arc functions ;)

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Quote:

glBegin( GL_QUADS );

You'd get better performance using GL_TRIANGLE_STRIP. :)

Fladimir da Gorf
Member #1,565
October 2001
avatar

I've heard that before but that sounds pretty strange - if using a triangle srip is faster then why doesn't OpenGL replace the quads with triangle strips?

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Quote:

I've heard that before but that sounds pretty strange - if using a triangle srip is faster then why doesn't OpenGL replace the quads with triangle strips?

Actually, I meant rendering entire arc as single triangle strip (or quad strip). This way you have to specify only half of vertexes. I've heard about triangle strips being faster than quads, but I haven't checked this personally. :)

Fladimir da Gorf
Member #1,565
October 2001
avatar

Yeah of course. Why didn't I think of that...

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Mika Halttunen
Member #760
November 2000
avatar

Actually, I think that a triangle strip is faster than the corresponding quad. IIRC, the drivers apparently convert them automatically, but that's not happening on older cards I'd assume. Not that I have measured this personally either :D I've just always used triangle strips, just in case :)

---------------------------------------------
.:MHGames | @mhgames_ :.

Bob
Free Market Evangelist
September 2000
avatar

Quote:

You'd get better performance using GL_TRIANGLE_STRIP.

How so?

--
- Bob
[ -- All my signature links are 404 -- ]

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Quote:

How so?

He is drawing quad strip using GL_QUADS, so he is passing middle vertexes two times each.

+--+ +--+ +--+
|  | |  | |  |
+--+ +--+ +--+

vs.

+--+--+--+
|  |  |  |
+--+--+--+

If it's CPU or AGP-limited, it's going to be faster, isn't it? :)

Fladimir da Gorf
Member #1,565
October 2001
avatar

I'm almost finished with the next release. Now all it needs is some throughout testing (once again ;))

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Bob
Free Market Evangelist
September 2000
avatar

Quote:

He is drawing quad strip using GL_QUADS, so he is passing middle vertexes two times each.

Sure, but then just use quad strips. No need to rework the code to work with triangle strips.

--
- Bob
[ -- All my signature links are 404 -- ]

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Quote:

Sure, but then just use quad strips. No need to rework the code to work with triangle strips.

Wouldn't triangle strip use exactly the same vertex order as quad strip? :)

Chris Katko
Member #1,881
January 2002
avatar

Quote:

Sin & Cos tables (8192 elements each) would speed up circle drawing, but the extra logic required might make the code less maintainable. :-/

I'm 99% sure that it'd be slower. Unless it's cached, a memory lookup would be bad in most occurances. Just for example, my DDR runs at 133/266mhz compared to 1600mhz on my CPU.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Bob
Free Market Evangelist
September 2000
avatar

Quote:

Wouldn't triangle strip use exactly the same vertex order as quad strip?

I guess it doensn't matter if you don't use line mode rendering, stipple or edge flags.

--
- Bob
[ -- All my signature links are 404 -- ]

fuzinavl
Member #4,105
December 2003
avatar

Question: SUBTRACTIVE_BLENDER does which one? ...
final_color = dest_color - src_color;
final_color = src_color * dest_color; (values 0.0 to 1.0)

Request: OL hardware rendering to other (video ?) bitmaps.
If I had access to this power, I could do some really cool stuff. It'll be like gradient-capable stencil buffers.

__________________________
fuzinavl@hotmail.com (Pittsburgh)
__http://fuzinavl.tripod.com/__

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

Question: SUBTRACTIVE_BLENDER does which one? ...

The first one, after all the name is subtractive blender, not multiply blender ;)

Quote:

Request: OL hardware rendering to other (video ?) bitmaps.

Yeah, rendering to a texture is possible so I could implement rendering to an another Bitmap. Check this or this, for example.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Bob
Free Market Evangelist
September 2000
avatar

Quote:

The first one, after all the name is subtractive blender, not multiply blender

But which way does it go? dest - source != source - dest :)

Quote:

Check this or this, for example.

Uggh. You really should just use EXT_framebuffer_object (supported all the way back from the TNT2 to the latest and greatest GeForce). It's simpler, faster and has less issues.

--
- Bob
[ -- All my signature links are 404 -- ]



Go to: