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

1
vote
0answers
14 views

error: ‘struct RakNet::SocketDescriptor’ has no member named ‘socketFamily’| [closed]

when i run my client code i get this error i using code::blocks and im linux system in the tutorial that i follow the code working without any errors my includes files in the project #include ...
0
votes
2answers
107 views

How to “reload” a TTF Text during runtime?

As the title says I would like to know how to reload a TTF_SDL Text during runtime in C++. What I want to do is to update all the values of the text each frame so I can, to example change the font ...
0
votes
2answers
86 views

How can I better structure my code to reduce coupling between input and graphics?

I've been working through a few OpenGL tutorials, and decided to give myself the exercise of trying to draw a grid, with the added requirement of being able to press the - and + keys to change the ...
0
votes
1answer
46 views

My Sprite class generates a EXC_BAD_ACCESS error, and is sometimes NULL? Rect has weird values?

So, lets start off with the weird Sprite* object sometimes being NULL. I run my game, the EXC_BAD_ACCESS error comes and sometimes, only sometimes my Sprite* has a value when it crashes. Sometimes ...
1
vote
1answer
45 views

How can I avoid referring directly to the state type when transition to new states in a state machine?

I finally found a good way to implement a "stack-of-states" to manage what screen I am on. Minimal example: class gameEngine { public: //Removes state at the "back" of the stack and puts the ...
-3
votes
1answer
78 views

Creating a Zelda-like map in pure C++ not working [closed]

I wanted to create a map like in Zelda, but it keeps showing hashtags instead of 1 on A1 and I don't know why. vector <string> A0 {"#","#","#","#","#","#","#","#","#","#"}; vector ...
5
votes
3answers
196 views

How to handle GameObjects that have been destroyed but are still held by others?

I'm developing my own game engine in C++ as a learning exercise. I have employed a fairly standard method of handling destroyed GameObjects: Mark them as destroyed Have the scene delete destroyed ...
3
votes
1answer
180 views

HTML UI with SDL2 [closed]

I realized that I need an HTML-like UI in my game, because by myself I wouldn't be able to achieve such effects (divs, text, coloring, and styling). So I started to look around for a HTML Engine for ...
0
votes
1answer
45 views

Pixel Shader from Visual Studio Graphics Diagnostics

i want to check my pixel shader variables in graphics diagnostics but unfortunately when i click start debugging in pixel history (mentioned below), a new tap will open and says source is not ...
2
votes
2answers
65 views

Should I be returning weak/shared_ptrs or unique_ptr's to my resources?

A friend of mine told me instead of normal pointers, I should use unique_ptr, i asked him why unique_ptr's if some resources are going to be shares, like multiple grass tiles, or enemies. I currently ...
1
vote
1answer
215 views

How can I compute delta time in a cross platform fashion in C++?

I need a way to get time for calculating the delta time. I see that OpenGL and GLFW have methods for it, but unfortunately I can't use them since I need to make server software too. What is the best ...
1
vote
0answers
56 views

Error “glGenBuffers is ambiguous” in Eclipse Mars [closed]

I have called a function, which is part of OpenGL correctly. uint vboId; glGenBuffers(1, &vboId); This is definitely correct because the program successfully runs. The error shown when I hover ...
1
vote
0answers
117 views

What LuaJit threading archietecture should I use?

I am in the process of designing my own Game Engine for use in a real time CRPG - think Baulder's Gate. I know most of my specifications right now, and I am currently in a planning phase. I chose Lua ...
1
vote
1answer
82 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
310 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
131 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
95 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
29 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 ...
2
votes
2answers
369 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
176 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
245 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
738 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
100 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
1k 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
227 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
161 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
551 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
249 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
490 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
389 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
277 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
565 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
549 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
809 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
3k 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
159 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
947 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
959 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
2k 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, ...
2
votes
1answer
1k 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
12k 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
255 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
168 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
4k 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" ...
-2
votes
2answers
399 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?
17
votes
2answers
4k 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
2k 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
728 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 ...