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
36 views

Scripting Language To Renderer Architecture

I am currently designing the scripting side of our engine. The idea is an entity-component system. That means most of the coding is done via jobs. The language we are using is compatible to C. The ...
2
votes
1answer
187 views

Smoothing multiple combined vector translations

I am currently working on my arm/weapon rig for an fps game written in a custom engine. I am to the point where I am implementing the movement of the arms/weapon (hereby referred to as weapon), for ...
0
votes
0answers
42 views

How do you use configuration files to describe the contents of an entity in an ECS-system?

One of the advantages that's often brought up when talking about ECS-systems is that they allow a higher degree of flexibility in regards to Data vs Code. Without the limitation of hard-coded types, ...
0
votes
1answer
51 views

posting cards in memory game

I am making a memory game using opengl and c++. I am able to post playing cards to the screen. I am having a problem posting two identical cards randomly to the screen. I am able to post 10 cards to ...
0
votes
0answers
32 views

How do I make a grid with heat data?

So I am working on a game in which I am working on a temperature system that goes about like this; Lines of latitude will be markers across the map, starting at 1 (north pole) going to 200 (south ...
0
votes
1answer
356 views

DirectX 11 Sprite Alpha (Invalid? + Bad Quality)

I have a bug with a texture font. This is the texture file in photoshop: This is the result I am getting: The alpha from 0 and 1 shows weird artifacts as the final result, alongside the low quality ...
16
votes
3answers
2k views

What's the largest "relative" level I can make using float?

Just like it was demonstrated with games like dungeon siege and KSP, a large enough level will start to have glitches because of how floating point works. You can't add 1e-20 to 1e20 without losing ...
0
votes
1answer
99 views

How would I go about coloring marching cubes terrain?

I'm making a game with marching cubes terrain (I know very original idea) and I don't exactly know how to color it. I have a system to do it, I just need to know how to interpolate it where it's not ...
2
votes
0answers
194 views
+50

How do different compositions/types of entities interact in an ECS-system?

I have a working ECS-system set up, largely inspired by this brilliant article (not at all required reading to be able to answer my question) on https://indiegamedev.net/ showcasing an ECS-system with ...
0
votes
1answer
162 views

I can't make the cube map to use shadow mapping - or it seems so

Basically, I'm following tutorials as I'm very new to OpenGL. I managed to perform shadow mapping towards just one direction, meaning I created 2D texture depth map. Now with omnidirectional shadow ...
0
votes
1answer
111 views

Difference between shader input element classification between D3D12 and Vulkan

I'm confused about the difference between the shader input element classifications in D3D12 and Vulkan. For example, in Vulkan I could have the following declarations: ...
1
vote
1answer
3k views

Creating a real loading screen between levels in Unreal Engine 4

I'm trying to create a loading screen to pop up between levels in Unreal Engine 4. I want to have a traditional loading screen such as the loading screen in Skyrim, where the player presses play and ...
-1
votes
0answers
116 views

How to build Assimp with MINGW and use it in my C++ project

I need to work with different 3D formats, just read and write, nothing else. After reading some threads here decided that Assimp could be the solution. I've downloaded the latest version of that ...
0
votes
1answer
79 views

How can I replicate jQuery's slideDown animation in SDL?

I'd like to know how I could make a slideDown animation in C++ using SDL. How would I implement the animation in SDL?
0
votes
1answer
312 views

Collision between a player and a solid block C++ SDL2

I am trying to implement a collision between a player and a solid e.g. a solid box. ...
0
votes
1answer
61 views

Distance between moving, rotated rectangles in snake game

I am trying to implement basic Snake game with movement based on timestep. For now I've got something along those lines: Update function: ...
0
votes
0answers
45 views

convert fbx to 3ds using assimp

I have found some kind of explanation about working with Asset-ImporterLib here. Unfortunately it's very badly done and really important things are not explained at all. There is a piece of code which ...
0
votes
1answer
60 views

How to use This Keyword and using iterators to call class methods?

I've been over this for a long time, I can't seem to understand what is wrong, is the use of the this keyword right? I want to add the instance of the class that is being created to the vector '...
0
votes
1answer
119 views

I can't figure out whats wrong with my .obj file reader

I'm just loading a simple textured cube but it always has missing bits or warped textures. This is for directx 11 rendering by the way. Updated with more information. I think my problem is with ...
0
votes
2answers
108 views

Collision detection between transformed meshes (not primitives)

I know questions related to collision detection have been asked multiple times, but I find all of them like this and this depend on the assumption that I have some sort of measurement of the object ...
3
votes
4answers
7k views

How to create custom gravity in unreal engine and only affect specific actors?

I am fairly new to unreal engine and I would like to know how to set custom gravity in a specific point or area instead of down. For example I do not want the gravity pull to be down but more to the ...
0
votes
0answers
15 views

SFML: Object's shape not rendered on the window

I want to be able to render sf::CircleShape (representing pointwise charges) when pressing mouse buttons on the window. The problem is easy enough, however the ...
0
votes
1answer
55 views

Unreal member variables reset between function calls

I'm trying to make a weapons switching mechanic in my game. My implementation is a data asset that contains an array of weapons with each weapon contatining the meshes, stats and a weapon actor ...
0
votes
0answers
21 views

Program doesn't detect a ray triangle intersection correctly

Every frame I check if a ray intersects a triangle. But in practice program tell me that triangle is intersected only when I move camera on to it's position. I don't even have to put cursor on a ...
0
votes
0answers
17 views

Applying HLSL Pixel Shader to RenderTarget in Directx11

I'm developing a unity native plugin and I'm new to DirectX11. In unity I pass input render target, depth and output render target to C++ side. ...
0
votes
1answer
87 views

Typical Point Light Flow?

A Quick Note This question assumes you have some knowledge about the overall rendering process and do not need clarification on rendering objects with HLSL and a <...
0
votes
1answer
40 views

Displaying debug line in custom raytracer implementation

Not sure if I should post this here or on the Math forum, but I will try my luck. Some background. I made my custom raytracer. The processing happens purely on the CPU for now, no GPU interaction ...
1
vote
1answer
2k 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 ...
0
votes
1answer
71 views

What to do with d3dx9math.h when converting to DirectX11?

I'm converting an old game from DirectX9 to DirectX11 and I have a question: What I should use instead of d3dx9math.h? Do I have to convert everything for ...
0
votes
1answer
74 views

Opengl - Know when a new frame is drawn, regardless of window

I want to know the framenumber of the current frame at any time, regardless the bound window or if it was changed. I dont want to implement a framecounter in my window class, since that would 1. ...
1
vote
2answers
252 views

How to keep same aspect ratio in different devices with cocos2dx?

I have been making a board game and I am using cocos2dx. There are two scenes for now, One is main menu and the other is gameplay scene. When I run the apk on tablet with EXACT_FIT resolution policy ...
0
votes
2answers
85 views

C++ Passing Functions to Objects/Projectile system woes

I am new to C++ development and I am trying to create a more flexible projectile system. In my current system I apply a equation to move the point down the bullet path. ...
0
votes
0answers
43 views

Rotate a texture around its center

I am tryna developing a little game library in C++ with OpenGl. I got stuck on the texture rendering step. My achieve is that to rotate the texture around its center. Now, I already know that the ...
0
votes
1answer
67 views

Update TTF Texture for Score

I have a little problem with Updating my Score with TTF. Im a neewbie so dont blame me :P I Try to Update my Score But the Buffer Get too small after a while and my Game Crashes. ...
1
vote
1answer
143 views

how to control units in a game using scripts

I'm looking to create a game like screeps, in which the user controls their units using javascript. I am planning on using lua as the scripting language that controls the units in my game, as it is ...
0
votes
1answer
87 views

Get BP FollowCamera Rotation and Location

I'm accessing my FollowCamera https://imgur.com/a/vbFagxg from my BluePrintCharacter class in my C++ code, with this following line : ...
0
votes
1answer
62 views

C++ Game multiplayer? (Mud)

I have made a simple turn based mud and wanted to implement a cheap way of allowing the client to host the game and others to join. Years back (I am just getting back into programming after a long ...
0
votes
0answers
35 views

How to properly terminate an openGL application?

I use GLFW in C++. I close my application the following way: ...
1
vote
1answer
108 views

Problems with porting LWJGL code to C++ (glDrawElements call returns error 1281/GL_INVALID_VALUE)

So, as the title might suggets, I'm currently trying to port a gui stack for my game engine from LWJGL(Java) to C++.I originally had this following code in java: ...
0
votes
1answer
102 views

VAO not showing

My VAO is simply not showing up and i'm not sure if my matrices are wrong or if the shader is wrong… Please have a look a see what is wrong… My code is big so i'll post the essential. ...
1
vote
1answer
555 views

Sniper aim prediction

I'm trying to make a sniper aim prediction for an Unreal Engine 4 game. I've found this interesting question Projectile Aim Prediction with Acceleration, and I tried to implement in C++ what DMGregory ...
0
votes
2answers
325 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 ...
0
votes
2answers
88 views

Trying To Restart My Shooting Arrow With Overlap

I am trying to restart my shooting arrow if the arrow hits the roof but the bool is not changing [and giving a] cast failed [error] this is my shooter character shooting arrow ...
1
vote
1answer
172 views

Vertexquads are not being drawn in 2D space

I started teaching myself DirectX a short time ago and have come across a problem which I can't figure out by myself unfortunately. I'm trying to build my own font system, so I can draw strings in 2D ...
0
votes
1answer
147 views

D3D9CAPS gives unusual maximum shader instructions value

I'm trying to implement a vertex and pixel shader on a piece of hardware we're developing a game for which uses the DirectX 9.0c runtime. The shaders are for boned mesh animation and is a bit more ...
3
votes
1answer
865 views

Specular Light not working (Phong Lighting)

There seems to be a problem with my current Phong Shading implementation. I have been using the per fragment approach. The specular highlight aspect of the technique is not rendering as it should, as ...
1
vote
1answer
669 views

Shooting Projectiles

I am using cocos2D-x and am trying to achieve the effect of enemies going past and shooting projectiles at the player who is moving around the screen. I am using the code below, which is based on this ...
7
votes
2answers
447 views

Why isn't my cbuffer updating?

I am really frustrated because my cbufer isn't updating. This is my VS: ...
0
votes
1answer
221 views

Reference sf::RenderWindow from another source file in SFML

In SFML, How would you be able to reference a window in your main.cpp file to another source file? I want to be able to reference the window made in ...

1
2 3 4 5
82