jbb

Members
  • Content count

    125
  • Joined

  • Last visited

Community Reputation

471 Neutral

About jbb

  • Rank
    Member
  1. Coding-Style Poll

    As I posted already I don't really care about layout oriented standards. There are some i like better than others but I'll adopt whatever I'm required to with minor grumbling. More important are standards for the code itsself. Consistent ways of allocating memory. Consistent ways of using threads (Do we use queues, do we "ban" shared data?) Consistent ways of passing data. Do we prefer pass by pointer? Or reference? Do we prefer to allocate memory and pass it into a function to use like in C or do we let objects handle their own memory? Do we like shared pointers or do we prefer other ways to manage things? I find all of that matters more than layout but again, as long as it's not insane I don't much care the details. And then standards for accepting code? Do we insist on actual proper code reviews? Do we properly document what the changes are _for_ in source control and do we have one functional change per commit so we can manage them? How is code deployed? Do we need to write a backout plan for each change in case it fails to work in production... These things matter more than the detail
  2. Coding-Style Poll

    > (this applies to everyone posting here, as many have explained what they like to do but not how they would be bothered going against that)   I think it's difficult to answer that as an abstract question. Generally I'm not that bothered, there are things way more important than where braces and upper case letters go. But it depends on the specifics. Mostly I don't like the coding standards where I work but I accept them and it doesn't really bother me. But there are just a couple of things I find very hard to comply with :P I do though, and don't get upset about it.
  3. Coding-Style Poll

    These things used to matter to me. Now I got older and worked in more places i find myself caring less and less about the details. As long as the rules are somewhat consistent and applied properly i don't really care. The are more important things to worry about like writing correct elegant performant code to be bothered how we have to spell class names this week. I don't really care about brace placement as long as we have a scheme. I prefer not to have a C prefix on classes because its ugly and doesn't tell you much you can't infer from the code without it. I slightly like m_ because it tells you at a glance if the thing you updated is a temporary local thing or if it will persist... but none of them are deal breakers
  4. Thanks again all. ?Based on the comments I'm not going to try to support multiple windows :) My project doesn't need them anyway. My problem is that I identified 'Window' as being a good abstraction of something I'd need my application to have and a common one. And once I did that it because natural to ask does it make sense to have more than one window in an application.... Yes, it makes sense. And then the issue of how to implement it nagged and nagged at me leading to complete coding paralysis!   I have decided that I have no need to implement multiple windows/contexts in my project so I will not do. ?Having decided that it seems natural to merge window and context management into my 'Game' class as they don't really need their own identity and it's natural to have a single "Game" object created in a program but not so much a 'Window'
  5. Thanks everyone. I don't actually need this at all. As they say, I'm trying to make a game, not a general purpose engine, but it's always nice to separate components where possible and effective, so it seemed right to make a Window class which naturally lead to thinking what if the user makes more than one. Well my game isn't going to, and it looks tricky, so I'll probably come up with an alternative interface that assumes only one "window", precluding the question even arising. Still a useful discussion for me anyway, as it's lead to me looking into and understanding renderbuffers and fbo's and why I might use one :)
  6. Thanks, i looked into it now :) That makes a lot of sense and makes things very much easier as I can basically pick a single pixel format and use that for all my windows and hard code it and forget about all this. Hmm, does that mean I need a depth buffer on my render buffer and don't need to create my window with one...
  7. If I want to use multsampling on the output, don't I have to create a multisampled pixel format? Or are you saying I can create a multisampled render-to-texture and render to that, and then somehow copy that to the display? Won't that be slow?
  8. How do people manage multiple opengl contexts, if in fact they do? My code has a 'Window' class, so, in theory at least, you can create two or more windows. Each window can have it's own pixel format and opengl context due to the way it works. Now the problem is that before making *every* call to opengl I have to check that the current gl context is the correct one, and if not do wglMakeCurrent to switch to it. Or else I have to make a function on 'Window' called something like 'makeActive' before I do any opengl operations on it. And be sure to always remember to do this. My question is how do people cope with this? Is doing this very slow? Or do people generally not support more than one context in a program? Secondly, it seems that on windows at least, you have to call opengl functions via function pointers obtained from wglGetProcAddress and those pointers can be *different* for each context if they have different pixel formats. I am using multisampled output window in my main window and intend in a debug mode to have a separate window that doesn't need to have that so I *will* be having different pixel formats. So I can't just slap them into a lot of global variables. How do people cope with this? Or do people in general decide that supporting multiple windows is more effort than it's worth and find alternative solutions?
  9. OpenGL Vulkan is Next-Gen OpenGL

    Will it be possible to build a reasonably good version of opengl interface implemented on top of vulkan? I'm thinking that vulkan is supposed to be easier and smaller to implement than opengl so is less likely to have subtle bugs, and then if opengl can be implemented on top of it then the same opengl library can be shared across different hardware providers meaning that they are more likely to have the same bugs & features.  
  10. Ah yes, that makes a great deal more sense. So I can just keep a "pool" of buffers for each constant buffer and reuse them as the API finished with them. I guess D3D11 is doing this behind the scenes for me anyway
  11. My understanding then is that I need to create all buffers in my DX11 code fully initialized at create time and never overwrite them then? That if I want to charge the value I create a new buffer with the new contents? If that's correct how do I handle constant buffers that I need to change every frame? Create a new one every frame? That seems expensive?
  12. Thanks! Ok thanks for the comments on resources too. I can likely change my d3d11 code to work closer to that way too without any great loss.  
  13. Although I'm a professional C++ program my 3d stuff is strictly hobby only so I'm doing mostly what I enjoy rather than what makes sense commercially :) 1) Although I'm working with directx11 at the moment I keep an eye on opengl and I'm ensuring that I could fairly easily port my drawing code to opengl if I wish in future. I would like to port to directx12 when it's practical to do so. So I want to make sure I structure my code is such as way as to make it easy/efficient to do so. My understanding is that the main difference is that direct3d12 is stateless. That I need to submit all the render states, all the buffer mappings, all the texture mapping etc. in each rendering command at least conceptually. So I ought to organize my code that way now and ensure that my rending commands contain everything needed for the draw call (Buffers to map, Constants to set, Which render state set to use etc). Is this correct and is it sufficient? Basically is there anything else I need to do in organizing my code to facilitate later porting to D3D12? I don't mean detail of using the API as much as how to organize the higher level code to facilitate it 2) I see some slightly older graphics cards only advertise directx 11 support even now. Are these still usable through the directx 12 API in the same way that you can use directx 9 cards through the directx11 api with a reduced feature set? Or will they not work and I'll have to have a separate directx11 interface if I want to support them? (This all assumes that relevent driver support is still available for them of course). Thanks!
  14. After considering this some more I realized there isn't a code issue here, the issue is that I'm trying to design my game too much "bottom up" without considering how the low level compents will be used. it's clear now that I'll have some kind of "Level" class which represents one game level or world and that will load all of the ressources that items within it need when it is created and release them when it is destroyed. No real need to reference count or track usage. Just create everything on startup and release it on destruction. Other subsystems such as UI do similar with their own lifetimes. I guess the issue here is the one that people mention. Trying to build an "engine" rather than a game without having the previoius experience to understant how the engine will be used. (Not building an engine on purpose, its just how it works out if you do bottom up design only).
  15. Well, std::shared_ptr generally uses a mutex when you copy or destuct them which never is going to be fast. But point taken...