• What are you working on? February 2012
    3,497 replies, posted
  • [vid]http://www.iefhost.com/dl/PseudoWire/img/fuckwinforms.webm[/vid] Save/Load windows, with callback events upon clicking either the check or cancel buttons. It ain't much but I think they're pretty cool
  • [QUOTE=Overv;34894782]It's also the best way to prevent people from learning OpenGL at all. It's like giving people the choice between an automatic car and a manual car, where you need to learn how the manual car is built before being allowed to use it.[/QUOTE] Its more like learning how to use the key to start the Carr instead of having somebody else to do it for you. Its an OpenGL tutorial you learn people OpenGL, OpenGL exists beyond C++, i don't see why you would want to learn people to fiddle with the SFML library to create a window for you.
  • [vid]http://dl.dropbox.com/u/18131951/BR2/BR2%202012-02-27%2018-08-06-13.webmvp8.webm[/vid] Buttons and checkboxes! (No idea why plural because there's only one of each..)
  • [QUOTE=KillerJaguar;34894867]How do you guys record your stuff?[/QUOTE] > Fraps > Convert to WebM with Miro > Put in Dropbox public folder > Copy link > Paste in [vid] tags > ??? > Profit
  • [QUOTE=KillerJaguar;34894867]How do you guys record your stuff?[/QUOTE] Fraps, ffmpeg -i "vid.avi" -b 1M "vid.webm"
  • [QUOTE=OldFusion;34894843]Its more like learning how to use the key to start the Carr instead of having somebody else to do it for you. Its an OpenGL tutorial you learn people OpenGL, OpenGL exists beyond C++, i don't see why you would want to learn people to fiddle with the SFML library to create a window for you.[/QUOTE] Because the code before the context creation is not part of the OpenGL spec. When you learn how to use wglCreateContext, you aren't learning how to use OpenGL, you are learning how to use the Win32 API.
  • I'm currently trying to make some kind of Java chat client/server application. [img]http://i.imgur.com/HI4k3.png[/img] Nothing networked works as of yet, although it's probably the first GUI in Java that I've made that doesn't look [I]too[/I] bad :v:
  • [QUOTE=synthiac;34890840]how about you store them as the exponent with 4 bits each?[/QUOTE] why would i increase code complexity to shave off a pixel's worth of bytes considering the rest of the file is 250k+ pixels worth of uncompressed RGB(A) data?
  • [QUOTE=Overv;34894997]Because the code before the context creation is not part of the OpenGL spec. When you learn how to use wglCreateContext, you aren't learning how to use OpenGL, you are learning how to use the Win32 API.[/QUOTE] How is learning how to create the context on a popular platform not related to OpenGL?
  • [QUOTE=nekosune;34878652]Well now with world set to: [code] colors = [['red', 'green', 'green', 'red' , 'red'], ['red', 'red', 'green', 'red', 'red'], ['red', 'red', 'green', 'green', 'red'], ['red', 'red', 'red', 'red', 'red']] [/code] and the measurements it detects are: [code] measurements = ['green', 'green', 'green' ,'green', 'green'] [/code] with motions: [code] motions = [[0,0],[0,1],[1,0],[1,0],[0,1]] [/code] with accuracy [code] sensor_right = 0.7 p_move = 0.8 [/code] I get the result: [IMG]http://i.imgur.com/1kHWu.png[/IMG][/QUOTE] For all of you wondering about this, it's actually a homework assignment from a free online robotics AI class that just started last week: [url]http://www.udacity.com/overview/Course/cs373[/url] It's supposed to teach you how to program a car that can navigate by itself (it probably won't go much into the fine details, but it should give you a good understanding of the core principles and algorithms used for that) and it's taught by the same professor that did the Stanford's online AI class last year. If you did the previous AI class, you'll definitely enjoy this one, it's much more polished, explains the content really well step-by-step and even has nicely integrated programming assignments.
  • [QUOTE=OldFusion;34895143]How is learning how to create the context on a popular platform not related to OpenGL?[/QUOTE] It is related to OpenGL, but it is a cumbersome process and not related to the actual operation of OpenGL. The whole advantage of OpenGL is that it's cross-platform and you don't want to take away that advantage by writing OS-specific code. It is fun as an exercise for later, but it's not something a beginner should dive into.
  • [QUOTE=KillerJaguar;34894867]How do you guys record your stuff?[/QUOTE] On a side note, for anyone using OS X ( or anything else that uses quicktime I THINK, DON'T QOTE ME ) you can record your screen by using quicktime. [thumb]http://puu.sh/iCwY[/thumb] Then you can easily convert the video to various formats using... [url]http://www.mirovideoconverter.com/[/url] I do not know if anyone else knows this so I thought i'd share it anyway.
  • [QUOTE=Number-41;34894791] -snip- [/QUOTE] I have no idea what Latex is (except from the material), but why aren't you doing this is VB.net or whatever it is that Office uses?
  • [QUOTE=Darwin226;34893712]Tip for anyone that might need something like this. Calculating n^m can be done in log m complexity by squaring. The actual algorithm is [csharp]function Power (n, m) { result = 1; while (m > 0) { if (m % 2 == 1) result *= n; m >>= 1; n *= n; } return result; }[/csharp] Now for how it works. Every power can be expressed as either 2k or 2k + 1. That means that you can write 4^9 as 4^(4 * 2 + 1). You continue doing that until you have 4^(((2 * 2) * 2) + 1) The above code is does that gradually, going from outside to the inside. In case of m = 9, it would first multiply the result(1) with n(let's say 4) because 9 % 1 == 1. Then it divides 9 with 2 (the right shift operator, m is now 4) and squares n (n is now 16). 4 % 2 == 0 so it just divides it with 2 and squares n again (n is now 256, m is 2). Again, m % 2 == 0, just divide with 2 and square again (n is 65536, m is 1) In the last step, m % 2 == 1 (as it always will be in the last step) and we finally multiply the result with n. 4 * 65536 = 262144 = 4 ^ 9 The whole process takes 5 multiplications instead of 9. So it's even beneficial for small numbers. Naturally it performs many times better for large numbers.[/QUOTE] A bit late, but use ( m & 1 == 1 ) instead of ( m % 2 == 1 ). Unless I'm mistaken, modulo will require a division, which is pretty expensive.
  • [QUOTE=icantread49;34895077]why would i increase code complexity to shave off a pixel's worth of bytes considering the rest of the file is 250k+ pixels worth of uncompressed RGB(A) data?[/QUOTE] lol idk v:)v [editline]27th February 2012[/editline] [QUOTE=Darkwater124;34894892]> Put in Dropbox public folder[/QUOTE] terrible idea
  • Ugh my programming teacher just told us that he thinks "C++ and C will be completely dead within the 5 or so years due to the power and depth of Python." Oh boy...
  • [QUOTE=Ziks;34895620]A bit late, but use ( m & 1 == 1 ) instead of ( m % 2 == 1 ). Unless I'm mistaken, modulo will require a division, which is pretty expensive.[/QUOTE] Compilers usually optimize that. I did it with a modulo so it's easier to understand (or not, depending how you look at it).
  • they call it python because it feels like you're being constricted by one when you use it
  • [QUOTE=Socram;34895642]Ugh my programming teacher just told us that he thinks "C++ and C will be completely dead within the 5 or so years due to the power and depth of Python." Oh boy...[/QUOTE] Honestly, he might not be too far off with C++. Seeing as C will always have it's place in a lot of things. C++ might lose it's title as the "language in which games are made". There are already alternatives that are much easier to work with with very little performance loss.
  • [QUOTE=ROBO_DONUT;34894012]I'm using SDL at the moment, but SDL 1.3/2.0/Hg is far from ready for use, and SDL 1.2 is a little dated. Is GLFW recommended over SDL? What more does it offer?[/QUOTE] GLFW gives you an ultra light-weight no-frills simple and basic way of opening an OpenGL context and receive user input. (Keyboard/mouse/joystick.) Everything else is up to you. (Don't use the texture loading facilities, they're terrible. Try something like [url=http://nothings.org/stb_image.c]stb_image[/url].) I really like it. The only blot is the complete lack of error reporting. If it fails, you have to use a debugger to find out why.
  • Just a quick update for those who care, I'm starting to play around with reinforcement learning AI now, and will probably have some cool results soon, I have a few ideas that would be very cool to get working with it. :)
  • [QUOTE=Darwin226;34895765]The Python part is obviously bullshit.[/QUOTE] Yeah that was the part that really bothered me, he's been saying stupid shit like this all year.
  • [QUOTE=Darwin226;34895749]Honestly, he might not be too far off with C++. Seeing as C will always have it's place in a lot of things. C++ might lose it's title as the "language in which games are made". There are already alternatives that are much easier to work with with very little performance loss.[/QUOTE] C/C++ aren't ever going anywhere, enjoy finding a language to write a game in that runs on multiple platforms, including mobile platforms, without resorting to virtualization
  • [QUOTE=Darwin226;34895708]Compilers usually optimize that. I did it with a modulo so it's easier to understand (or not, depending how you look at it).[/QUOTE] I did a benchmark in C#. Apparently % 2 is even faster than & 1. I have no idea why but there it is. Similarly, % 1024 is faster than & 1023. [csharp] var timer = new Stopwatch(); timer.Start(); int a; for (int i = 0; i < 10000000; ++i) { a = 123456789 % 2; } timer.Stop(); Console.WriteLine((float)timer.ElapsedTicks / Stopwatch.Frequency * 1000); timer.Restart(); for (int i = 0; i < 10000000; ++i) { a = 123456789 & 1; } timer.Stop(); Console.WriteLine((float)timer.ElapsedTicks / Stopwatch.Frequency * 1000);[/csharp] Edit: Ignore the above, I'm an idiot.
  • [QUOTE=icantread49;34896128]that benchmark doesn't make any sense at all[/QUOTE] How exactly?
  • [QUOTE=Darwin226;34896000]I did a benchmark in C#. Apparently % 2 is even faster than & 1. I have no idea why but there it is. Similarly, % 1024 is faster than & 1023. [csharp] var timer = new Stopwatch(); timer.Start(); int a; for (int i = 0; i < 10000000; ++i) { a = 123456789 % 2; } timer.Stop(); Console.WriteLine((float)timer.ElapsedTicks / Stopwatch.Frequency * 1000); timer.Restart(); for (int i = 0; i < 10000000; ++i) { a = 123456789 & 1; } timer.Stop(); Console.WriteLine((float)timer.ElapsedTicks / Stopwatch.Frequency * 1000);[/csharp][/QUOTE] would the optimizer not turn (123456789 % 2) into 1?
  • [QUOTE=Overv;34894997]Because the code before the context creation is not part of the OpenGL spec. When you learn how to use wglCreateContext, you aren't learning how to use OpenGL, you are learning how to use the Win32 API.[/QUOTE] I'd rather learn how to use OpenGL as close to pure OpenGL as possible, and not through some third-party library or something. It reminds me of learning Lua through Garry's Mod all over again. There's nothing [i]wrong[/i] with it, but there are some bastardized things about it. For instance, you may never touch some aspects of Lua considering you have the entire GMod API to focus on rather than doing things like creating your own OO model for pure-Lua classes. I don't know diddly shit about OpenGL, but I feel like using one of these third-party frameworks would be somewhat similar in some regard.