Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

1577 Excellent

About mrbastard

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. mrbastard

    Don't use Singletons for Event Managers!

    Hopefully I'll get some time this weekend to turn my demo into a glyphlet :¬)
  2. ars longa, vita brevis, laboro plus longa :¬(
  3. Overheard in the office "gpu makers build opengl drivers first then backport to d3d" ORLY!
  4. mrbastard

    Slowly becoming more and more disappointed...

    Gabe Newel lost a lot of respect when he did that. I knew Valve were readying their [url="http://store.steampowered.com/software/"]Appstore[/url] for steam and it just seemed like a really obvious dick move to play on his good guy reputation. The Register is going overboard with Windows 8 - their normal tactic of essentially trolling their readers into reading has become a daily stream of easily-checked untruths about Windows 8. People lap it up because hating the new windows is a thing. FWIW after using win8 on my tablet for the last several months my capsule review is : "meh". It's OK, Metro is nice but not worth paying for, the start screen is nice for anyone who uses the start menu with the keyboard anyway (i.e. properly), but there are a few things which make it less fun to use as a tablet OS than windows 7. The desktop on screen keyboard is less useable than in win 7, and I find it annoying that where in win 7 I could swipe to go back in IE and Explorer, in Win 8 that's been disabled - I guess some marketing person thought I might get confused about whether I was sitting down using a mouse or pawing at a touch-screen. I think the biggest problem is not just that consumers are confused, but that microsoft's marketing people seem utterly mystified. As usual I suppose. There's definitely some interesting psychology research to be done, on all sides ...
  5. mrbastard

    Let it begin

    Works here.
  6. The Hydrogen Sonata. Aw yeah.
  7. mrbastard

    Hieroglyph 3 and Metro Apps

    Nice work Jason, and an interesting read. Glad to hear you can consider Metro just another windowing framework wrt engine design. Hopefully we won't have too long to wait for D3D11 tablets - I'm itching to touch my shaders!
  8. mrbastard


  9. mrbastard

    The New C++ - lambdas

    Great post. For me, Lambdas make coding in c++ exciting again. The only thing I can compare it to is the fun of using lambdas / list comprehensions in Python - the code just flows from your fingertips as fast as you can think. Being able to use std algortihms without explicitly defining a functor makes a huge difference - even if I decide later that I'm going to use the lambda's logic in a few different scopes and it's worth redefining it as an explicit functor, the convenience of being able to write the initial logic without breaking flow to go away and write boilerplate is a huge productivity win. I found lambda syntax a bit odd at first too, but I really hope it becomes a mainstream part of the average c++ programmer's mental toolset. For all it's terseness, I think in time it will actually improve readability of c++ codebases. When trying to understand a bit of code, it's sometimes much easier to read some logic in place (in a lambda) than to have to go and read the header for a simple adapter or functor. One of the coolest uses of lambdas (I think) is to use them in place of 'bind' to combine functors or to do a sort of polymorphism of parameterisation. I've no idea what to call this, but essentially most situations where you want to have a collection of arbitrary functions to call on arbitrary data you can use lambdas to bundle up the logic and data into an object whose operator() that takes the appropriate minimal number and type of parameters for the collection. Unfortunately, lambda types being unrelated means you either have to use std::function or a template parameter to talk about your 'minimal' abstract functor interface. Maybe we'll get polymorphic lambdas (i.e. of related types) at some point. Still, a great way to write little adapters without needing lots of boilerplate.
  10. mrbastard

    Kinect Programming with Direct3D 11

    Cool stuff [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]
  11. mrbastard

    Smart Pointers Aren't Always So Smart

    IIRC another reason shared_ptr can be slow is that a heap alloc is used for the ref counter. It's a one-time hit, but it can be non-trivial to work out when it will occur unless your design is tight. (Edit: it's actually one time per ref counted class instance, of course) Check out Alexandrescu's Loki library and "Modern C++ Design" book for an in depth look at designing smart pointers, and a very customisable implementation which has template parameters controlling thread-safety, intrusiveness, etc. I've never used Loki, but Alexandrescu's discussion of the issues has definitely helped me when choosing a smart pointer for a particular situation.
  12. mrbastard

    Lies, damned lies, and API function names

    [size="2"]Apoch, your post puts me in mind of certain windows APIs.... [img]http://public.gamedev.net/public/style_emoticons/default/rolleyes.gif[/img] I've felt more like I'm reverse engineering or black-box testing than coding with some of them. Bugs 'suddenly' appearing in code which has apparently been shipping for the last ten years, and which tu[/size][size="2"]rns out to have always been wrong once you work out what msdn was actually trying to say (or not).[/size] [size=4] [/size]I actually like fairly long names, as long as they're appropriate and descriptive. It reduces the temptation for colleagues to add things that at a glance seem to fit, but which muddy or break the design. I've been guilty of the same, and sometimes a longer more specific name would have made me think twice about adding stuff. [quote name='freeworld' timestamp='1320166728'] is it common in the industry to have a class with functions, or just a group of functions that are basically just 4 lines of code? To keep the functions doing one thing only. [/quote] Assuming C++, here's a related quote from Stroustrup that really affected my thinking on design : [quote]My rule of thumb is that you should have a real class with an interface and a hidden representation if and only if you can consider an invariant for the class.[/quote] It took me years to really appreciate the depth of this insight. Free functions are incredibly valuable, as they have the minimum amount of coupling. They're the most reuseable thing in the toolbox. Classes are incredibly valuable as a way to enforce invariants over a group of functions and data. Without invariants to enforce, grouping functions in a class just makes the functions slightly more difficult to reuse. [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]
  13. mrbastard


    When you're nearing total market saturation, the only way left is Disney. [img]http://public.gamedev.net/public/style_emoticons/default/rolleyes.gif[/img]
  14. mrbastard

    Refactoring (again) the Accidental Noise Library

    An easy way to try paralellism and get a quick performance win would be to try Microsoft PPL or Intel TBB. If you use stl algorithms already (no idea if you do) you can pretty much just drop in the parallel equivalents. The algorithm/functor pattern makes it relatively simple to see how to be thread-safe with PPL/TBB too. Also worth looking at OpenMP if you prefer something a bit less stl-like. I wrote my mandelbrot renderer using std algorithms and lambdas, and got around 4x performance using PPL parallel_for instead of std::for_each in my outer loop (for each row of pixels in the image). Such an easy win! I also tried CUDA, but the speed-up wasn't as impressive as I'd hoped - between 1 and 2x over PPL. That said, my CUDA implementation is pretty naive, and I'm reading back the image every time. I imagine I'd get a lot of benefit if I was using an OpenGL/D3D texture instead of reading back to system memory, and rendering a constant stream of images rather than stalling after each one. I'm also pretty sure the unpredictable innermost loop which decides if a point is in the set is much less parallelism-friendly than most image synthesis stuff. So I highly recommend giving PPL/TBB/OpenMP/CUDA/whatever a go [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]
  15. mrbastard

    Color Rotation

    Awesome. I guess it's as useful as palette cycling - simple in itself, but great for adding a bit of interest. Especially as you allow synthesis functions as input. Does it work just with the RGB colour space, or others too? Have you thought about doing any other colour space transformations? No idea what use it'd be, but could be interesting!
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!