Goombert
|
|
Posted on: January 30, 2014, 10:10:30 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Tinkering around I add two new functions to ENIGMA which GM doesn't have. void window_set_alpha(unsigned char alpha); unsigned char window_get_alpha();
This is the pull request implementing the functions. https://github.com/enigma-dev/enigma-dev/pull/635Documentation is available on the Wiki. http://enigma-dev.org/docs/Wiki/Display_and_Window_FunctionsNow this also gave me the idea that we could overload all of these window functions to accept the Win32 handle allowing them to work with multiple windows. Another important thing this would rectify is removing the need for message_* functions, such as message_alpha, allowing you to obtain the window handle of a message box function and simply use window_set_alpha() http://enigma-dev.org/docs/Wiki/Message_Box_FunctionsWe should also consider doing the message functions entirely differently and modeling them after something like Java/C#/VB message boxes like the following. mid = message_box_show("Hello, world!"); wid = message_box_get_window(mid); window_set_alpha(wid, 150); message_box_set_visible(mid, true);
This could all be done without removing support for the old version of the functions. This would be the equivalent in Java. (even though there is a bug in JDK 1.7 making this example cause an exception) JOptionPane.getRootFrame().setOpacity(0.5f); JOptionPane.showMessageDialog(null, "Hello, World!");
There is however another issue and that is our Message Box system does not have a dialog result interface. http://msdn.microsoft.com/en-us/library/20stz12s%28v=vs.110%29.aspx
|
|
« Last Edit: January 31, 2014, 10:56:05 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.
|
|
|
Josh @ Dreamland
|
|
Reply #1 Posted on: January 31, 2014, 08:47:33 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Not bad. Conventionally, alpha is a float. And why is the game icon a sixaxis controller?
|
|
|
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 #2 Posted on: January 31, 2014, 09:01:00 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Conventionally, alpha is a float. I am not sure if you mean GM or in graphics programming such as OpenGL, but you already know how I feel about alpha being anything more than unsigned char. But some GML functions accept 0 to 255 for an alpha and others take float. And why is the game icon a sixaxis controller? Yeah that icon you made started making me violently ill everytime I saw it, it made me think of the .net framework or something similar. If you want me to be more coy about this, I can tell you that ENIGMA now compiles on the .NET Framework and XNA if you like
|
|
« Last Edit: January 31, 2014, 09:04:15 am 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.
|
|
|
|
Josh @ Dreamland
|
|
Reply #4 Posted on: January 31, 2014, 10:17:24 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Regarding alpha: I don't care how you feel about using a float for alpha. If you don't use a float, you're wasting three bytes of alignment, anyway.
Regarding the controller icon: Even worse. I don't care what you make the icon; don't make it anything that even remotely implies we are supporting a brand. Especially not that brand. The icon I made that was nothing but circles reminded you of .NET, so you replaced it with a goddamn XBox controller. Let me tell you, the XBox reminds of of .NET.
|
|
« Last Edit: January 31, 2014, 10:29:48 am by Josh @ Dreamland »
|
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 #5 Posted on: January 31, 2014, 10:34:13 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
I don't care how you feel about using a float for alpha. If you don't use a float, you're wasting three bytes of alignment, anyway. int is all you ever need for RGBA, 4 bytes total, and no more, the system and the monitor can't even display anything higher, let alone could your eye notice it that is why it's full color, the only argument I've read for using floats is that it is apparently easier to understand... why people think that I do not know Even worse. I don't care what you make the icon; don't make it anything that even remotely implies we are supporting a brand. Especially not that brand. The icon I made that was nothing but circles reminded you of .NET, so you replaced it with a goddamn XBox controller. Let me tell you, the XBox reminds of of .NET. Well you could have made more, a variety, a selection at the very least. Make some pretty ones, and make them all game related.
|
|
« Last Edit: January 31, 2014, 10:36:51 am 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.
|
|
|
TheExDeus
|
|
Reply #6 Posted on: January 31, 2014, 02:11:23 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
int is all you ever need for RGBA, 4 bytes total, and no more, the system and the monitor can't even display anything higher, let alone could your eye notice it that is why it's full color, the only argument I've read for using floats is that it is apparently easier to understand... why people think that I do not know I also think alpha should be 0-1. It's the way it usually is and it is mostly how it is in GM and ENIGMA right now (I actually can't think of a function taking an unsigned char). So we should stick with one convention. Well you could have made more, a variety, a selection at the very least. Make some pretty ones, and make them all game related. I don't think they need to be specifically game related. ENIGMA is not just for games. I always wanted the default icon to be the blue sphere without the E. Just like GM had the red sphere without the hammer. The blue ball does look nice like that. The previous dot one was very cryptic, but even that did look better than the controller one.
|
|
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #7 Posted on: January 31, 2014, 02:55:28 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The point here is consistency. If the windows function you are using accepts a byte, then fine, but otherwise, there is no point to breaking the trend. A blue ball icon is easy. Issue is, without the white E, it looks like this: Conventionally, engines are represented with a gear. But it's not very flattering; it looks like this: If you're feeling fancy, I'd recommend something more like this: And if you insist on the icon being a controller, at least use something like this: /
|
|
« Last Edit: January 31, 2014, 02:57:52 pm by Josh @ Dreamland »
|
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 #10 Posted on: January 31, 2014, 11:03:20 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Is somebody going to merge this pull request here or what, it is completely unrelated to any of this icon stuff and only contains bugfixes and 4 added functions. https://github.com/enigma-dev/enigma-dev/pull/635I'll put one of these icons into LGM and commit it and build that LGM for the next portable ZIP. But this pull request needs merged first, and an icon needs picked. I vote for the 3rd or 4th if all gears are made pure white. I also think alpha should be 0-1. It's the way it usually is and it is mostly how it is in GM and ENIGMA right now (I actually can't think of a function taking an unsigned char). So we should stick with one convention. draw_set_alpha_test_ref - Sets the reference value for alpha testing from 0 to 255 (default value is 0) draw_get_pixel_extended col = draw_getpixel_ext(mouse_x, mouse_y); alpha = (col >> 24) & 255; blue = (col >> 16) & 255; green = (col >> 8) & 255; red = col & 255;
vertex_argb buffer The buffer to write the information to. a The alpha value for the colour (0 - 255). r The red component part of a colour (0 - 255). g The green component part of a colour (0 - 255). b The blue component part of a colour (0 - 255).
Using double for alpha is inconsistent with all other color functions for RGB accepting 0 to 255 and returning 0 to 255. I am glad YoYoGames is finally correcting this. I don't care how you feel about using a float for alpha. If you don't use a float, you're wasting three bytes of alignment, anyway. Also just to build on top of that, it is against ISO RGB. ISO 22028-3:2012 specifies a family of scene-referred extended colour gamut RGB colour image encodings designated as reference input medium metric RGB (RIMM RGB). Digital images encoded using RIMM RGB can be manipulated, stored, transmitted, displayed or printed by digital still picture imaging systems. Three precision levels are defined using 8-, 12- and 16-bits/channel.
An extended luminance dynamic range version of RIMM RGB is also defined, designated as extended reference input medium metric RGB (ERIMM RGB). Two precision levels of ERIMM RGB are defined using 12- and 16-bits/channel.
FP-RIMM RGB, a floating point version of RIMM RGB, defines the expression method of RIMM RGB in a floating point figure. Three precision levels of FP-RIMM RGB are defined using 16-, 32- and 64-bits/channel. http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=58005
|
|
« Last Edit: January 31, 2014, 11:21:12 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.
|
|
|
Josh @ Dreamland
|
|
Reply #11 Posted on: February 01, 2014, 12:27:04 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
...
(1) ISO RGB does not concern alpha. Maybe you meant to quote something from ISO that includes the letter "A" or specifically mentions phrases such as "alpha" or "opacity." (2) We are in no way obligated to follow ISO on matters not related to our working set. The only standards we answer to are C++ (which they govern) and, here, Win32 (which they do not).
Win32 uses a byte, and that's a reason to prefer it ceteris paribus. Except for a few functions Yoyo has introduced in the last year, all of GM's functions which deal with opacity accept floats—even where all other attributes are unsigned byte.
I'm not opposed to the switch, but I'll be damned if I'm going to stand by and pretend it's anything but a switch. And if other members are opposed, that is a consideration.
Moreover, Game Maker never used ARGB. It has always been BGR internally and RGB in function notation. ENIGMA added a layer atop that which works with RGBA, which is more common. Their propensity to break existing traditions isn't a concern of mine—I assign it virtually no weight.
|
|
« Last Edit: February 01, 2014, 12:35:09 am by Josh @ Dreamland »
|
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 #12 Posted on: February 01, 2014, 09:37:25 am |
|
|
Joined: Apr 2008
Posts: 1860
|
draw_set_alpha_test_ref Their fuckup. draw_get_pixel_extended |This is because GM stores all colors in int's (and so does ENIGMA) and so it cannot actually return 3 chars and a float. So of course you have to do "alpha = ((col >> 24) & 255)/255;" to get correct alpha. There is literally no other way besides just making a new function (draw_getpixel_alpha). And that is in no way breaking convention either, because users don't get alpha from 0 to 255. They must do math themselves to get it (and then they might as well get 0-1). vertex_argb This just shows how YYG doesn't have a spec at all. They just do everything randomly. other color functions And using 0-255 is inconsistent with all of the drawing functions (of which there are many more than color functions). Also just to build on top of that, it is against ISO RGB. As Josh pointed out, it doesn't even concern the stuff we are talking about here. If we keep adding their shit ass implementations of functions, then ENIGMA will become as chaotic as GM. We either have to start ditching that useless compatibility with GM:S. Or stick with their bull only in their functions and use correct (and consistent) convention in ENIGMA functions. I wouldn't have problems with ENIGMA taking 0-1 in all functions, but that clearly isn't possible. Unless we start putting colors in structs (or classes) and then overloading drawing functions. Is somebody going to merge this pull request here or what, it is completely unrelated to any of this icon stuff and only contains bugfixes and 4 added functions. They are not merged because we are clearly still talking about them. We should do this more often, than just randomly merge all the stuff you somehow deem worthy. That is why I personally only merge for bug fixes instead of new functionality. For new functions I actually try to read the code.
|
|
|
Logged
|
|
|
|
Darkstar2
|
|
Reply #13 Posted on: February 01, 2014, 11:58:02 am |
|
|
Joined: Jan 2014
Posts: 1238
|
vertex_argb If we keep adding their shit ass implementations of functions, then ENIGMA will become as chaotic as GM. We either have to start ditching that useless compatibility with GM:S. Or stick with their bull only in their functions and use correct (and consistent) convention in ENIGMA functions. I
I think that's a strong point in ENIGMA, compatibility with GM, for people who are not aware of all these technicalities, and used to working with GM for all those years and want to benefit from the advantages of using ENIGMA (faster, better, etc.) Not everyone wants to rewrite their projects from scratch. I think keeping compatibility with the bull but also supporting ENIGMA's own command set + new ones is brilliant, at least people can have it all and use GML, C++, enigma specific commands, etc, all in the same project.
|
|
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #14 Posted on: February 01, 2014, 04:42:24 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
They've already broken GML to the point where EDL will not at all be following suit. For instance, they now have some five types of reference characters for a pointerless language. The most absurd C++ implementations I've ever seen have four: *, &, && (C++11), %. And each of those represents a unique type of pointer or reference.
There's a difference between syntactical divergence and API divergence, but the point is that we at very least have to handle the former. The latter may as well be done on top of that.
Now, as to whether we embrace a byte for alpha or a float, I am unbiased. Robert prefers bytes for the sake of cards with terrible memory bandwidths, which ENIGMA should ideally cater to as well. A byte allows us to batch all four color components in a single word, instead of one word per component. The cost of this, of course, is conversion GPU-side (the color components have to be divided by 255f before they can be used). However, in the case of vertices with many different colors, this is in fact more efficient—the GPU can do thousands of these divisions at once. Obviously, your mileage may vary, there. When the color is only set once, as in the case of draw_set_color, it's better to do the division CPU-side where your clock is 3GHz and you're only doing it once.
|
|
|
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
|
|
|
|