![]() |
|
[OL] invisible bitmap handling |
imaxcs
Member #4,036
November 2003
|
Hi! OpenLayer is a great library, but to me, it still has some quirks which make it unusable for some tasks. On of them has to do with the handling of invisible bitmaps. Please have a look at the following code:
(I omit the .h-file because it just includes the necessary headers) Why is that? Is there even a way to create these kind of bitmaps in Openlayer? I need it for my game-project (the current IOTD, btw Thanks for your help!
|
Richard Phipps
Member #1,632
November 2001
![]() |
Try adding this: // Deal with cases where people have a screen with an alpha channel. Canvas::SetPixelWriteMode( COLOR_AND_ALPHA ); After your settings::SetAntiAliasing(true) line. |
imaxcs
Member #4,036
November 2003
|
Didn't work. Still produces the same output.
|
Richard Phipps
Member #1,632
November 2001
![]() |
Not sure if the created bitmap has an alpha channel. if( test.HasAlphaChannel() ) { allegro_message( "Yes it does!" ); } Show the message? |
imaxcs
Member #4,036
November 2003
|
Yes it does! edit: Did you try the code yourself? What do you get?
|
Richard Phipps
Member #1,632
November 2001
![]() |
No, I haven't compiled the code. Does adding this make any difference before blitting? |
imaxcs
Member #4,036
November 2003
|
You are right! It doesn't change anything...:( But, nevertheless, I really appreciate your help, Richard! Thanks a lot!
|
Richard Phipps
Member #1,632
November 2001
![]() |
Imaxcs, I made a new project, cut out your code and made it draw to the screen until I pressed the mouse. It works fine for me. If I change the INVISIBLE to BLACK I get the black square too. Are you sure your screenshot save function is not causing the problem? Do you see the output on the screen? Finally, what version of OpenLayer are you using? I use 2.0 |
Fladimir da Gorf
Member #1,565
October 2001
![]() |
Quote: It seems like when you draw to a bitmap, all invisible areas get filled with black, which is not a wanted behavior. You should use the latest SVN version. 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) |
imaxcs
Member #4,036
November 2003
|
Quote: Are you sure your screenshot save function is not causing the problem? Do you see the output on the screen? No, my screenshot-function surely does work right. I can see the black square on the screen too. Quote: Finally, what version of OpenLayer are you using? I use 2.0
Quote: You should use the latest SVN version. I am using an SVN-version which is about 1 month old. Has anything changed since then? Anyway, I use Gentoo Linux. Could it be the case that this doesn't work because of that? And I have a Nvidia Geforce MX 440 Go. Maybe that's it?
|
Richard Phipps
Member #1,632
November 2001
![]() |
I'm not using a newish SVN version and I have a Geforce 4 MX 440SE. Any more ideas Flad? |
imaxcs
Member #4,036
November 2003
|
Here is an even shorter version, which uses OL's save-function to create the screenshot:
Still, it doesn't work!
|
Richard Phipps
Member #1,632
November 2001
![]() |
Well the old code works for me, so it sounds like it's either something in OpenLayer, AllegroGL or your gfx drivers. Does it work in full screen? BTW: I don't think you need the set-color-depth(32) line. Does it make a difference if you remove it? |
imaxcs
Member #4,036
November 2003
|
Quote: Does it work in full screen?
Quote: BTW: I don't think you need the set-color-depth(32) line. Does it make a difference if you remove it? No, that doesn't change anything... Quote: Well the old code works for me, so it sounds like it's either something in OpenLayer, AllegroGL or your gfx drivers.
I just tried it under Windows and it worked. So the problem is Linux. It seems to handle these bitmaps a bit different.
|
Fladimir da Gorf
Member #1,565
October 2001
![]() |
Maybe it's the OpenGL drivers then... But I'll check if there's an issue with the alpha channels... 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) |
imaxcs
Member #4,036
November 2003
|
Did you find something?
|
|