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
Edward Sheets
Member #4,734
June 2004
avatar

You're welcome :)

Let us know if that does the trick! Hopefully that will get the OpenLayer1.82 package working using the new libs. The new libs have important bug fixes.

---

Note: carving a pentagram on the top of a container of spoiled yogurt does not summon a yogurt demon. -Kikaru

Phr00t
Member #2,008
March 2002

IT WORKS! ;D;D;D;D;D;D;D

Everything is fixed with the latest video drivers -- transparency, calling SetOrthoGraphicProjection after text printing, setting the graphics mode... it all just works now exactly as it should.

Thank you all! And forgive me for bashing Fladimir when it was all my fault for not getting the latest drivers ;)

Mark Oates
Member #1,146
March 2001
avatar

phallis avatar said:

it works!

YAY!
... that actually made me happy :o

so many tears, so many tears..

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Phr00t
Member #2,008
March 2002

Glad to hear it! ;D 'tis a great day for OpenLayer and the like. 8-)

Now back to work on my APSL and 'Dread' game!

-- I am going to start a thread in the off-topic forum about why I don't get to spend as much time as I want on this tho :-/

Fladimir da Gorf
Member #1,565
October 2001
avatar

Jeremy, great that you got it to work! So now the only problem is that the bilinear filtering doesn't work correctly with some people, but you could always turn anti-aliasing off.

Quote:


What should be changed is using enums instead of bools:

Sure, I could add overloaded versions of the 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)

Edward Sheets
Member #4,734
June 2004
avatar

I have antialiasing switched off. It makes it run even faster anyway. Antialiasing is nice for some things but it's not always really necessary.

Quote:

What should be changed is using enums instead of bools

I guess that does look nicer since you can type in the exact parameters instead of (true, false, true). But it's not really that big of a problem, in my opinion.

---

Note: carving a pentagram on the top of a container of spoiled yogurt does not summon a yogurt demon. -Kikaru

Thomas Fjellstrom
Member #476
June 2000
avatar

I like the bit flags, makes it clearer what you're trying to do. :)

--
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

fuzinavl
Member #4,105
December 2003
avatar

Code is untested, but I hope it gets into openlayer(tm) ;D

1// * ELLIPSE ROUTINES //
2 
3void GfxRend::
4Ellipse( float x, float y, float rad_x, float rad_y, Rgba col, float accuracy ) {
5 col.Select();
6 glDisable( GL_TEXTURE_2D );
7 
8 
9 //might want to try if(rad_x > rad_y), but if(rad_x < rad_y) produces fewer triangles
10 
11 if(rad_x < rad_y)
12 float da = GetAngleIcrement( rad_x, accuracy );
13 else
14 float da = GetAngleIcrement( rad_y, accuracy );
15 
16
17 glBegin( GL_TRIANGLE_FAN );
18 glVertex2f( x, y );
19
20 for( float a = 0.0; a <= 2 * AL_PI; a += da ) {
21 glVertex2f( x + cos(a) * rad_x, y + sin(a) * rad_y );
22 }
23
24 glVertex2f( x + rad_x, y );
25 glEnd();
26
27 if( Settings::TextureMappingUsed() )
28 glEnable( GL_TEXTURE_2D );
29}
30 
31 
32 
33void GfxRend::
34EllipseOutline( float x, float y, float rad_x, float rad_y,
35 Rgba col, float lineWidth, float accuracy ) {
36 col.Select();
37 glDisable( GL_TEXTURE_2D );
38 glLineWidth( lineWidth );
39
40 
41 //might want to try if(rad_x > rad_y), but if(rad_x < rad_y) produces fewer triangles
42 
43 if(rad_x < rad_y)
44 float da = GetAngleIcrement( rad_x, accuracy );
45 else
46 float da = GetAngleIcrement( rad_y, accuracy );
47 
48
49 glBegin( GL_LINE_LOOP );
50 for( float a = 0.0; a < 2 * AL_PI; a += da ) {
51 glVertex2f( x + cos(a) * rad_x, y + sin(a) * rad_y );
52 }
53 glEnd();
54
55 if( Settings::TextureMappingUsed() )
56 glEnable( GL_TEXTURE_2D );
57}
58 
59 
60 
61void GfxRend::
62EllipseGradient( float x, float y, float rad_x, float rad_y,
63 Rgba innerCol, Rgba outerCol, float accuracy ) {
64 glDisable( GL_TEXTURE_2D );
65 
66
67 //might want to try if(rad_x > rad_y), but if(rad_x < rad_y) produces fewer triangles
68 
69 if(rad_x < rad_y)
70 float da = GetAngleIcrement( rad_x, accuracy );
71 else
72 float da = GetAngleIcrement( rad_y, accuracy );
73 
74
75 glBegin( GL_TRIANGLE_FAN );
76 innerCol.Select();
77 glVertex2f( x, y );
78
79 outerCol.Select();
80
81 for( float a = 0.0; a < 2 * AL_PI; a += da ) {
82 glVertex2f( x + cos(a) * rad_x, y + sin(a) * rad_y );
83 }
84
85 glVertex2f( x + rad_x, y );
86 glEnd();
87
88 if( Settings::TextureMappingUsed() )
89 glEnable( GL_TEXTURE_2D );
90}

Now we need arcs!...

Arc( float x, float y, float start_angle, float end_angle,
     Rgba col, float accuracy ); //ummmm... pie slice
ArcOutline( float x, float y, float start_angle, float end_angle,
            Rgba col, float lineWidth, float accuracy );
ArcGradient( float x, float y, float start_angle, float end_angle,
             Rgba innerCol, Rgba outerCol, float accuracy );

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

Ultio
Member #1,336
April 2001

Just a general question, figured I'd ask it here: Does OpenLayer work under OS X? I know OL depends on some outside libraries, which is why I ask this question.

---
"It's nice knowing that someday, the software I write will just be pirated by millions of people." :-/
http://loomsoft.net | Zep's Dreamland | Allegro Newbie Tutorials

fuzinavl
Member #4,105
December 2003
avatar

Fladimir: For polygon vertex lists, do you have any plans to add template functions to support
arrays of generic objects
with x and y members? (object.x, object.y)

In addition to arrays of objects being supported,
users could support a regular array of x,y values like so:

<code>
//please excuse any syntax errors

struct myvertex{
float x;
float y;
}

float array1[20]; //filled with x,y values
*myvertex array2;

array2 = array1;

Polygon(,,array2,10,,);

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

Hrvoje Ban
Member #4,537
April 2004
avatar

How about this:

1class ol::VertexList
2{
3 public:
4 // ...
5 VertexList &operator +(const Vertex &);
6};
7 
8class ol::Vertex
9{
10 public:
11 // ...
12 VertexList &operator +(const Vertex &);
13 // ...
14};
15 
16// ...
17ol::Poligon(Vertex(15, 17) + Vertex(97, 56) + Vertex(159, 640));

Carrus85
Member #2,633
August 2002
avatar

Just a quick question for Mr. Gorf - Why haven't you placed openlayer on the SF CVS yet? It would allow us to help patch your code much more efficiently, not to mention it provides a nice way to "roll back" potentially buggy changes.

You could even move your openlayer page to the SF page hosting services...

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

Mr. Gorf

:D

Quote:

Why haven't you placed openlayer on the SF CVS yet?

I'd do that if I'd find an IDE with auto CVS system like in Eclipse for Java. About buggy changes - if they need any rollback there's probably a design issue, in which case the whole thing must be redesigned.

Quote:

You could even move your openlayer page to the SF page hosting services...

Yeah, I could. So much to do, so little time ;)

Quote:

ol::Poligon(Vertex(15, 17) + Vertex(97, 56) + Vertex(159, 640));

Sounds pretty nice but a different operator might be in order. Otherwise some people might think that calculates vector sums.

Quote:

Fladimir: For polygon vertex lists, do you have any plans to add template functions to support
arrays of generic objects

Yeah, I had forgot about that...

Quote:

View Profile
Code is untested, but I hope it gets into openlayer(tm)

Sure, that's exactly how it should be done. I'll just add a rotation parameter and I'm done ;)

Quote:

Now we need arcs!...

Well, isn't that an easy job ;)

Quote:

Does OpenLayer work under OS X? I know OL depends on some outside libraries, which is why I ask this question.

There's no reason why it shouldn't... but you'll need the fixed OS X headers/sources for AllegroGL.

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)

Carrus85
Member #2,633
August 2002
avatar

Quote:

I'd do that if I'd find an IDE with auto CVS system like in Eclipse for Java.

Hmm... maybe the C/C++ extension for eclipse would have such functionality? I'll look into it.

Chris Katko
Member #1,881
January 2002
avatar

Just thought I'd mention that you guys might want to try starting different threads (prefix with "[OpenLayer]" if you want) instead of having all OpenLayer-related posts in a single thread.

-----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

fuzinavl
Member #4,105
December 2003
avatar

Quote:

Sure, that's exactly how it should be done. I'll just add a rotation parameter and I'm done

Huh! good idea.:) Will this be the first gamelib with rotatable ellipses?

Quote:

ol:oligon(Vertex(15, 17) + Vertex(97, 56) + Vertex(159, 640));

Instead of OL forcing us to use it's data structures,
Template Polygon(); functions would allow us to store our vertices almost any way we like.

Mr. Gorf:
LineListGradient(); ? // good for movement trails
LineList(); ? // just to be complete

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

Edward Sheets
Member #4,734
June 2004
avatar

Warcraft Boy said:

you guys might want to try starting different threads

I'll do that if Mr. Gorf would prefer it that way :D

Anyway, it's been fun to have one big OpenLayer party thread instead of having a hundred little threads about OpenLayer. But whatever floats your boat...

---

Note: carving a pentagram on the top of a container of spoiled yogurt does not summon a yogurt demon. -Kikaru

kazzmir
Member #1,786
December 2001
avatar

Did you get my message that openlayer 1.82 has the demo compiled for allegro 4.0 but comes with the 4.2 dll?

fuzinavl
Member #4,105
December 2003
avatar

speaking of the demo:

The code should be short and easy to follow.
Simpler demos could demonstrate OL's features.

The ball should be a bright color & possibly have a movement trail.

Yeah, I wouldn't take the time to make those either. :)

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

Edward Sheets
Member #4,734
June 2004
avatar

I feel a great disturbance in the force. I think Mr. Gorf might be preparing a new release... (in which the demo is probably fixed)

---

Note: carving a pentagram on the top of a container of spoiled yogurt does not summon a yogurt demon. -Kikaru

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

Hmm... maybe the C/C++ extension for eclipse would have such functionality? I'll look into it.

Yeah, I forgot that Eclipse is actually an all-in-one solution...

Quote:

Will this be the first gamelib with rotatable ellipses?

Well, I don't know for sure, but in software they'd be a lot harder to implement. Now all it takes is 3 simple code lines ;) (glPushMatrix, OlRotateMatrix and glPopMatrix).

Quote:

LineListGradient(); ? // good for movement trails
LineList(); ? // just to be complete

Those are a must, and I actually think about changing the *Outline-functions to use that kind of a mechanism instead. The problem here is that the lines must be connected regardless of the line width and that they must not overlap. So that means they'll have to be rendered with quads/triangles. Now this calls for some math stuff...

Quote:

Did you get my message that openlayer 1.82 has the demo compiled for allegro 4.0 but comes with the 4.2 dll?

Well, that'll be changed in the future. Sorry, too many messages so that I may miss something ocassionally...

Quote:

The code should be short and easy to follow.

It was originally ;)

Quote:

Simpler demos could demonstrate OL's features.

That's what I'm aiming for. I've already started writing small tutorial-like demos.

Quote:

The ball should be a bright color & possibly have a movement trail.

Sure.

Quote:

I feel a great disturbance in the force. I think Mr. Gorf might be preparing a new release...

Am I not always ;)

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)

fuzinavl
Member #4,105
December 2003
avatar

conalleg: Depending on it's internal structures, maybe OL (glyph) could read from conalleg.:D

TileMap rendering : having only 1 function keeps it simple

TileMap( x, y, map_x, map_y, map_width, map_height,
       *BITMAP )  //points to an array of *BITMAPS

Transforms could handle the rest such as centering map coordinates center-screen while rotating and scaling the thing.

clip area: good for split-screens & minimaps

SetClipArea( int x, int y, int width, int height);
relative screen coordinates:
All players see the same world area no matter what the resolution.8-)
Coders could easily change the hardware resolution & artwork by just adding 1 line after SetupScreen(); :

SetRelativeCoords(1200);
//only the relative x-resolution is specified
//In the case of a 4:3 window ratio, the relative y-resolution automatically becomes 900 in this case.

Setup::SetupScreen(); should automatically call
SetRelativeCoords(int width); to support exhisting code.

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

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

conalleg

What's that?

Quote:

TileMap rendering : only 1 function keeps it simple

Maybe, if that's not too high level...

Quote:

clip area: good for split-screens & minimaps

That's planned, too.

Quote:

All players see the same world area no matter what the resolution.

That's possible, though it could be done with the current methods (by using SetStretch etc.).

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)

fuzinavl
Member #4,105
December 2003
avatar

conalleg- A simple scrolling console component for Allegro
http://www.inf.ufrgs.br/~fcecin/conalleg/
Scrollable text in a fixed size text buffer.
You can read & write to it.
...

So, If I wrote my game for 640x480, but changed the res:

float stretch_x = new_screen_w / 640;
float stretch_y = new_screen_h / 480;

SetStretch( stretch_x, stretch_y );

cool. no need to gum up the api
I don't see why it wouldn't work with any onscreen SetPosition();

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

Fladimir da Gorf
Member #1,565
October 2001
avatar

Well, a console lib sounds a bit high level to me. Making a console isn't much of a job and it seems that if I wanted to use conalleg I'd have to rewrite most of it anyways.

Quote:

So, If I wrote my game for 640x480, but changed the res:

That's right.

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)



Go to: