C++11 is the name of the C++ standard, approved in 2011. It replaces the previous C++03 standard, adding various core language changes and fixes, and an improved and expanded standard library.

learn more… | top users | synonyms

0
votes
1answer
39 views

Why isn't my cbuffer updating?

I am really frustrated because my cbufer isn't updating. This is my VS: cbuffer MatrixBuffer: register(b0) { float4x4 worldViewProj; }; struct VertexIn { float4 Pos : POSITION; float4 Color: COLOR; ...
2
votes
2answers
278 views

C++ struct doesn't align correctly to a pixel shader cbuffer

To expand from my previous question, I must add I can't correctly map my C++ structs to a corresponding cbuffer inside the pixel shader. When outputing random colors defined in the struct C++ side, it ...
0
votes
1answer
71 views

How to manage a vector of “Component” base class?

I'm trying to implement a component based design for a game i'm making. I decided to write it in c++ but i'm not very good at it. Coming from a java background I encountered a problem when trying to ...
0
votes
1answer
73 views

What's better - drawing every interval that the window updates, or drawing when necessary and updating when drawing?

So what's better? In case the title is a bit confusing I mean: 1) Drawing every window update interval. For example, for a 60FPS window, every 17 milliseconds. For example: ...
0
votes
1answer
22 views

sfml/opengl, two objects of same class are sharing variables

whenever I use the none-default constructor, it only adds to the coordinates of the previous class(in an array) wall_1x1 wall[2] = { wall_1x1(0, -2, 0), //first argument is x, second z, and ...
1
vote
2answers
256 views

How can I calculate the future position of my moving object?

I'm relatively new to games development and I have a 2D game where the playing area is an enclosed rectangle with width w and infinite height. In the playing area there is a ball. A gravity force of ...
1
vote
1answer
74 views

Registering a C++ callback with Lua API without additional libraries

Basically, I'm trying to register a callback into a Lua state like this: class MyClass { public: int myLuaFunction(lua_State* L) { //do something } }; I ...
3
votes
2answers
218 views

Space game: inheritance for spaceships?

In a space game I'm writing in C++11, I have a class Spaceship. Now I want to create 3 more spaceship types, how should I do? Attack type: have a weapon Research type: have a sensor Religious type: ...
6
votes
1answer
326 views

C++ exensible resource manager class with dynamic registration of factories

I've done some some research on my own, so I hope someone can help me finish it. I'm trying to replicate the design of an extensible asset manager featured in this answer. At the moment I have ...
0
votes
1answer
82 views

Collision response callback

First at all, I'm not asking how to handle or detect collision. I already have that. My actual situation is, I have a system collision and I detect the collisions. Every collision detected is store ...
1
vote
1answer
461 views

How can I do sprite batching in SFML?

I'm new to game dev and using SFML. I need to use lots of sprites at the same time, so I will probably need sprite batching. I know that sprite batching is used to draw multiple sprites with a single ...
3
votes
2answers
181 views

How to detect Lagoons and Lakes on a random Island Map

I have an engine which generates random Islands. At the moment it tends to generate quite a lot of lagoons and lakes. I would like to know of a feasible way of detecting them so that I can mark them ...
0
votes
1answer
129 views

Fullscreen FPS slowdown in Linux [closed]

I've got a homemade game engine that supports both Windows and Linux using Win32 and Xlib, respectively. By default, the engine will create the window and then switch it into fullscreen mode. When ...
5
votes
2answers
435 views

Lua Implementation

I'm struggling to get Lua implemented into my game engine. I've read dozens of blogs and articles revolving around how to wrap C++ classes and I seem to have hit a wall. No matter how I structure the ...
1
vote
0answers
172 views

Different way to pass uniforms to seperate draws in glMultiDrawElementsIndirect

Given OpenGL version 4.3 and GLSL 430, what would be the best way to pass a matrix to each model in a draw call to glMultiDrawElementsIndirect? I am thinking of going the way of a TBO and indexing it ...
0
votes
1answer
327 views

Can't read .cso files but I can read their .hlsl versions?

Well I've been trying to read a .cso file to use as a shader for a DirectX program I'm currently making. Problem is no matter how I implemented a way to read the file it never worked. And after ...
3
votes
1answer
364 views

Dynamic Quad/Oct Trees

I've recently discovered the power of Quadtrees and Octrees and their role in culling/LOD applications, however I've been pondering on the implementations for a Dynamic Quad/Oct Tree. Such tree would ...
0
votes
0answers
234 views

Separating Axis Theorem Issue

I am trying to create a 2d top down shooter using DirectX 11 (Windows 8 Store) and I am trying to implement OOBB collision using the Separating Axis Theorem. However I appear to have run into an ...
0
votes
1answer
352 views

Why does my SDL code crash when I move the mouse over the window?

Whenever I move my mouse below where the image renders in my game, the SDL window crashes and closes down. I have narrowed the crash down to the bit of code where I check to see if the Escape key ...
4
votes
2answers
444 views

a flexible data structure for geometries

What data structure would you use to represent meshes that are to be altered (e.g. adding or removing new faces, vertices and edges), and that have to be "studied" in different ways (e.g. finding all ...
2
votes
2answers
2k views

std::map for storing static const Objects

I am making a game similar to Minecraft, and I am trying to fine a way to keep a map of Block objects sorted by their id. This is almost identical to the way that Minecraft does it, in that they ...
5
votes
4answers
741 views

Creating a voxel world with 3D arrays using threads

I am making a voxel game (a bit like Minecraft) in C++(11), and I've come across an issue with creating a world efficiently. In my program, I have a World class, which holds a 3D array of Region ...
0
votes
1answer
2k views

How to use C++11 chrono header for a clock

In first, sorry for my bad english. :) I'm making a game using SFML and C++11 new features, but I've got a problem with my custom Clock class (made to replace the SFML one). When I get the elapsed ...
1
vote
1answer
149 views

Understanding VAOs and adding different arrays to VAOs

I'm really confused on what you do. I can do them, however I got this problem. Say you have several squares, say 1,000 squares. Now I can make a VAO for each 1,000 squares and then do some for loop to ...
5
votes
1answer
753 views

C++ SFML Box2D - Somewhat confused when it comes to syncing phyisical body with a render body

While testing Box2D with SFML I encountered something which confuses me: The relation between physical body centroids and SFML's sprite origin. As an example I have a test class GameObject which is ...
6
votes
2answers
717 views

How can a resource manager have dynamic loading/unloading without creating dangling pointers?

I have a resource manager that manages the lifetime of resources in memory. A "resource" is something like a texture, mesh, et cetera. I also have an entity class that, the base class for things in my ...
2
votes
1answer
1k views

How to handle a Tile Map Scrolling [duplicate]

i'm making a video game, and i'm having, i think, a concept problem. The game will be a platformer which will use tile maps, so to start i will create a mask matrix indicating the tiles to be loaded, ...
1
vote
1answer
899 views

does glBindAttribLocation silently ignore names not found in a shader?

Does glBindAttribLocation silently ignore names that are not found? For example, in a shader: // Some vertex shader in vec3 position; in vec3 normal; // ... And in some set up code: // While ...
-1
votes
4answers
8k views

How to check if a variable is an integer? [closed]

I'm going through my C++ book and have currently made a working Guess The Number game. The game generates a random number based on current time, has the user input their guess, and then tells them ...
-1
votes
1answer
226 views

Server fixed timestep not running at 30Hz but way way too fast [closed]

I'm trying to make my game's server thread run at a fixed 30Hz but can't figure out how. Basically, before I just had a stupid while(1) { //do everything as fast as you can} which means that for my ...
-1
votes
1answer
163 views

How To Buffer Many Vertex, Geometry, and Pixel Shaders

What is the best way to buffer Vertex Shaders, Pixel Shaders, etc into the Device/Device Context without having to reload them from the filesystem every time? ID3D11Device::CreateVertexShader ...
2
votes
1answer
3k views

DirectX / Instance Buffer - How To Use Instance Buffers To Enable Reuse of VertexBuffer Data?

I created a simple Model framework in C++ 11 so that the same model can be rendered in different parts of a scene. What I am trying to figure out is how to reference VertexBuffer data already "set" ...
-3
votes
2answers
375 views

Is C++ here to stay for at least a decade more? [closed]

C++\DX\openGL is the best bet for creating video games and game engines. Will in future, C++ would mantain its spot as the industry standard?
15
votes
2answers
3k views

Using C++11 for cross-platform Game Engine Development

Note: This is not a 'give your opinion' question about C++03 and C++11. Our game engine, written in C++03, is designed to be compiled on Windows, OSX and iOS. Linux support is planned for the (very) ...
2
votes
1answer
1k views

using std::chrono::steady_clock for timing

I was wondering if it would be a good idea to use the steady_clock class (in the C++ std libraries) for game timing. What are the pros/cons of using it as opposed to using a game library's timing ...
2
votes
5answers
1k views

Attach simple, portable 2D graphics for a c++ game

I have a game written in C++ (using STL and c++11 extensively). I would like to do the following things: Attach graphics to this game -> Think chessboard of some kind. I just need some pictures ...
10
votes
1answer
687 views

Do any of the current gen console or handheld compilers support C++11?

I am not asking for full support but do any of the current gen support C++11? I know VS C++ supports lambda and the auto keyword and I believe gcc supports both as well. Do any of the current gen ...