Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
600 views

Is there a plugin example for SKSE Special Edition?

I'm having trouble creating a skse plugin for skyrim special edition. For the old version there is a example plugin: https://github.com/xanderdunn/skaar/releases/tag/plugin3 I've tried to do it by ...
0
votes
0answers
36 views

What is wrong with my collision detection?

I am trying to create a collision detection system between block using this code: ...
0
votes
1answer
80 views

C++ Mouse picking for ray to plane intersection

I'm making a C++/OpenGL application (decidedly without GLM), and I'd like to understand how to create a ray from the camera eye to the mouse pointer, as well as detect an intersection point from the ...
0
votes
1answer
82 views

What to do with collision detection?

I am able to get collision detection (CD) into my game but... what do I do with it? Do I push the player back to the last location? Something else? I am programming the game in C++ using the Irrlicht ...
0
votes
0answers
20 views

Jittery / stuttering motion when using SDL2

I've been using C++ and SDL2, but can't seem to get smooth motion when I have objects moving in the window. I was originally using SDL_GetTicks() and SDL_Delay() in my game loop, but one of the posts ...
2
votes
2answers
3k 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, ...
2
votes
2answers
45 views

How to update the value of all owners of shared_ptr?

I’m writing a render, there is a class that shaders should store, something like a shader manager. These shaders are stored as ...
1
vote
2answers
51 views

How to store ever-expanding maps with top-bottom, left-right hierarchy?

I'm writing a game that will largely take place on only a screen-worth of hexagons, but which will require map to expand in every direction. Also the way I want to display those hexagons requires that ...
1
vote
1answer
155 views

Box2D simulation running slower on lower FPS(even when the desired FPS is lower than the actual)

I´m playing around and trying to make myself an easy platformer using the Box2D physics, before that I was not using it and was using my own physics implementation(just simple movements with timestep)....
0
votes
0answers
20 views

How to use CreateGridMesh in RuntimeMeshComponent

I don't know to pass on the 5th parameter. I'm still new with C++ so if someone could help me with the pointer ...
0
votes
1answer
293 views

Failed LockRect of IDirect3DSurface9

I have hooked Present method of the IDirect3DDevice9 interface, and I want to be able to start video capturing. Taking a screenshoot like this work ...
-4
votes
0answers
79 views

Is it safe to access array past bounds? [on hold]

In a game engine, there are numerous structs like typedef struct { uint32_t w; uint32_t h; uint32_t pixels[1]; } bitmap_t; which are allocated like ...
1
vote
2answers
314 views

How to render a bevel effect with SDL2 Texture?

I develop 2D games using CodeBlocks (C++) with SDL2. I can load a texture (ex. a gray square) and render it to the screen. All is fine. If I want to change the color of the square? Yes, I can do it. ...
2
votes
1answer
3k views

Need Help with Cocos2d Ver 3.3 AudioEngine

I have 2 audio files that I want to play at different times: background.wav a sneeze.wav. I believe that I have to convert both wav files into mp3, caf and ogg files. Then I do this: ...
4
votes
1answer
781 views

A script isn't showing in the Content Browser

Just to set the tone, I'm very new to game development. I'm currently taking an online video course for Unreal Engine 4 that required me to create a C++ script. After I created the script and it ...
1
vote
1answer
404 views

Passing heightmap data to btHeightfieldTerrainShape constructor

I was searching for a couple of hours, but I didn't find final solution, after trying many ways. I'm trying to get heightmap heights data, and pass it to btHeightfieldTerrainShape. Let's say my ...
0
votes
0answers
30 views

Animated texture from movie file for pre-rendered custcenes

I'm at a point with my game/engine where I need to be able to display pre-rendered movies as cutscenes onto a plane as an animated texture, say something I rendered as an animation in a raytracer that ...
0
votes
1answer
246 views

Swept aabb 3d incorrect collision resolution along negative normals

I have followed this tutorial and ported it to 3d with glm. Everything works fine when the collision normal is reported as positive ((1,0,0),(0,1,0),(0,0,1)) but when it is negative the player aabb ...
0
votes
2answers
67 views

Implementing a main loop with rendering in a Windows Desktop Application

I'm writing the beginnings of a small game engine in Visual C++. What I have so far doesn't seem to be updating the rendering each frame, but I don't understand where I'm going wrong with it. The ...
1
vote
2answers
129 views

Is it possible to make desktop visible behind drawn object using SDL2?

I would like to draw an avatar over the desktop, something similar to those word 97 assistants, my idea so far is to make only the background transparent but I haven't had any luck, any suggestion? is ...
1
vote
1answer
664 views

Cocos2d - Physics bodies randomly loosing Velocity along an axis after impact

This just started occurring and seems to randomly happen during, and between, game sessions. A dynamic moving body collides with a static body and instead of bouncing off looses (almost completely) it'...
5
votes
1answer
289 views

Set the name of an animation in collada to be used by AssImp

I am using the collada file format to contain my model and animation but when I use AssImp to load the file the name will be empty for the animation. Where is the name for animation set on the collada ...
0
votes
1answer
73 views

How to implement an tooltip item cache?

I'm building a tooltip item like that I would like to keep this information cached on the client side, avoiding that whenever the information is displayed it's necessary to make a request to the ...
1
vote
1answer
712 views

Rotate camera around its center in 2D

I'm currently trying to develop my own little game engine (trying to understand maths in games). I have implemented 4x4 matrices and 2d vectors (I don't need 3d since I'm aiming at orthographic ...
0
votes
2answers
37 views

In Unreal Engine 4, how do I get the component's “game object” via C++?

I have an ACharacter instance with a weapons component that inherits from UActorComponentattached to it. I'm currently writing ...
4
votes
1answer
208 views

How do I detect image clicks in Dark GDK?

I am trying to determine if an image has been clicked, using the Dark GDK game engine. I've found no methods in the engine that do this. I would rather not brute force this with a large nested if/...
0
votes
1answer
139 views

Why separate data from logic?

I don't understand the purpose of separate SystemClass for functions. My composition looks like this: ...
1
vote
1answer
218 views

C++ - Assimp - OpenGL vertex data feed problem

I'm getting a very weird problem where OpenGL doesn't use the hardware to render anything, so I get just a cleared blank screen. Here's some code: ...
0
votes
2answers
97 views

Game movement in 2D SFML game

I am making simple 2D game, imagine it as 2D Minecraft where you can dig blocks and build other things. Currently I am struggling with movement. I have none experience in game development, but I am ...
1
vote
2answers
146 views

Are closing window and destroying DirectX11.1 independent?

I have a project with DirectX support. In this program uses two threads. One is a dedicated message loop and the second is executing DirectX API's. The question is about ending such program. The ...
1
vote
2answers
436 views

Proper way to update pixel array data

For a game that updates a board every frame I am calculating the next arrangement of board, updating pixel array data and render board as 2D texture to quad the size of the screen using OpenGL. I use:...
0
votes
2answers
71 views

How to load assets into the game engine editor fast?

I am making a game engine with C++ and OpenGL. Currently I'm stuck making the asset explorer. I would like to be able to import assets into an engine project and then when I open the project just use ...
2
votes
1answer
109 views

How to preserve Arcball rotation in c++ OpenGL?

Firts of all want to say that I've already searched for other people's answers here as same as Google and didn't found anything about it there. Also tried some others arcball implementations but none ...
0
votes
1answer
57 views

Problem with IsKeyPressed 2 times [closed]

i tried to make thing to show menu up by doing VK_MULTIPLY and close it by doing VK_MULTIPLY, but this does not work.. Anyone can help :) ? ...
2
votes
1answer
59 views

Locking object access with Allegro's threading API

If I have a data structure for the Allegro threading API as shown in the example here: https://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Threads And I lock the mutex, is there a way to have ...
2
votes
1answer
154 views

RogueLike - Map and Entities - how to store it?

Started to write my own RL, and already fell into analysis (paralysis?) when implementing map class. My TILE class looks like: ...
0
votes
1answer
174 views

Do I need a rendering system in my engine?

I am planning to create a cRPG game engine that would allow to easily create games like Baldur's Gate. I already tried to do that once, but my knowledge was vastly insufficient at the time. I settled ...
8
votes
2answers
933 views

Diamond-Square algorithm output is random and noisy

I have implemented a rough interpretation of the Diamond-Square algorithm in C++ to create some semi-realistic fractal terrain, but the output just seems like a random y value at each point rather ...
21
votes
5answers
4k views

Improving an O(N^2) function (all entities iterating over all other entities)

A little bit of background, I'm coding an evolution game with a friend in C++, using ENTT for the entity system. Creatures walk around in a 2D map, eat greens or other creatures, reproduce and their ...
0
votes
0answers
27 views

Box2D with SDL2 not working properly (Collision without rotation and problems with MKS)

I already have some expirience using SDL2 so I thought I will add a Physic Engine to my game - I chose Box2D. I managed to setup everything and to build a small program using SDL2 and Box2D. But now ...
-2
votes
1answer
58 views

Can't initialize array in C++ using const int value? [closed]

I am making a text based game. I want to make a 2d array of 'Rooms' in my 'GameWorld' class. I'm used to using C#, but am using C++ in order to learn it. The code I wrote I expected to work, but it ...
-2
votes
1answer
151 views

Why do I get this “no operator defined” error while making a logging system?

I am making a game engine and I'm working on a logging system. What I have so far is ...
0
votes
1answer
78 views

Why do i get this error in VS2017 but game compiles and works as expected?

I have this error, yet the game works and that variable ActorThatOpens get assigned correctly. In my header the includes are: ...
0
votes
0answers
62 views

What is the most efficient way of rendering a large number of SDL2 objects?

I'm trying to find the most efficient way of rendering a large number of SDL2 objects to the screen. Each of my objects have their own sprite sheets which are stored as SDL_Texture*. Currently my ...
0
votes
1answer
45 views

Confuddled with learning C++ / UE4 . Why can't I access this AActors properties?

Hello all I decided to punish myself further by now adding C++ to my list of things i know a little bit about. Some of it looks familiar having dealt with C# quite a bit, but i am getting caught out ...
0
votes
0answers
26 views

Using a PBO glTexSubImage2D with GL_PIXEL_UNPACK_BUFFER gives GL_INVALID_OPERATION

I plan to develop a tool for realtime video manipulation using C++, QT 4.7.4 and OpenGL and i'm on visual studio 2008. I check many web site but my code doesn't work since I try with PBO. At the ...
0
votes
1answer
30 views

Does SDL_SetThreadPriority work with std::thread

I'm trying to set the priority of my threads so that my UI thread can be given priority over background calculations. I noticed that SDL has a SDL_SetThreadPriority ...
0
votes
0answers
41 views

How can I spawn objects in a volume without intersection?

I am generating a 3D scene that involves spawning lots of 3D objects in a finite volume. I need to avoid intersection of objects.
1
vote
1answer
4k views

Parsing Blender exported collada file in c++

Since I could not find any libraries that can help me parse collada files in my c++/opengl project, I decided to write my own. (I did find assimp, but binaries for Visual Studio 2013 were't available, ...