Allegro.cc - Online Community

Allegro.cc Forums » The Depot » OpenLayer 1.9 Released!

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
OpenLayer 1.9 Released!
Zaphos
Member #1,468
August 2001

(As I said in the other thread) the new version you attached fixed the lines problem for me. Hooray :)

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

(As I said in the other thread) the new version you attached fixed the lines problem for me. Hooray

Finally! Time for the 1.91 release.

Download 1.91, Update 1.9 to 1.91 (No precompiled demo), the Demo .exe only and the source only distribution

  • Fixed away the diagonal lines which crossed the Bitmaps with some hardware

  • Included the correct version of Loadpng in the package

  • Fixed the header files to work in Linux without modifications

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)

Steve Terry
Member #1,989
March 2002
avatar

Seems to have cleared up the line issue for me :) Keep up the excellent work Fladimir.

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

fuzinavl
Member #4,105
December 2003
avatar

:-X

void Print( const std::string &text, int x, int baselineY, const RenderMode &mode);
//RenderMode would need rotate() and stretch())

Quote:

I'm most afraid of that the newcomers may not get the idea immediately, thus thinking that there's no way to rotate or stretch the Bitmaps.

Fix that with demo programs and screenshots? or... maybe BlitRotated would call Blit(,, + Rotate(angle))? But having 2 ways of doing the same thing is just asking for work and confusion.

Are all OL angles CCW positive(including transforms)?
Might want to mention that arc and ellipse angles can be positive or negative.

GfxRend: Ok, I'm converted. ;) The only thing left is EllipticalArcGradient- the mother of them all. (j/k!);D

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

Hrvoje Ban
Member #4,537
April 2004
avatar

I said:

You forgot to remove Allegro/AllegroGL headers from Source only distribution.

And again and again...

EDIT: Ever thought about making DLL version on OpenLayer?

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

And again and again...

I'm hopeless I know :-X I always just think that for a source distribution I have to include all the sources and headers from the original package...

Quote:

Ever thought about making DLL version on OpenLayer?

Well, I haven't thought that's necessary.

Quote:

void Print( const std::string &text, int x, int baselineY, const RenderMode &mode);

Well, that's possible with the new system in fact. It requires some extra work in the TextRenderer's side, but still.

Quote:

maybe BlitRotated would call Blit(,, + Rotate(angle))? But having 2 ways of doing the same thing is just asking for work and confusion.

That's what I thought as well.

Quote:

Might want to mention that arc and ellipse angles can be positive or negative.

Yeah, I should indeed.

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)

Ron Ofir
Member #2,357
May 2002
avatar

Cool stuff! I have to check this out! I'm not done with "terrain renderer" yet though so I can't fiddle around with anyhing else.

Quote:

Ever thought about making DLL version on OpenLayer?

Wouldn't that be a little hard with the current rate of updates? ;) Seriously though, if it is going to become a DLL, any program that use it should have an updater to keep the DLL updated.

Oh, and don't you think OL 2.0 should actually become OL 1.0? I mean, 1.0 wasn't a real finished one...

Norebo
Member #5,930
June 2005

Hi,

i have created a Bitmap-object from an Allegro BITMAP, but when i try to blit it to the screen nothing appears!

I think that i have detected the reason in line 868 of file "Bitmap.cpp":

bool Bitmap::
Load( BITMAP *bmp, bool hasAlphaChannel, bool convertMagicPink ) {
   Destroy();
   
   this->bmp = bmp;
   this->isSolid = !hasAlphaChannel;
   width = width;
   height = bmp->h;

Instead of 'width = width' it should be 'width = bmp->w'.
Otherwise 'width' remains zero.

Fladimir da Gorf
Member #1,565
October 2001
avatar

Ouch, that's because of the search and replace I had to do because I didn't store the bitmap in the memory anymore... It also seems that this wasn't the only problem in the loading functions. Thanks Norebo, I'll post the version 1.92 immediately.

OpenLayer 1.92 Released

Download 1.92, Update 1.91 to 1.92, the source only distribution

  • Fixed all the Bitmap loading functions

  • Fixed the named arguments that some of the functions take (I have no idea what I was thinking about when I wrote the bit masks...)

  • Changed the source to not to use the GCC min/max extensions

Quote:

Cool stuff! I have to check this out! I'm not done with "terrain renderer" yet though so I can't fiddle around with anyhing else.

Even if you want 3D graphics you can still use OpenLayer to render text, load textures and render the GUI. Remember that you can use pure OpenGL along with OpenLayer.

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)

Ron Ofir
Member #2,357
May 2002
avatar

Quote:

Even if you want 3D graphics you can still use OpenLayer to render text, load textures and render the GUI. Remember that you can use pure OpenGL along with OpenLayer.

Yes, GUI was what I had in mind.

Fladimir da Gorf
Member #1,565
October 2001
avatar

Note that loading the textures with the correct format is very easy when using OpenLayer. Simply:

Bitmap myTexture( "Gfx/Texture.png" );

// Get ready to render with the texture //
myTexture.Select();

The Select -method is equal to OpenGL's glBindTexture.

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)

Tobi Vollebregt
Member #1,031
March 2001

Hmm, sorry to say: it seems you broke the demo in 1.92. Fix below:

1--- Demo-orig.cpp 2005-06-21 09:43:02.765544560 +0200
2+++ Demo.cpp 2005-06-21 09:41:11.525455624 +0200
3@@ -1,6 +1,6 @@
4 // CHANGEEE!!! //
5 
6-#include "Source/OpenLayer.hpp"
7+#include "OpenLayer.hpp"
8 #include <loadpng.h>
9 #include <string>
10 #include <vector>
11@@ -619,7 +619,7 @@
12 (*iter)->Render();
13 }
14 
15- temp.Blit( 100, 100 );
16+// temp.Blit( 100, 100 );
17 
18 string text = "Blocks Destroyed: " + ToString( numDestroyedBlocks ) + " / "
19 + ToString( numTotalBlocks ) + "\nExtra balls: " + ToString( extraLifes >? 0 )

EDIT: forgot to say, I used to 1.91->1.92 upgrade zip

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

Fladimir da Gorf
Member #1,565
October 2001
avatar

OK, thanks, I just had included a wrong version of the demo in the package. I also changed the extraLifes >? 0 to max( extraLifes, 0 ).

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)

CGamesPlay
Member #2,559
July 2002
avatar

Demo crashes for me. Last line in the log is loading the background. Also, does it compile for MSVC? Have you considered not using uppercase in your filenames?

[edit]
I'll have some time to work on a nice demo I'm thinking of in a few hours. But I'd need to be able to use OpenLayer to be able to use OpenLayer ;)

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Fladimir da Gorf
Member #1,565
October 2001
avatar

You're using 1.92, right? Could you check if the bitmap exists where the log says it should? But if the log doesn't say that the bitmap isn't found or is in a wrong format then I'm clueless without some extra information because at least everything works for me. I've attached a .bat file to compile the debug version of the library, so could you use it instead and tell me where it crashes?

About the uppercase letters in the file names, is it bad? I don't know yet if it compiles for MSVC as I can't try that myself.

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)

Hrvoje Ban
Member #4,537
April 2004
avatar

Fladimir da Gorf said:

Well, I haven't thought that's necessary.

I could make life easier to newcomers (

1 .a + 1 .dll

-VS-

8 .a + 3 .dll

).

Speaking of DLLs, they must be in same folder as exe in order to be found, ie putting them in "DLLs" won't work.

CGamesPlay
Member #2,559
July 2002
avatar

It's not "bad", so much as "annoying". Because Linux users have case-sensitive filesystems. I think, maybe, today I will write some scripts that "fix up" your library, primarily making everything into lowercase (with reference checking and all), then try compiling under Cygwin, which has case-sensitivity also, then try to make it work under MSVC. Your ">?" stuff might not work though, it seems, so I'm worried about that.

Hrvoje: Or they can be in the PATH.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

Speaking of DLLs, they must be in same folder as exe in order to be found, ie putting them in "DLLs" won't work.

Yeah, I originally had them in the base folder of OpenLayer but then I thought everything would be better organized if the were in a Dlls -folder instead. Of course this may cause many "Why doesn't this demo run?" problems if I introduce OpenLayer in Gamedev where few have Allegro (or GZip) installed and not everyone would think that if a dll is not found it can be found in the dlls folder. So maybe I'll move them to the same folder as the demo.

Quote:

I could make life easier to newcomers (1 .a + 1 .dll -VS- 8 .a + 3 .dll).

Maybe, maybe. I hadn't thougth that I could include the other dlls inside OpenLayer's dll file.

Quote:

Your ">?" stuff might not work though, it seems, so I'm worried about that.

I've got rid of those in 1.92.

Quote:

It's not "bad", so much as "annoying". Because Linux users have case-sensitive filesystems.

I always use Windows as if the file system would be case-sensitive and I don't find that so annoying. But maybe that's just me, I like starting all the names with an uppercase letter.

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)

CGamesPlay
Member #2,559
July 2002
avatar

Well, as long as you're certain that you've followed case-sesitivity, I suppose I can let it be. It'll still be an annoyance for me and probably other Linux users, though :)

And if you've gotten rid of it, then good. I'll try making up a project file for it in a while. Would you like to include it in the distribution? It'll be a VC7 project, unfortunately, but still.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

fuzinavl
Member #4,105
December 2003
avatar

Allegro's angles are CCW negative. Traditional Angles are CCW positive. I don't care which standard OL uses as long as it's consistent throughout the api; I'm making myself float d2r(float); //degrees to radians anyway.

Is OL z-negative into the screen? If it is, great. Without changing the projection, I could render 3d stuff in a layered 2d overhead world. UP = z_positive. No worries about render order.

Quote:

fuzinavl says:I notice that individual things (bitmaps, ellipses, whatnot) all have similar transforms before the global transforms are applied. Strangely, they all have different interfaces.
Fladimir says:Yeah, usually they need to select the rendering position, store the old transformation state first, select the color and things like that. You're right, maybe all the "startup stuff" should be put in a function.

No, no! I'm wrong! "Regular" gfx_rend functions provide instant syntax checking for coders, which prevents bugs. A "StartupStuff" function may reduce the GfxRend function list by 60%. Unfortunately, coders may forget to add all of the parameters for what they want to do, and end up cursing over why their circles are all 1 pixel at (0,0).

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

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

Would you like to include it in the distribution? It'll be a VC7 project, unfortunately, but still.

Sure why not, as long as it compiles in GCC (I can do the required modifications if those are needed, though).

Jim, I forgot to say that you can compile OpenLayer with -DOL_ANGLES_IN_DEGREES and the angles are then passed in degrees :)

By the way, it seems that I forgot to mention that now OpenLayer uses an advanced FPS calculation system which tries to stabilize the game speed even better. The problem with the usual FPS calculation method is that if the FPS is calculated over only a few frames it won't be stable and accurate. On the other hand if the FPS is calculated over dozens of frames the game won't be able to act to sudden drops or jumps in the game speed (like an explosion which spits out thousands of particles).

Therefore I decided to use a system which tries to combine the best parts of both methods by dynamically changing the number of frames over which the FPS is calculated depending on the situation. If the game speed drops or jumps suddenly the FPS calculator will be set to temporarily to use the higher frequency calculations increasing the responseability. Then when the FPS stabilizes it'll gradually switch to use the lower frequency calculations increasing the accuracy.

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)

Tobi Vollebregt
Member #1,031
March 2001

What about this code for SetOrthographicProjection (instead of the current code of course):

void Settings::
SetOrthographicProjection(int w, int h) {
  glMatrixMode( GL_PROJECTION );
  glPushMatrix();
  glLoadIdentity();
  glOrtho( 0, w, 0, h, -1, 1000 );
  glScalef( 1, -1, 1 );
  glTranslatef( 0, -h, 0 );

  glMatrixMode( GL_MODELVIEW );
  glLoadIdentity();
  glDisable( GL_DEPTH_TEST );
}

To preserve API compatibility add default arguments
SetOrthographicProjection(int w = SCREEN_W, int h = SCREEN_H);
to the declaration.

It allows you to write a program designed for 800x600 and run it in any resolution with all graphics automagically rescaled by OpenGL, by passing the real resolution to SetupScreen and the design resolution to SetOrthographicProjection.

There are some issues with GK though which cause text to appear in different size. These can be solved by adding

gfx_driver->w = DESIGN_W;
gfx_driver->h = DESIGN_H;

after SetOrthographicProjection. This causes SCREEN_W and SCREEN_H to return the design resolution to GK.

Note: I grepped through Allegro's source and it appears to be quite safe to change these. Of course, it is still a dirty hack which might be less portable than normal Allegro code. So use it at your own risk!

For example, demo in 1280x1024 fullscreen by changing the call to SetupScreen to:

   // Open the game in a 800 x 600 window //
   if( Setup::SetupScreen( 1280, 1024, FULLSCREEN ) == false ) {
      allegro_message( "Error while trying to set graphics mode!" );
      //exit( -1 );
   }

   Settings::SetOrthographicProjection( 800, 600 );

   gfx_driver->w = 800;
   gfx_driver->h = 600;

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

fuzinavl
Member #4,105
December 2003
avatar

Quote:

advanced FPS calculation system ...by dynamically changing the number of frames over which the FPS is calculated depending on the situation.

great idea :)

Fladimir: So, when OL can do hardware rendering to video BITMAPs, will all of the blit,text, and gfx_rend functions get an extra *BITMAP parameter, or will there be a global target *BITMAP?
Will each BITMAP have its own set of transform settings?

What additional functionalities would make openlayer complete?
Given that, what do you want the final api to look like?

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

Fladimir da Gorf
Member #1,565
October 2001
avatar

Sounds good, but I think I'll change the OpenGL port of Glyph Keeper instead of changing any internal values of Allegro. An another way to get the same effect would be Transforms::SetStretch( 800.0/1280.0, 600.0/1024.0 ) but then SetStretch couldn't be used to anything else (without multiplying the parameters with those parameters).

Quote:

So, when OL can do hardware rendering to video BITMAPs, will all of the blit,text, and gfx_rend functions get an extra *BITMAP parameter, or will there be a global target *BITMAP?

I believe I just write Bitmap::SetAsDestination() or a similiar function. Of course I have to add a function to set the screen as the destination. In fact as it's possible to use the screen contents as a texture I could include a global screen variable as in Allegro. I'm not sure about this yet, though.

Quote:

What additional functionalities would make openlayer complete?

Pixel shaders, for example. I've been designing a system I call ShaderLayer and it's intended to be an easy-to-use tool to make 2D shaders.

And I've also thought about making an gui library for OpenLayer and then there's the rendering to Bitmaps.

Quote:

Given that, what do you want the final api to look like?

Well, new stuff is always new stuff. The final API will just include more and do everything better but thus far the API looks fine for me...

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)

CGamesPlay
Member #2,559
July 2002
avatar

Hmm. You should only include files with "..." if the file is in the same directory. It seems MSVC doesn't like to search the include paths. (Working on the conversion now)

[edit]
Alright. I got it to compile. Making a diff now. Is there a CVS repo anywhere?

[edit]
Well, I have it compiled, but I don't have allegro gl. Phooey. I'll have to look more later. Anyways, currently attached are the diff and vcproj files.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

 1   2   3 


Go to: