• What are you working on? v67 - March 2017
    3,527 replies, posted
[QUOTE=WTF Nuke;52041830]I'll try it again later when I have more space, I am running on hard drive fume at this point. Bash for windows also broke with error 0x80080005 so I can't try without a full reinstall, which means recompiling clang again. I glanced over the qt install process and it had a decent amount of steps, although looking at it again it just seems like installing different utilities.[/QUOTE] What distro are you uisng? The install process is literally just "pacman -S qt5-base" on arch. Unless of course you're trying to build it yourself, in which case things are a bit more complicated I guess.
WAIT there are instances where building something on linux is complicated??? I thought that was a windows only problem
[QUOTE=LennyPenny;52042339]WAIT there are instances where building something on linux is complicated??? I thought that was a windows only problem[/QUOTE] Cmake exists.
I know this doesn't really compare to building clang (ohgodwhy), but since Ubuntu's packages for cmake are pretty far behind (3.5.1 vs the current 3.8) and I wanted clang-tidy support (added in 3.6) I built cmake on UoW and... it was 100% painless. I'm a huge fan of UoW but to be honest I was surprised how seamless it all is. Only thing I want now is for the windows conhost to get cleaned up a little more (middle click to paste, anyone?)
[QUOTE=WTF Nuke;52040108]I'll try to get it running properly on my main PC in a month. I just felt overwhelmed with the dependency hell. I got templight running but now I need to get templight tools or templar to build, and they need qt or graphviz, and one of them needs boost. And then installing qt is another long dependent process. I'm beginning to wonder if open source software was a mistake.[/QUOTE] I totally get that, that's been my process of trying to build that slicer I'm contributing to. Space issues are why I also had to give up on Linux, the amount of room I had to dual-boot on my Surface simply wasn't sufficient to get the job done. But Linux feels so much easier for doing most dev work. Once VS is ported to Linux (and I refuse to believe MS won't do it eventually, given their own investment in Linux) I imagine that'll be my main platform of choice. [editline]edited[/editline] Speaking of platform fun, getting Hana to work is just a [I]ball[/I]. It doesn't support MSVC, but the v141 toolset in VS2017 should bring it up to full C++14 compatability, even though Hana asserts otherwise. But the plans I have for Hana (namely, reflection on renderable types) are going ot make certain things so much easier that I don't see a way of not using Hana and I don't want to use the MPL or other boost metaprogramming libraries because of compile times.
[img]http://i.imgur.com/mR7J7or.jpg[/img] I just put the finishing touches on my MTG program. This is something I started writing about 5 years ago, but never got any further than pulling cards from the internet because that was about as far as my programming ability reached. Finally decided to return to it 2-3 weeks ago, and I now I have a fully functional way to play MTG over the internet with someone. Simply feed it a decklist like this: [code] 18 Swamp 1 Gatekeeper of Malakir 1 Plains 1 Vampire Outcasts 3 Sign in Blood 2 Vampire Lacerator 1 Tormented Soul 1 Vault of the Archangel 3 Vampire Nighthawk 3 Skinrender ..... [/code] The other player does the same, and then the program does the rest. The way I coded it is stupid awful, but I'm just proud that I managed to actually do it. It's a shame I only managed to do it now instead of 5 years ago when still I had a bunch of friends who I played Magic with regularly.
[QUOTE=Dr Magnusson;52038626]I wrote a long post about what I've been doing with constexprs and lambda and C++17, making the usefulness and speed of my pattern library so much better, but then I discovered a bug in it and spent an hour and a half fixing it, and then CloudFlare ate my post. So here's a basic example instead, a simple key:value list parser [/QUOTE] Looks like a parser combinator library. Too bad you can't have custom operators in C++.
I think we have enough weird operators that can be abused. The majestic >>, the wondrous ->*, and who can forget our old friends & and |
We need '><' and '?' operators, and while we're at it a '^' operator that at compile time swaps out with the char right above it
Stroustrup agrees: [url]http://www.stroustrup.com/whitespace98.pdf[/url]
[QUOTE=Darwin226;52045520]Looks like a parser combinator library. Too bad you can't have custom operators in C++.[/QUOTE] You're right. The difference between my library, and something like Spirit X3, is that everything except the matching itself is 100% constant expressions, meaning that the compiler could theoretically reason about the entire parsing process and generate extremely fast code, which would rival writing the entire parser by hand. It's also completely type-agnostic, and will work just as well on a string as it will a vector of numbers, if you're trying to find the longest sequence of primes, or sorted numbers, a fibonacci sequence, or what have you.
[QUOTE=Dr Magnusson;52047404]You're right. The difference between my library, and something like Spirit X3, is that everything except the matching itself is 100% constant expressions, meaning that the compiler could theoretically reason about the entire parsing process and generate extremely fast code, which would rival writing the entire parser by hand. It's also completely type-agnostic, and will work just as well on a string as it will a vector of numbers, if you're trying to find the longest sequence of primes, or sorted numbers, a fibonacci sequence, or what have you.[/QUOTE] Yeah but I'm doubting the compiler would have enough domain knowledge to optimize a parser. I'm guessing the biggest gains you could get there is by rearranging branches and stuff like that. Unless you're talking about removing the abstraction overhead and making it as fast as hand written loops and stuff.
[QUOTE=Darwin226;52047513]Yeah but I'm doubting the compiler would have enough domain knowledge to optimize a parser. I'm guessing the biggest gains you could get there is by rearranging branches and stuff like that. Unless you're talking about removing the abstraction overhead and making it as fast as hand written loops and stuff.[/QUOTE] Yeah I just meant the overhead. Writing a parser by hand can get extremely messy and very quickly gets out of hand, at least in my opinion. Constexpr parser combinators provide a theoretically zero-overhead abstraction over the messy internals of a parser, using high-level concepts. In past iterations of the library that were further ahead than this one is, I managed to implement a lot of optimization strategies to limit the amount of branches, like zipping two similar lists of literals so: [cpp] "hello there" | "hello world" [/cpp] becomes [cpp] "hello " + ("there" | "world") [/cpp] Since the patterns exist at compile-time, these kinds of optimizations can be implemented using template metaprogramming, although as I said, I haven't gotten around to implementing them in this iteration yet.
[QUOTE=Dr Magnusson;52047552]Yeah I just meant the overhead. Writing a parser by hand can get extremely messy and very quickly gets out of hand, at least in my opinion. Constexpr parser combinators provide a theoretically zero-overhead abstraction over the messy internals of a parser, using high-level concepts. In past iterations of the library that were further ahead than this one is, I managed to implement a lot of optimization strategies to limit the amount of branches, like zipping two similar lists of literals so: [cpp] "hello there" | "hello world" [/cpp] becomes [cpp] "hello " + ("there" | "world") [/cpp] Since the patterns exist at compile-time, these kinds of optimizations can be implemented using template metaprogramming, although as I said, I haven't gotten around to implementing them in this iteration yet.[/QUOTE] Jesus christ every time I learn more about constexpr and template metaprogramming I just become more and more convinced its all fucking sorcery. Some [I]really[/I] insane template metaprogramming is at the core of one of our biggest products at work and I've been trying to glean what I can from it and the guy who wrote it. Learning about this stuff is tons of fun but is also super challenging, so I was pretty bummed to hear that a long post you wrote got welped. Your stuff is usually pretty damn educational, so it would've been nice to see. I'm still muddling my way through using template metaprogramming to make my renderer system act more like a renderer proper, and I'm stuck at trying to grok tag dispatching and how I can use it to tag something like a "DeviceResource" struct with the type of OpenGL resource it is (buffer, FBO, VAO, Texture, etc), so that I can change what kind of constructor and destructor I use accordingly.
[media]https://youtu.be/7ezlPdHRslA[/media] Lots of changes to the Marching Cubes terrain I posted a while back! Added chunks so that you can have multiple high-resolution volumes stitched together nice and clean, added triplanar texturing, some new tools and settings to make sculpting more intuitive including a "block" mode so that you can flatten surfaces and build nice "even" structures. Have a few other little ideas to push in before release but it'll be so refreshing to finally work on something new for a change.
A coworker of mine just showed me visual studio hitting a breakpoint on a thing I've never seen before. "_that is 0x10" what the fuck is a _that pointer.
[QUOTE=FalconKrunch;52052717]A coworker of mine just showed me visual studio hitting a breakpoint on a thing I've never seen before. "_that is 0x10" what the fuck is a _that pointer.[/QUOTE] That seems like a variable name. You can right-click breakpoints in VS to make them conditional. [editline]3rd April 2017[/editline] [QUOTE=Dr Magnusson;52038626]I wrote a long post [...] and then CloudFlare ate my post. [...] [...][/QUOTE] [URL="https://chrome.google.com/webstore/detail/lazarus-form-recovery/loljledaigphbcpfhfmgopdkppkifgno"]Lazarus is available for Chrome too[/URL], though apparently it's not as good as the Firefox version (as of late 2015, so they may have fixed it). Going 'back' may also restore what you wrote without extension (at least in Firefox).
Only reference i can find is this: [url]http://www.dotnetframework.org/default.aspx/DotNET/DotNET/8@0/untmp/WIN_WINDOWS/lh_tools_devdiv_wpf/Windows/wcp/Framework/System/Windows/Interop/HwndHost@cs/5/HwndHost@cs[/url] The C++17 changelog has been released: [url]https://isocpp.org/files/papers/p0636r0.html[/url] Constexpr if ([url]http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0292r2.html[/url]) seems like a very useful thing to have for metaprogramming. And inline variables ([url]http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0386r2.pdf[/url]) are very neat.
read the book [t]http://i.imgur.com/nrqTXuH.gif[/t] [B]READ THE GOD DAMN BOOK ALREADY[/B] [t]http://i.imgur.com/0GsYEi0.gif[/t]
My project got corrupted while upgrading to Unity5.6. Now I'm working on fixing all textmesh pro instances. Also it seems like they actually put in some more effort to make the networking reliably. I had a small bug in a part of my code where I sent the network "ready" event and so far it wasn't any problem. In 5.6 however it produced an error, which is nice, better to have it check all sorts of things for you and alert you as soon as possible, rather than randomly crashing and failing long after I think I'm done :P I hope I can finish this TMP stuff soon, so I can put some more work into making my AIController more trolly haha.
Okay so it still hurts my head and I'm fairly certain I'm doing this poorly, but std::integral_constant and such can make neat things like tag dispatching fairly simple and easy to implement [cpp] // Buffer object (vertex buffer, index buffer, etc) using BUF = std::integral_constant<unsigned int, 0>; // Texture object using TEX = std::integral_constant<unsigned int, 1>; // Framebuffer object using FBO = std::integral_constant<unsigned int, 2>; template<typename resource_type, size_t num_resources = 1> struct device_resource { device_resource() { generate_resource_impl(*this, typename resource_type::type()); std::cerr << "Created a resource" << std::endl; } ~device_resource(){ // Resources that have had data moved out of them will still reach this dtor, only call // GL resource destroy func if elements of handles are not zero if (!std::any_of(handles.cbegin(), handles.cend(), [](const GLuint& n) { return n == 0; })) { destroy_resource_impl(*this, typename resource_type::type()); } } void generate_resource() { generate_resource_impl(*this, typename resource_type::type()); } std::array<GLuint, num_resources> handles; // Operator to access individual resource handles const GLuint& operator[](const size_t& idx) const { return handles[idx]; } device_resource(const device_resource& other) = delete; device_resource& operator=(const device_resource& other) = delete; device_resource(device_resource&& other) noexcept : handles(other.handles) { other.handles.assign(0); } device_resource& operator=(device_resource&& other) noexcept { handles = other.handles; other.handles.assign(0); return *this; } }; template<typename T, size_t cnt> void generate_resource_impl(device_resource<T, cnt>& resource, BUF){ glCreateBuffers(cnt, &resource.handles[0]); } template<typename T, size_t cnt> void destroy_resource_impl(device_resource<T, cnt>& resource, BUF){ glDeleteBuffers(cnt, &resource.handles[0]); } // There are a ton more of these, but these get the point across... [/cpp] In this case, I can keep this one device_resource struct to handle most of the OpenGL device resources I can/will generate. Work stuff has left me with a bad aftertaste when it comes to lots of inheritance and such, and its really silly to do inheritance for a simple OpenGL wrapper struct when templates will do. I've seen folks get crazier with using macros to further reduce the amount of individual code that has to be written (for now, I do have a fairly high number of generate_resource_impl methods, I guess), but I'm not super comfy with macros and this should be nice to integrate into my rendering engine once I expand on this a bit. It took me long enough to figure out how to allow for multiple resources to be generated while keeping the same struct and system - I kinda felt dumb when I found the solution, since its kinda obvious and std::array helps alleviate some of the pain that could've been caused by making handles a raw GLuint pointer. It also makes checking for a "null" set of handles not too difficult, I can't just check for nullptr so the next best thing is using std::any_of to make sure my handles are non-zero (iirc, OpenGL doesn't use 0 as an object name ever). since there are several experienced TMP folks in this thread, pls tell me if I'm doing a dreadful thing so I can improve. I'm intending to look more through std::array, since there's probably quite a bit I can learn/borrow from that. I'm unduly proud of myself though, I've been struggling with trying to understand this for a few days now and I nearly shouted "fuck yes!" at work when it compiled the first time and didn't give me template vomit :v:
I just spent about thee hours after already being late for bed improving my libclang based reflection system - turns out I was handling typedef resolution incorrectly, resulting in the <cstdint> types not being reflected. Now that that's fixed I can use my beloved uintxx_t types in code parsed by the reflection generation tool, so yay! That not taking three hours obviously, the runtime API for the reflection data now also exposes more information - it's now trivial to query a class for all its fields AND also ask the fields what class they actually live in for inheritance chains.
Hey, i'm looking to learn shell scripting for scripts w/cygwin on windows. On first run I want it to ask for a settings save directory, and then later use that for program logic. What's the idiomatic way of doing this? (preferably a way that works both on windows and linux systems). EDIT: Meaning a way for it to check if it was configured, and if it was use that saved dir for cool stuff.
Hello everybody! Ever wanted an RPG that you can finish in one sitting? [B]1001 Journeys Of A Hero[/B] [url]https://play.google.com/store/apps/details?id=com.bitbit.herojourney[/url] Embark on a board game-like RPG adventures to slay the Demon Lord! A simple and quick adventure, perfect to be played on the go. No two adventure will be the same! Compete against 4 other heroes! Engage various events that will affect your success. Test your luck, reflex, and memory to triumph! Collect various treasure on your journey, inherit them as divine heirloom! [IMG]https://lh3.googleusercontent.com/JPKnVEY_d77bhx9DSHaluAr38iHIvFs3DboV8YFh8ofSaq1RIN6J5hTnvIfuSLzqWco=h310-rw[/IMG] [IMG]https://lh3.googleusercontent.com/qTGCseuIuJSa03ZQLgPF9oSfTWQS1V7HZj9qFdOX-PwNeCxovrNfW6c3Swm7d96cpEo=h310-rw[/IMG] [IMG]https://lh3.googleusercontent.com/uQhhfHrLpZH6E87omrl7pd6h6dwPR3QVAxaeYEF_JYjrnlT7j4Z1xn5qSSm4nZEtpQ=h310-rw[/IMG] [t]https://lh3.googleusercontent.com/sFW-6Dus2nhNum-5Pn18kSQC0myYM773l5SC9Q6DD9bBP88gyDjEBhp5c-SfObbMXOs=h900-rw[/t] Ok now that the sales talk is out of the way... This is my first project to be released publicly. It's in dire need of other's opinions for improvements. It's basically a board game where you take turns to roll dice, move, and various events will unfold. Repeat until you reach Demon Lord castle, and see if you can defeat him. Please try it! I'm counting on your feedback to improve it. Thanks in advance. Oh I forgot the instruction. -Basically, every time your turns starts, you roll a dice. -The number will indicate how many space you would move. You can't control directly where you will move, it's decided by the dice roll. -Then your character will move, and after reaching the destination, an event will unfold. -Depending on the events, some you have control over; some depends on your luck. Some is pure 'lucky' event, some pure 'unfortunate' events, and others are mixed bag. -Then then next hero will have their turns. Repeat the cycle until you reach the Demon Lord castle! Have fun! Don't forget to tell me what to improve. [url]https://play.google.com/store/apps/details?id=com.bitbit.herojourney[/url]
Can anyone think of any instances of animated textures being used in 3D games that isn't water/lava, a particle system (ie fire) or a UI element? I'm trying to justify supporting animated textures in my engine, because as it is right now its gonna be a can of worms to implement.
Half-Life uses animated textures for things like blinkenlights and monitors.
[QUOTE=Karmah;52064307]Can anyone think of any instances of animated textures being used in 3D games that isn't water/lava, a particle system (ie fire) or a UI element? I'm trying to justify supporting animated textures in my engine, because as it is right now its gonna be a can of worms to implement.[/QUOTE] just put them all on one texture and flip through the texture coords, job done
[QUOTE=layla;52064332]just put them all on one texture and flip through the texture coords, job done[/QUOTE] I use bindless textures in my engine for all my geometry. My texture manager stores 64 bit texture handles in an array and sends that to the fragment shader once. Each face of a model has a desired spot in that array. The result is that each texture of a model can technically use a completely separate texture, and then I can render an entire complex scene in 1 call. I understand how I could modulate the UV's by scaling them back and translating them about, but this could only be done per model, meaning [I]every[/I] texture would transform this way, breaking the non-animated ones. (The simplest route I can see would be to modify the slot in the texture bank corresponding to the desired animated texture, which would require modifying my texture importing procedure as well as needing an animation manager - the metaphorical can of worms I'm unsure of if I even need to open)
You probably wouldn't want to CPU manage it, you would want to make the GPU time aware instead, and have a start/speed/duration calculation there, especially if you have bindless textures. I guess this is a deferred shading pass, where you're trying to keep everything monolithic? In would expect you'll run in some more exceptions then just animations. I would put the texture handle in a 'struct' and add a union for keeping the rendering properties such as animations.
i love learning a new language. programming in swift makes me feel like a wizard when it works.
Sorry, you need to Log In to post a reply to this thread.