sidegame
|
|
Reply #30 Posted on: July 18, 2013, 07:21:36 am |
|
|
Joined: Jul 2013
Posts: 13
|
I don't actually now if it will fix anything. It really shouldn't as it works on many machines and is just weird it doesn't work on yours. Have you also tried installing newer video drivers? And are you sure you don't have an ATI card in that PC (look at the stickers on it if it says ATI anywhere), because for some reason the manufacturer is ATI Technologies Inc. Maybe they just make the built-in card.
Try copying this https://dl.dropboxusercontent.com/u/21117924/Surfaces/GL3surface.cpp inside enigma-dev\ENIGMAsystem\SHELL\Graphics_Systems\OpenGL3 and overwriting the file there. I cleaned it up as far as consistency goes (now everything is ARB) and made surface_free() actually free texture and FBO (previously I guess it was a memory leak on the GPU... dunno how that works).
Also you should try a simpler example. It's possible that blend modes just fk's the picture up and just writes 0 alpha everywhere or something. So try something like: surf = surface_create(128,128); surface_set_target(surf); draw_text(10,10,"This is text "+string(random(100))); surface_reset_target();
This will just draw text. Nothing else. Also try this: https://dl.dropboxusercontent.com/u/21117924/surface_test.exe It's exactly that text drawing but I compiled it so if it still doesn't show up then the problem is even more bizzare. Also try pressing Enter while the program is running. That will delete the surface and create a new one with new text. A random number is added to see if it changed.
edit: Robert B Colton, check the first page. He posted a screenshot. _supported() returned true.
Great! I Just copied above file to enigma-dev\ENIGMAsystem\SHELL\Graphics_Systems\OpenGL3 and I changed the render from OpenGL 1 to OpenGL 3 and know it works just like GameMaker but allot faster. Thanks for your Amazing Work/Help. and now here is the worked picture of my project: Thanks.
|
|
|
Logged
|
|
|
|
|
|
sidegame
|
|
Reply #33 Posted on: July 18, 2013, 11:04:27 am |
|
|
Joined: Jul 2013
Posts: 13
|
Ok! I started my project but here I face anther problem and that is that draw_clear_alpha(color, alpha) is not working properly here is the gmk in GameMaker when I save the surface it save it with a Transparent Background while in ENIGMA it save it with a Black Background please have a check it and see what is the problem with it. http://www.mediafire.com/download/y69bj6o6c7a46gj/Surfaces.gmk
|
|
|
Logged
|
|
|
|
TheExDeus
|
|
Reply #34 Posted on: July 18, 2013, 11:40:47 am |
|
|
Joined: Apr 2008
Posts: 1860
|
It's no the problem of draw_clear_alpha(color, alpha). If you remove all the rectangles you draw then you will see the surface itself is transparent. The problem is that ENIGMA doesn't export .png's. It only exports BMP's which don't have alpha channel. I have mentioned it before, but no one is willing to do anything about it. Josh said that images (sprites and backgrounds) are just zip'ed and not .png encoded so ENIGMA doesn't actually have functions necessary to export PNG's. So we have to choose: http://lodev.org/lodepng/ - No other dependencies. Probably the most painless method. http://www.libpng.org/pub/png/libpng.html - Requires zlib Or just make our own (which would be stupid). The lodepng seems to be the easiest to implement.
|
|
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #35 Posted on: July 18, 2013, 02:12:13 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
ENIGMA actually ships with zlib. My concern is that we haven't set up a codec/format system in the extension system to cleanly allow plugins to add import/export formats. Right now, the sprite_save/load functions only work with bitmaps, and the sound_add functions goes through ALURE. Not very extensible. That needs revisited, but it is at the bottom of my to-do list right now.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
TheExDeus
|
|
Reply #36 Posted on: July 18, 2013, 03:05:58 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
Well until that is sorted out you can use this: https://dl.dropboxusercontent.com/u/21117924/Surfaces/OpenGL3.zipJust extract it the same place as before. I modified the surface_save functions to output png if the extension is .png and output bmp if extension is .bmp. There is a problem with bmp though and it was there previously too. bmp will only save correctly for some dimensions. Like your 500x500 saves fine, but not 322x322 (or 50x50 or whatever) will not. I tried to fix that for 2 hours and I have no idea why it is doing that. In the end I replaced the whole current code with totally different one from lodepng and it still outputed the wrong stuff. In the end I just gave up. Maybe someone else can figure it out.
|
|
|
Logged
|
|
|
|
|
TheExDeus
|
|
Reply #38 Posted on: July 19, 2013, 02:05:29 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
Sadly I can't find any easy to use library for jpegs and I am not really into mood of remembering discrete cosine transform to make them. Libs like libjpeg require dll's to be shipped with the exe and while it probably can be linked statically I cannot be bothered with that either. I personally believe that .png is the only format you need. It supports alpha, is lossless and compresses nicely. So while more formats for enigma would be good I don't think we should add them until some system that Josh proposed is in place. Until then I think we should just support .bmp and .png. I will try to fix .bmp, but it really is a mind bending bug.
Josh, can I commit the changes (or make a pull request) with the lodePNG library included? The good thing about is that it's only a header and .cpp file. No libs of any kind. Just include the header and you are set. I put the files the same folder as surface.cpp, but I guess it should be in Additional... So what do you propose? I think we need .png sooner or later and I could implement this rushed version and later when some extension system is in place we could redo it properly. They are total of 288kb. When compiled then 112kb. If I remove things we don't use (like english error messages, C++ wrapper (I can just use C), file functions (I just write them manually) and decoder functions (we only save, not load)), then it goes to 69kb. When linked then compiler probably optimized duplicate code and it's even smaller. Now the code is a little uglier though, as it no longer is 1 line to save the image.
|
|
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #39 Posted on: July 19, 2013, 02:22:00 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Go ahead and commit them.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #41 Posted on: July 19, 2013, 04:00:41 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
I think someone previously tried to commit a copy of lodePNG. Specifically, "canthelp," under the alias "sssstest." The pull request is here. I was about to merge it, but he closed it.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Goombert
|
|
Reply #42 Posted on: July 20, 2013, 08:11:23 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Also, shouldn't Widgets be in namespace enigma_user? Yes, platforms are pretty messy right now, and Win32 has a bunch of extra window functions that Xlib does not.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
eppe
|
|
Reply #43 Posted on: September 09, 2013, 03:32:47 pm |
|
|
Joined: Aug 2013
Posts: 8
|
I am upping this thread because I am facing issues with surface_create. Each time it gets executed the generated executable crashes. So I gave a try to the sample on the first page ( http://www.mediafire.com/download/6ij4pkhto5ayoub/surface.gmk) And I am facing the exact same behavior, the generated executable crashes as soon as surface_create is executed. surface_is_supported() returns 1, I tried with GL1 and 3. I am not sure which way I should look to resolve the issue. Any help will be greatly appreciated. Thanks.
|
|
|
Logged
|
|
|
|
Goombert
|
|
Reply #44 Posted on: September 09, 2013, 11:00:52 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
@eppe, I just tried that example in run mode and created a built (*.exe) as well to ensure that was not the problem, and it worked fine for me in both cases... If you could please download and run the glu test form this topic http://enigma-dev.org/forums/index.php?topic=1131.0Then pastebin.com your results in the topic, I like to keep track of everyones graphics hardware, but that will also tell me whats up with frame buffer objects and why you can't use surfaces.
|
|
« Last Edit: September 09, 2013, 11:08:30 pm by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|