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
0answers
28 views

MingW for commercial projects [closed]

Coming from a Linux perspective where I can use Gcc / Clang for most everything, and that I understand a triple-a title would never do this: Is MingW viable for building and distributing a commercial ...
3
votes
1answer
165 views

C++ Wrapper class for raw pointer to an SDL_Texture

First time in game dev, so go easy on me. I understand it's senseless to copy textures, but I'm trying to see this from a copy/move perspective since there is a lot of that going on in my code and in ...
0
votes
0answers
64 views

Algorithm for drawing DOOM-Style 3D Maps in c++ without graphic APIs

I need an algorithm for drawing maps like the DOOM example below: This is not what I am wanting: This is a Wolfenstein 3D image where it has a wall, ceiling, and floor, not rooms over rooms or steps ...
1
vote
1answer
23 views

Problem with rendering a quad from four lines

I am having a problem with rendering a quad in opengl via 4 lines (5 vertices via GL_LINE_STRIP). The rendering is generally working fine in terms of connecting the lines into a quad. The problem is, ...
0
votes
0answers
20 views

Libnoise bounding box - from spherical to planar

I'm trying to convert a bounding box inside a spherical map (equirectangular image as a result of Libnoise/c++) into a planar projection, but I can't find the correct algorithm for it and I'm not good ...
0
votes
0answers
25 views

what exactly is the logic behind 6502 and precise clock cycle emulation?

Key questions to consider based on page 10 of this document: http://archive.6502.org/datasheets/rockwell_r650x_r651x.pdf What does page 10 imply by "Add 1 to N if page boundary is crossed"? What ...
0
votes
0answers
16 views

How to store UI data?

I'm building a platformer using SFML and C++. Right now, I'm storing all data (texture info, sprite info, level data, audio info) in JSON files, which are then dynamically loaded and unloaded. However,...
0
votes
2answers
45 views

UE4 Code Project is not showing sub folders created within C++ Classes Folder even though they exist

These were my steps. Created an empty code project in UDK4. The editor starts up. On the left bottom you have: If you try to right click on C++ Classes, Or select [Add New] while having C++ Classes ...
0
votes
1answer
55 views

C++:Segmentation fault (core dumped) while creating gameobject

i made a small code to debug and i get this error player inherit from gameobject code ...
-1
votes
0answers
60 views

Draw a Diagonal Lines in the image by using c/c++

I have an image and wants to draw multiple diagonal lines in the image. if we look into main program it takes input bmp file and generates one pattern. what I need to insert diagonal lines in that ...
0
votes
1answer
86 views

The A * algorithm in the map has many moving objects

I am using the A * algorithm for my game, it is a kind of Isometric map with lots of tiles. If all the game objects are trees, rocks, houses and only one game object is a moving hero, the A * ...
0
votes
0answers
41 views

Cyclone LED gaming code HOW TO HELP?

I am very new to programming. For a project I decided to make a game of cyclone using some LEDs,a push button, and a raspberry pi. I researched how to at least start on the game, but the problem that ...
-1
votes
1answer
46 views

C++: passing gameobject as a parameter and then into vector

firstly iam used to java and new to c++ so maybe this will looks a noob's question i will explain this and give a pseudo code and then c++ just so you can understand me i have a player class which ...
2
votes
0answers
88 views

Structure for a strategy game

I am making a strategy game like Age of Empires. It's a pretty big project and I need a clear game structure. I have defined a Game_Object class with variables ...
0
votes
1answer
39 views

Could not load PNG in SDL2?

I have three image files, one is Techs.png, one is Techs.gif and one is Techs.bmp. I have used SDL_image 2.0.5 and SDL 2. When I load the image of Techs.gif and Techs.bmp, there is no error, but when ...
0
votes
1answer
38 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. ...
4
votes
1answer
300 views

What Situations is Saving a Game to Main Memory for?

I've been reading through Unreal's 'Saving and Loading' guide: Link Within, they present a capability to save a game to main memory rather than secondary storage: I haven't found any information on ...
-1
votes
0answers
59 views

asteroids bullet hits the enemy ship

I am making an asteroids like game with 2 space ships. Well I have drawn 2 ships on the screen. Each ship can move and fire bullets at the enemy ship. I am using the sin and cos functions to make the ...
-2
votes
2answers
86 views

Loading the map from an image file in C++

For my platformer tile-based game I want to be able to load the game map from an image file. Consider the following 25x15 px .png (enlarged) representing some level: Assume that each specified ...
1
vote
1answer
55 views

SIMD and Inverse Tangent

I'm calculating spherical UV coordinates in a loop, trying to get GCC to vectorize the code. Here's a compile-able example of what it looks like. ...
1
vote
0answers
31 views

Bullet Physics stops detecting collision after a few steps

Let me start off by saying that the usage of Bullet here is slightly unconventional. I'm writing a server emulator for a game, and the server is only keeping track of the triggers, players and enemies....
0
votes
0answers
21 views

How to static link modules using static variable constructor?

I'm trying to make my game engine supports both static and shared linked modules. Basically I have a CREATE_MODULE macro that have 2 implementations. This is based on Unreal's method. ...
0
votes
1answer
55 views

Unreal C++ Detecting new Key Down during current Key Hold

I am currently working on a combat system and I wanted to be able to have key combos to execute combat moves and such, and I am detecting key input type as well for example, if the key is tapped, or ...
0
votes
0answers
6 views

Explicitly Loading a Ogre3D DLL wrapper with OgreMainStatic.lib linked crashes when loading a mesh with CreateEntity

I have a Ogre3D 1.7.x DLL wrapper project that explicitly loads Ogre functions and works ok using the OgreMain.dll + D3D9 Renderer plugin.dll which loads a mesh without any problems. This is my setup: ...
1
vote
0answers
70 views

Trying to Rotate terrain

I'm new to OpenGL and don't really know how to rotate a terrain. For my graphics class, I have a project I need to do that is making a tire using OpenGL and work that we done in class (my framework is ...
0
votes
0answers
48 views

Need help with a 'Read access violation' exception in an SFML/C++ project:

I'm recently learning to make a 2d game in SFML using a tutorial series on youtube by Suraj Sharma(Video 57): https://www.youtube.com/watch?v=kwd_AVCkvXE&list=PL6xSOsbVA1ebkU66okpi-KViAO8_9DJKg&...
1
vote
1answer
53 views

C++ SDL2:2D tilemap with every tile has its own behavior

I am working on 2D tile based game. I want to render the tilemap from a file but every tile has its own behavior for example: magmablock : poorlava(); slimeblock : knockback(); I have this ...
0
votes
1answer
36 views

Recalculating normals on a tesselated cubed sphere with heightmap applied

I'm learning about the graphics pipeline using C++, HLSL and DirectX 11 for my course. I'm currently tesselating a cubed sphere with an applied height map. My issue is figuring out how to recalculate ...
0
votes
1answer
39 views

how do i call variables inside headers from cpp?

i'm making a game right now so i want to make a main menu, so i made a header that will contain all the variables, like images, settings and, other things. (i will only talk about the images) the ...
0
votes
1answer
63 views

Four (4) color channel png has black “background”

I am experimenting with C++ code to load a png file, using libpng. When I get to the color data in the file, I load it into a std::vector. I have found that the ...
0
votes
1answer
42 views

How to use TEnumAsByte Unreal 4.22

The problem I am attempting to use a TEnumAsByte in one of my class headers: I get compilation errors: Code sample I have included everything relevant to the ...
0
votes
1answer
75 views

How to pass renderer through classes?

I am making a game with SDL and C++. I am trying to render simple image to the screen but I can't. I am not getting any error but I see only black screen. I think because the renderer in ...
0
votes
2answers
134 views

Parsing “pick up” action in a text-based RPG

I’m coding a text-based RPG and I have my controls working: I have a string checking what you write in against an array of if statements. It can get it right with ...
0
votes
0answers
60 views

Can't load textures to the game

I am making a game with SDL and C++. I am trying to render simple image to the screen but I can't. I don't know why, I am not getting any ERROR but I see only black screen. Here is my code: game.h <...
0
votes
1answer
48 views

OpenGL object load in reverse

I am trying to load a model and it is loading it in reverse. When I am trying to rotate it 180 degrees it changes the lightning as well. I am not sure what I need to do to change the position that eh ...
0
votes
1answer
28 views

UE4.23 - Cast of child of GameUserSettings fails

I've derived GameUserSettings to add a bunch of custom properties to it. I tried making accessible in blueprint by creating a static method that returns the current GameUserSettings cast to my Child ...
0
votes
0answers
12 views

How to use mip mapping with SpriteBatch in DirectXTK

For a C++ .dll project of ours, I am able to render different sprites from a spritesheet into a texture using DirectXTKs SpriteBatch() method. But then, we came to notice that the sprites start to ...
0
votes
2answers
80 views

C++ inheriting functions problem

So I am creating a game with C++ and SDL. I have a "gameobject" header file and no cpp (I do not need it) the game object has 2 functions void render() & ...
0
votes
0answers
29 views

Grappling hook force resolution

Our team is creating a 3rd person adventure platformer in Unreal 4.22. One of the mechanics is a grappling hook. Think less-so a 'pull-to-point' grappling hook (Widowmaker, Just cause etc.). However ...
0
votes
1answer
93 views

Identify an object currently selected in the game

I am making a 2D isometric game that uses the mouse. When I left click on an object, this object should be selected, but how do I determine what object that's currently selected and show a halo around ...
0
votes
1answer
53 views

Only one triangle drawn

I am trying to render a quad with gl render mode GL_TRIANGLES with using element array buffer. Here is some code to explain process. Only the first 3 elements of indices array are drawn as expected. ...
1
vote
2answers
56 views

Parts of 3D model disappear during animation

I'm trying to properly play an animation done in Blender 2.8 inside my OpenGL application. When the animation is running, it happens that at some particular frames, some parts of the 3D model "...
0
votes
1answer
50 views

Add impulse and torque to a cube

I would like to spawn a cube if I press space and apply a short impulse of force and torque to make the cube rotate. I have some calculations for the impulse but I think they are wrong since the cube ...
0
votes
1answer
80 views

How is tile offsetting accomplished in 2d side scrollers?

The idea is to work with tiles that together make up a larger image, or world so to speak. but im confused as to what the methods used are to offset the tiles, and whether is a good idea to draw ...
0
votes
0answers
28 views

Need help with a Lnk2019 error in an SFML/C++ project

I'm currently making a 2D video game using the SFML library on Visual Studio 2019 community with the help of a Youtube tutorial series by Suraj Sharma: https://www.youtube.com/watch?v=IdKZpv6xqdw&...
0
votes
0answers
25 views

Need help with sluggish sprite movement in an SFML-C++ project:

I've recently bought an SFML course on Udemy.The course is teaching me to make a game where you are chopping a tree while avoiding falling branches. Right now i'm learning to animate moving clouds ...
0
votes
0answers
21 views

D* lite optimized: what is wrong in my implementation of Search() function?

I'm trying to implement the D*-Lite pathfinding algorithm, as described in the 2002 article by Koenig and Likhachev for grid-based navgraph. But I stuck with problem. My ComputeShortestPath (in my ...
0
votes
1answer
136 views

Projection Matrix Causes Clip Cuttoff Problem

I'm trying to setup my renderer and I'm configuring the matrices. I currently have a View Matrix and a Projection Matrix which I then multiply and send to the shader(there's no need for model matrix ...
0
votes
1answer
155 views

Need help with an 'Exception thrown:write access violation:this was nullptr' in a c++ - SFML project

I'm currently learning how to program a 2d game with SFML using a tutorial series by Suraj Sharma.This's his channel: https://www.youtube.com/channel/UC2i39AOpDSlO1Mrn1jQ8Xkg The tutorial series: ...
0
votes
0answers
17 views

Implement a scale factor to apply to UCharacterMovementComponent::JumpZVelocity in Unreal Engine 4

I'm creating a my own movement component inherited by UCharacterMovementComponent. I should implement a scale factor (I called it JumpZVelocityScale) to apply the JumpZVelocity (and I don't want ...