C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

learn more… | top users | synonyms

0
votes
0answers
36 views

C++ render Umlaute with Spritefont

I have a SpriteFont-Class and with that I render text to my game. Now my problem is, that it doesn't render Umlaute like ä, ü, ö, ß... Because I am German it is very important, that I can render these ...
1
vote
1answer
39 views

How do I toggle color writes in SlimDX 11/Direct3D 11 with FeatureLevel 10?

I'm having trouble setting the RenderTargetWriteMask field of a RenderTargetDescription struct. I simply want to toggle color writes but every time I try to enable the the color writes are changed ...
1
vote
1answer
110 views

Collisions being detected before objects are intersecting

I'm making space invaders (in OpenGL/SDL) and I'm currently having issues with getting the collisions (box collisions) between the bullets and the enemies to be properly detected. In my update() ...
0
votes
2answers
95 views

DeltaTime won't create smooth movement

The problem : I tried adding deltaTime into my game, which seems to not be working when I try to smoothly move a object in my game. How I calculate delta time : Delta Time variables : ...
0
votes
0answers
27 views

Methods to load .fbx using FBX SDK in binary data chunk

I am trying to acquire model information from .fbx in binary data chunk to see if loading time can be faster than regular accessing. For this purpose, I found a sample called "My Own Reader/Writer" ...
0
votes
1answer
75 views

Black Screen when using High-Performance NVIDIA Processor

I have an issue where my program renders a black screen on other computers. I narrowed it down to when a different graphics card is being used. When I run the program using Integrated Graphics ...
0
votes
1answer
109 views

Is it safe to set Lua Table data from multiple C++ threads?

As the title states. I'm curious if it's safe to set data in different Lua tables that exist in the same lua state. From multiple C++ threads. I'm asking this because my current system actually has a ...
0
votes
1answer
34 views

How to render IDirect3DSurface9 in my window?

I have some code that captures the screen and save data into a surface. g_pDirect3D_Device->GetFrontBufferData(0, pSurface); All is ok, now I want to display pSurface in my window. I want to ...
0
votes
1answer
65 views

Why does invoking glm::refract function return NaN?

At the present time, I make a simple raytracing project and I encounter an issue : When I invoking the glm::refract function, it returns me a vec3 with "NaN" values. However, my input data seems to be ...
4
votes
1answer
110 views

How would one generate a Navigation Grid for a 3d world?

I am attempting to find a solution to this problem. I'm trying to build a navigation mesh in the format of a grid of verticies locked to x,y floored coordinates in the shape of squares for 3D space. ...
0
votes
1answer
51 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
46 views

Allowing a unit to equip only certain types of weapons

I'm making a FireEmblem style game, and I am working on items at the moment. I have a Weapon class from which Sword, Axe, etc. are derived. I also have character classes like Swordsman, Mage, etc. I ...
1
vote
1answer
67 views

How to make a triangle move and rotate using GDI in C++

I want to make a triangle move from one place to another then rotate it 270 degrees using Polygon() function does anyone knows how to?? Just a simple one.
1
vote
1answer
50 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 ...
0
votes
0answers
27 views

Why does Intel Graphics Monitor crash after I set a depth stencil state in my Direct3D 11 application?

I'm programming a managed Direct3D 11 application with SlimDX. I want to use Intel Graphics Monitor to capture draw calls for a single frame. When I try to set a depth stencil state my application ...
0
votes
0answers
17 views

Cocos2dx : Lua with C++: lua_pcall closing my app

I'll try to explain what is happening with my current project: I want to make some custom scripts myself without using the lua script engine from cocos2dx, so I linked lua51.lib on Linker->Input, and ...
3
votes
0answers
50 views

Optimal batching for 2D objects with transparency

I have a collection of 2d objects with transparency. Each object has a depth value to determine draw order and a material. I'm trying to batch them in an optimal way to minimize draw calls. Assume ...
1
vote
1answer
49 views

How can I access the members of XMVECTOR?

So I have been reading these articles, and I find implementing them a trouble. Currently, all I am trying to do is add two vectors together, leaving my question more specifically this: How can I add ...
0
votes
0answers
62 views

Doing camera shake together with culling isometric tiles

Following this question, I've tried to do camera shake together with culling the tiles to no avail. The base code for camera shake is from this question. This is the code that I tried but failed ...
0
votes
4answers
81 views

Issue translating objects by one unit in the y direction

I'm currently making space invaders (in OpenGL/SDL) and I'm running into an issue with the movement of the aliens. I have a 2-d vector of aliens (5 rows of 11) and I'm translating each in the x ...
0
votes
1answer
85 views

Why does SDL render the background from the operating system to the window?

My code displays a fully transparent window that copies the background from the operating system. This is the code I use for rendering: void render() { SDL_RenderClear(renderer); ...
2
votes
2answers
121 views

Example/Tutorial of passing structured data over network C++

This is very general question, about strategies how to pack same informations about state of my game-world on server ( e.g. position/orientation of players, projectiles, etc. ) into data stream so ...
1
vote
0answers
67 views

Memory leak with glfwSetWindowTitle? [closed]

I am using GLFW for a game, and I have a function which allows me to set the window title. // PROBLEM WITH INCREASING MEMORY USAGE void WindowSystem::setTitle( const string & title ) ...
0
votes
1answer
80 views

Sprite quickly disappears after rendering

I'm currently making space invaders and I'm using the game loop pattern as described here. I have an entity class from which there is a spaceship derived class. The base entity class contains all of ...
0
votes
0answers
33 views

Screen Size 2D Gameboard Background

I am trying to get the screen size of the current monitor and then render the game board to match the screen orientation but currently I am scaling the game board to a larger size which not the best ...
0
votes
1answer
110 views

Updating a multithreaded Entity-Component-System

I am currently trying to implement an (sort-of) Entity-Component-System. I've got the gist of it, that is, how an ECS is supposed to work. So far i have 4 classes in my design (not yet fully ...
9
votes
1answer
123 views

Screen tearing in fragment shader on R9 380 GPUs

two players are encountering an issue with my game where the screen is tearing when it uses a fragment shader but it only seems to be doing this for players with a R9 380 GPU. Here is what it looks ...
2
votes
2answers
73 views

Calculate matrix transformation components separately

It is possible to calculate the translation, rotation and scale that were used to build a matrix? I mean if I have a matrix M can I calculate the rotation, scale, and translation it represents? Of ...
0
votes
1answer
74 views

How can I correctly instantiate an octree in UE4?

I tried to create a simple Octree like this: (I looked at the FMeshTriOctree source code since no question in answers.unrealengine.com helped me) // My FVertex class is slightly more complexe, but ...
0
votes
1answer
56 views

Sprite Sheet Texture not being rendered

I'm making space invaders (in OpenGL/SDL) and I've run into a problem when trying to draw the sprite for the spaceship from the spritesheet. In my entity class, I have a pointer for the sprite that ...
0
votes
0answers
45 views

Why won't my object go 3D DirectX11?

I am trying to make a 3d mesh within my code. For some reason it looks deformed, which makes no sense because I specified the vertices correctly I am pretty sure. Also sorry that I am posting loads of ...
0
votes
1answer
40 views

D3D11CreateDevice leads to syntax error [closed]

I'm following the book Introduction to 3D Game Programming with DirectX 11 by Frank Luna (link) and I'm trying to make the empty project in Chapter 4 (don't worry, I don't expect you to read the book) ...
1
vote
1answer
111 views

GLSL strange if statement problems

I'm trying to use if statement in my fragment shader. I want to compare my in int finalLightType[4]; Here is my vertex shader code and fragment shader code: Vertex: #version 400 core in vec3 ...
0
votes
0answers
22 views

Pleats and folding

We have a C++ module that produces mesh dynamically and simulates it with a physics engine. We want pleats on the surface of our mesh, pleats that remain sharp and folded during simulation while ...
0
votes
1answer
107 views

Best way to structure SDL2/C++ game? [closed]

I was reading some SDL2 tutorials and I noticed that you need to pass your window surface handle to any drawRect calls. Should I create a global surface handle or pass the handle by reference into ...
0
votes
1answer
149 views

How do you build a rotation matrix from a normalized vector?

I'm trying to find the correct way to build a rotation matrix from a unit vector. I have two arbitrary points in space (p1 and p2), and I'm trying to create the vertices for a rectangle to span ...
3
votes
1answer
65 views

Dynamically generating triangles from points

I'm working on 2D lighting. I have a list of points that have been calculated and when I draw lines from the light origin to the point it works. The problem is connecting the points into triangles. ...
0
votes
0answers
78 views

C++ timer for game loop(consistency across machines)

sorry I have been searching for ages and can't seem to get a good answer that I can understand, I am trying to make a game in my universities TL engine, and I can create a timer class fine, but I'm ...
1
vote
0answers
39 views

Drawing multiple polygons with vertex buffer object

I tried to create program in which I would draw multiplepoygons here is fragment of what I have done: GLuint VertexArrayID; exampleof drawing triangle(I have more polygons, like circle, and so ...
1
vote
0answers
19 views

Updating aiScene in ASSIMP with skeleton data

I am working on a project where I take an unrigged closed mesh, import it using ASSIMP, auto-rig it using the algorithm provided by Ilya Baran and Jovan Popovic and again export it using ASSIMP. I ...
0
votes
2answers
139 views

Switched from immediate mode to VBOs, game runs slower

trying to improve draw performance on my c++, OpenGL, SDL game. Back in school we mostly learned immediate mode, so thats how my drawing was originally implemented. When I started reading up online ...
0
votes
0answers
30 views

Open gl blending problem c++

im creating project from nearly scratch in c++.. i created skybox and terrain . the result is catastrophic ! the terrain goes away and the ground also goes away,i dont know why ! i tried to disable ...
-1
votes
1answer
98 views

C++: from LWJGL to C++ with OpenGL

I've been trying my best on porting my 3D game from Java to C++, but to no avail. I use only LWJGL with OpenGL but I cannot find any other library in C++ that supports as much as LWJGL does for Java. ...
0
votes
1answer
234 views

AABB Collision Problems in SFML

I have a problem with AABB collision. I am making a top down rougelike in SFML and my collision algorithm does't quite work properly. HERE IS A GIF OF THE PROBLEM. It mostly works, except for when ...
0
votes
0answers
83 views

How can I improve my ray casting algorithm

So I finished coding this ray casting algorithm in C++ and I feel like it could be improve, despite that, I believe that it is really good since it is coded using SFML. Here is the algorithm in C++ ...
0
votes
1answer
52 views

OpenGL dynamic font glyph cache library

I have begun work on an OpenGL application (all on my own and with little knowledge) and started with FTGL, rendering true type fonts, which, with alot of text has a great impact on frames per second. ...
0
votes
1answer
78 views

directX rotation of a 3d cube inconsistent

i'm trying to develope a simple 3d cube in directX that can be rotated in any direction by dragging the mouse. It works in the following way: i drag the mouse to the right or left, and the cube ...
1
vote
1answer
114 views

How can I render a texture to a polygon in SDL2? A fake 3D problem

I am working on a fake 3D game recently. The game is based on the perspective principle and using angular perspective. Here is a screen shot: But the problem is that the walls and floor displayed ...
4
votes
0answers
106 views

Windows vs OSX Performance with SDL, OpenGL [closed]

I have been writing an SDL OpenGL game in c++ for a couple of years now, writing my own engine for the most part (using Box2d for physics). I'm primarily a mac user, so I've been using xCode to write ...
0
votes
1answer
39 views

Is there a 'wait' function in Allegro5?

I am creating a game in allegro5 and I have come across a problem. I have a character that fires a shotgun and there needs to be a delay before he can shoot again. The code for shooting his gun is in ...