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

Try putting a one-pixel-wide outline around the bitmaps

---

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

Mark Oates
Member #1,146
March 2001
avatar

heh, I know this sounds wierd, but try printing some text to the screen before you draw the bitmaps

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

Edward Sheets
Member #4,734
June 2004
avatar

Fladimir da Gorf said:

Also the problem with the white background isn't fixed yet (to not break the package or anything :P) but as long as you include a one pixel thin outline for your solid bitmaps it'll be OK.

That's from the 1.7 release thread. Sounds like the same problem you're having, Jeremy.

---

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

How does the pixel thin border fix it? Must it be a transparent border? Why did it work just fine for me in version 1.7x and not 1.8x? Why does it work after my text printing function and not before?

The bigger problem is my sprites/Blits are not drawing at the pivots anymore, making everything shift to the lower-right (I was drawing at the center of the sprite). Anyway, 1.8x has unfortunately broken my projects quite a bit, and I'll roll back to 1.72 (if I can find the older versions files).

:'(:'(:'(:'(:'(:'(:'(

Edward Sheets
Member #4,734
June 2004
avatar

I've been drawing only png's And text so I haven't run into any of those problems yet.

I'm sure Fladimir will be checking this thread and he'll figure out the problem. I have 1.72 if you need it in the meantime...

---

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

Thanks, but I grabbed 1.72 from sourceforge -- luckilly he posts older versions.

I won't roll-back yet, I'll wait for Fladimir to see if he wants me to try anything.

I am only drawing PNGs myself... :-/

Edward Sheets
Member #4,734
June 2004
avatar

Whoa, Mark is right. Drawing text before blitting the Bitmap is what makes it work. I was doing that and that's why my Bitmap backgrounds were properly transparent. I removed the text.Print and now my Bitmap background is solid black :o

---

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

Chris Katko
Member #1,881
January 2002
avatar

How would I go about getting OpenLayer 1.8 to work with MSVC?

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

Edward Sheets
Member #4,734
June 2004
avatar

Quote:

How would I go about getting OpenLayer 1.8 to work with MSVC?

I think you would need to build all the required libs with MSVC. That might not be a lot of fun. It might be a whole lot easier if you just used Dev-C++...

---

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

Alright, let's sort it all out ;)

I think the problem with the white background is in the external libraries... at least the text rendering shouldn't affect the Bitmaps at all. But it really seems that you have to render some text before the Bitmaps appear correctly. About the COLORCONV_KEEP_TRANS... it shouldn't fix anything.

I noticed as well that the translucency works only after some text is rendered. Rather weird as the textures are already sent to the graphics card and the translucency information shouldn't be able to change so suddenly. After all it's in the graphics card already. Maybe the problem is in that I use the deprecated version of the AllegroGL function which sends the texture to the graphics card... but the non-deprecated version doesn't work for me and crashes or does some weird things. I bet this is fixed in the CVS version but it doesn't work for me either. Some day I'll just go and drop the whole AllegroGL altogether...

So the temporary solution is to render some text off-screen when the program starts :-X

The one pixel outline was because I didn't have the clamping in 1.72 and it produced slightly dark outline with solid sprites and it's not related to this.

Quote:
* I still have to call Settings::SetOrthographicProjection(); after all text printing functions.
I tried compiling and running your program and it worked without that line for me, so I couldn't find any problems there...

But it seems that the problem is more likely in my Glyph Keeper port, not in OpenLayer, so I'll take a look at there. (The only part of the whole thing which I've written in C, so no wonder it's guilty ;))

Quote:
* What happended to the BlitTransformed arguments for x,y,pivotX,pivotY? My sprites seem to draw as if the x,y is at the upper-left position, when it used to be in the center of the sprite (hence the pivotX and pivotY were in the center), code:
Weird... could you try using SetDefaultPivot and the non-pivoted version of the function? I even tested this function but I set the pivot point to be the top-left point so no wonder I didn't spot anything.

Quote:
Oh, the fonts show up in black on this old K6-2 machine of mine.
More text rendering issues :P I'll definitely go and test out the Glyph Keeper port throughoutly...

Quote:
Nice work Fladimir, I must say. I might whip up something with OpenLayer later
You? The maker of Ultimate Steroids (the favourite game of my sister ;))? You're the one who brought me into OpenGL programming back then... ;)

EDITed

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

Quote:

You? The maker of Ultimate Steroids (the favourite game of my sister ;))? You're the one who brought me into OpenGL programming back then... ;)

Yeah, me! :D Well, I'm glad to know you got two something out of USteroids :) I wish something like OpenLayer had existed back then, because the initial plan was to convert Steroids to OpenGL (in 2d) and work on top of that. Although, IIRC the fact that the Steroids code was so messy was the reason I opted for a complete rewrite (in 3d as well).

But yeah, I might do a simple game with this later, because my current project has been pretty much frozen for the past 6 months :(

Anyway, what do you think of the GL_QUADS --> GL_TRIANGLE_STRIP conversion? Might it be worth trying?

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

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

Anyway, what do you think of the GL_QUADS --> GL_TRIANGLE_STRIP conversion? Might it be worth trying?

Probably, I could make it so that if you #define OL_USE_TRIANGLE_STRIP it'd use the triangle strip instead to make everyone happy :)

Quote:

I wish something like OpenLayer had existed back then, because the initial plan was to convert Steroids to OpenGL (in 2d) and work on top of that.

Maybe it's best that it didn't ;) Ultimate Steroids is great as it is, though a bit hard especially if you don't get any weapon upgrades for a while. I've always thought about changing the source to give at least one weapon upgrade every 4 levels but I thought it'd be cheating... ;)

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)

Mordredd
Member #5,291
December 2004
avatar

I get the same error as in 1.7 - I even tried to compile the sample Dev-Cpp project to be sure I haven't made any stupid mistakes, but it does not work, too.

edit

I am downloading Dev-Cpp 5 now... maybe that helps?

Fladimir da Gorf
Member #1,565
October 2001
avatar

Aagh! Guess what was wrong with the bitmaps? When I was re-arraging the code I, for some reason, got rid of the line glEnable( GL_BLEND ) from a setup function (as I thought about moving it to somewhere else). Simply call:

glEnable( GL_BLEND );

before you call any rendering functions and everything should work just fine ;)

Damned with me...

Quote:

I am downloading Dev-Cpp 5 now... maybe that helps?

I hope so... it somehow seems like you're using a wrong kind of a compiler or something. :-/

Quote:

As for the demo game, you might want to change the ball and the paddle color. Now they're both quite grey which makes them hard to spot from the background (especially the ball). That's an opportunity to use the tinting feature!

Heh, yeah... they were originally supposed to look "metallic", but maybe I'll add some tinting to make them look nice... any suggestions about colors? :)

EDIT: About BlitTransformed... That was just a small code re-arrange problem... I forgot to apply the pivot after moving the raw drawing code out of the function. I'll post 1.82 soon, it'll be fixed then. About the crash - I have no idea about that, there's nothing in the function that could possibly crash. But when I looked at your code it almost looks like if you try to inline everything... maybe the compiler doesn't like that?

BlitTransformed in all it's simpicity:

1void Bitmap::
2BlitTransformed( float x, float y, float w, float h, float pivotX, float pivotY,
3 float angle, float fact, bool hflipped ) const {
4
5 glPushMatrix();
6
7 glTranslatef( x, y, 0.0 );
8
9 if( hflipped )
10 OlExecuteHFlip();
11
12 RotateMatrix( angle );
13
14 glTranslatef( -pivotX, -pivotY, 0.0 );
15
16 TexturedQuad( w, h, fact );
17
18 glPopMatrix();
19
20 if( !Settings::TextureMappingUsed() )
21 glDisable( GL_TEXTURE_2D );
22}

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)

Mark Oates
Member #1,146
March 2001
avatar

aha! new request please. I would like a GfxRend::Line function that takes more than 2 points. I have drawn multiple line segments, but they look disconnected with their thick width... so:

GfxRend::Lines(Rgba color, float width, float x, float y, float x2, float y2, ...);

pretty please?

as for the ball, I think just bright white would be dandy. ;)

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

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Quote:

I have drawn multiple line segments, but they look disconnected with their thick width...

AFAIK that's just the way OpenGL draws thick likes.

Edward Sheets
Member #4,734
June 2004
avatar

I have a request, too. Is there any way you can make a function that will continue to code my game and draw gfx while I'm at work tomorrow? ???

Settings::MakeGameWhileImAtWork(true); :P

Damn, the weekends go way too fast! :o

---

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:

AFAIK that's just the way OpenGL draws thick likes.

That's why I have to make the function to use quads instead of lines. Any ides of how to do this best?

Quote:

aha! new request please. I would like a GfxRend::Line function that takes more than 2 points.

Sure, I actually guessed you need that by looking at the screenshot.

Quote:

as for the ball, I think just bright white would be dandy.

I actually made it white myself, and made the paddle blue.

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

Has anyone else had the problem of the window not closing upon exit and you have to shut it down by force? Seems to be more of a problem in windowed mode than in fullscreen. I'm guessing it's an AllegroGL bug because I always had a problem shutting down the examples that come with AllegroGL. Anyone else having this problem with their OpenLayer programs?

---

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

Chris Katko
Member #1,881
January 2002
avatar

Quote:

Has anyone else had the problem of the window not closing upon exit and you have to shut it down by force? Seems to be more of a problem in windowed mode than in fullscreen. I'm guessing it's an AllegroGL bug because I always had a problem shutting down the examples that come with AllegroGL. Anyone else having this problem with their OpenLayer programs?

Upgrade your version of Allegro.

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

Edward Sheets
Member #4,734
June 2004
avatar

None of the Allegro4.03 examples exhibit the problem. Currently, OpenLayer doesn't work with the WIP or the beta releases of Allegro.

---

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

Mark Oates
Member #1,146
March 2001
avatar

I'm having trouble using Bitmap::LoadListOfBitmaps; likea so:

1#include <vector>
2using namespace std;
3using namespace ol;
4 
5vector< Bitmap *> tileBitmaps;
6 
7void load_stuff()
8{
9 tileBitmaps = Bitmap::LoadListOfBitmaps( "gfx/tile", "bmp", 3 );
10}
11 
12void draw_stuff()
13{
14 tileBitmaps[0].Blit(20, 20);
15 tileBitmaps[0].BlitStretched(20, 20, 40, 40);
16}

I get a compile error that says Blit has not been declared, or BlitStretched (whichever the case may be).

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

Hrvoje Ban
Member #4,537
April 2004
avatar

void draw_stuff()
{
    tileBitmaps[0]->Blit(20, 20);
    tileBitmaps[0]->BlitStretched(20, 20, 40, 40);
}

Evert
Member #794
November 2000
avatar

Quote:

None of the Allegro4.03 examples exhibit the problem.

Nevertheless, it is a bug in Allegro 4.0.3.

Quote:

Currently, OpenLayer doesn't work with the WIP or the beta releases of Allegro.

Not even if you use the proper (ie, CVS) version of AllegroGL?

miran
Member #2,407
June 2002

I have a very strange problem. I haven't read everything that was posted about OpenLayer so I appologize if this was already answered somewhere. Anyway, here's the deal. Demo.exe worked out of the box just fine. Then I compiled all the necessary libraries and OpenLayer myself with the latest version of Allegro (off CVS), AllegroGL (also off CVS) and GlyphKeeper (0.26.2), everything for static-linking. Then I wrote a simple test program that just clears the screen and draws a white rectangle. That compiles and runs too, but it doesn't display right. The rectangle is visibly made of two triangles. Then I added some text and a sprite and again, every rectangle (sprites and glyphs) is made of two triangles with a diagonal line in the middle. And now comes the weird part: Demo.exe does that too now. I haven't touched it or anything else in the OpenLayer directory, everything is straight out of the zip. It was working before and now it doesn't. And one more thing, when demo.exe was working, it did about 450 FPS, now it does >1000. Any ideas? ???

--
sig used to be here



Go to: