Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c++]

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

1
vote
2answers
139 views

c++ static only classes for subsytems and Engine

From the book Game Engine Architecture In C++, global and static objects are constructed before the program’s entry point (main(), or WinMain() under Windows) is called. However, these ...
1
vote
1answer
187 views

How to implement circle clipping in SDL2?

In SDL2 there's a function to set a rectangular clip mask: int SDL_RenderSetClipRect(SDL_Renderer* Renderer, SDL_Rect* clip); If i call this function, copied ...
1
vote
1answer
190 views

Can all DirectX11 games be deployed to Xbox One?

If I program a game with DirectX 11 and C++ and make my own implementation can I deploy it on an Xbox one to test it? Otherwise, what do I need to do so?
0
votes
0answers
60 views

Can resources be stored in a *.so file? (Android)

I was looking in a APK(zip) file. I wanted to have a look at what resources were in it for a game I was playing. The game is mainly still images with added animations on top of these images. I have ...
0
votes
1answer
103 views

Specular light for DirectX11

I illumine model through model illumine of Phong. Ambient and diffuse light’s constituent work well, but specular works wrong. Under this message I sent screenshoots: 1) ambient and diffuse 2) ...
0
votes
1answer
68 views

Normals transformation problem

I am working on my first Direct3D game and even after many days of searching Internet and experimenting I can't figure out how to work with normals properly. As a result, the lights are not working ...
-3
votes
2answers
269 views

Random points spread like old TV static in a polygon OpenGL

OpenGL version 3.1 Have to draw around 10000 randomly placed and colored points inside a rectangle to appear like old TV static but colored as shown in the image below. Right now the code draws a ...
1
vote
0answers
114 views

What's wrong with my normal mapping, and how can I fix it?

I'm trying to implement Normal Mapping in Directx and I'm very close to creating it but I'm getting these weird black colors on some objects. This is how it looks like without the Normal Mapping: And ...
0
votes
0answers
59 views

How can I load a script once in LuaJit/Lua and use it across multiple VMs in different threads?

So, I came across an interesting problem. I'm implementing some threaded game logic, and one of the things I decided to do was to use Multiple Lua VMs, with each worker thread containing its own VM. ...
1
vote
0answers
41 views

binding glm operators with luabridge

I am attempting to expose glm vector functions/data to luabridge like so: ...
0
votes
0answers
84 views

IDXGIOutputDuplication::AcquireNextFrame Not Working

I've put together this code that takes a screenshot of the desktop and maps it for raw pixel data access, but the output is all zeros. I have no idea what i've done wrong. After looking at many ...
0
votes
0answers
36 views

SFML Include Issues

I'm trying to copy over a VS2017 solution/project which uses SFML to a different machine. On the original machine, everything compiles and runs fine however when copied over to the second machine (...
1
vote
1answer
620 views

How To Resize Existing Texture In OpenGL 4.3

I would like to know how to resize an existing OpenGL 4.3 texture while keeping the current contents. i'm using glTexImage2D(). Do I simply re-call ...
0
votes
1answer
143 views

How to sort poker hands? c++

The examples below come from the answer by Steven Stadnicki in Determining Poker Hands Suppose a player get a hand like A9772. I would like to store the hand as either 77A92 or, better yet, 7A927. A ...
0
votes
3answers
181 views

Planning Class Inheritance for Game Objects

This is specifically about the development and planning direction of the game development. I'm creating a fairly basic RPG and am wondering about the approach that I should take. I've been trying to ...
4
votes
0answers
116 views

Determine user mouse selection of 3D Object for multiple viewports

I am currently working on setting up some world objects for my level editor and am running into a bit of a snag. When I get the hit location from the mouse raycast, I would like to determine what part ...
0
votes
0answers
47 views

Draw 100.000 3D lines with blending

For the visualisation of a physical experiment I need to draw multiple 10.000 particle tracks in a 3D space. Example 2D: Example 3D (low Energy): Each individual track should contain width and ...
1
vote
2answers
145 views

Tetris - Smooth piece drop (c++)

So I have coded simple tetris games on the past but I have never done one where the pieces drop smoothly, like for instance Super Tetris 3 on the SNES.I am planning to learn SDL and for such I want to ...
0
votes
1answer
546 views

How can I rotate models in their local space using OpenGL?

I have a base application where a model is loaded in, however I need to manipulate the models positions and rotations independently so that each model in the scene can have its own rotation and ...
2
votes
2answers
351 views

Appropriate Cache Friendly Associative Container For An Entity Component System

The intro to this problem is a bit of a long one so my apologies in advance. In short I am asking for suggestion as to what type of collection I should use to store data for a particular part of my ...
0
votes
0answers
73 views

Undefine symbols for architecture x86_64 ( cocos2d-x samples for the Firebase C++ SDK)

I am working a cocos2dx project and trying to integrate Firebase C++ SDK in my project as below. I have been following the instruction from Firebase Cocos2d-x Samples in github provided by Google ...
0
votes
0answers
109 views

Unrel Engine 4: Cast Blueprint To Parent Class

My problem: I need to access my gameMode class at runtime in code. I created a custom GameMode class called AGameMode_Cell. I also got a Blueprint which is derived ...
-1
votes
1answer
63 views

asteriods ship movement

...
0
votes
1answer
245 views

Make the components of an ECS polymorphic

I have implemented an entity component sytsem (ECS) in my game engine (SFML and C++ 17). An entity has an array of components. You can get a components by its type e.g.: ...
0
votes
1answer
86 views

Avoid rolling whith quaternion

I'm using a Look At function (idem as nasskov answer on this post) to orient a model: osg::Quat result = quatLookAt(normalize(velocity)); It works but may let ...
0
votes
1answer
50 views

Direct3D 12 STATE_CREATION ERROR #649: CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE

Every time my constant buffer helper creates the "Constant buffer view" with the CreateConstantBufferView method i get an error which states: D3D12 ERROR: ...
0
votes
1answer
44 views

If someone is using JNI then are they are true user of NDK (c++)?

As someone involved in the hiring of engineers that must have experience using NDK (I work for Unity and support the VR/graphics groups), I see quite a few resumes of people who claim to be using NDK ...
0
votes
1answer
389 views

OpenGL calculate circle rotation around a given point

I'm trying to rotate an object around a certain point. If this point is the center of my world space I use the following algorithm: glm::vec3 center is the center ...
1
vote
0answers
39 views

Gauge vibration

Hello guys Im programming a gauge animation where there is a needle that points to certain values lets say each value equals to the amount of degrees the needle has to rotate to reach said value ...
0
votes
1answer
50 views

SFML GetRenderWindow Method Help

I have been following the "SFML Game Development By Example" and on chapter 2, the book was showing the example game design of a Snake game. However he didn't write the code of some header classes and ...
0
votes
1answer
130 views

how to make skills and their animations in opengl ? are skills 3d model or 2d?

1)slash effect 2)area skills like dota2 crystal maiden ulti and first skill 3)over an enemy skills example dota2 crystal maiden second skill how they make in opengl i know opengl billboards way and ...
0
votes
1answer
40 views

Side of collision with rotation

I have 2 rectangles and I want to know if its a length collision or a breadth collision. I will also need to know the rectangle ...
0
votes
0answers
38 views

FBX Connections

I use assimp fbx importer and I get a list of meshes. but There are materials that are not assigned to some meshes. I opened the FBX ASCII file and I looked for the material name, I found it is in ...
0
votes
1answer
73 views

Objects desync position when speed is not multiple of 10

While finishing up game loop and rendering integration, i made some blocks move back and forth in the x axis to test things out. Their initial positions are as follows: The first block starts at 0,0(...
0
votes
1answer
957 views

Problem with folder structure and building project in UE4

I created a new C++ project on Unreal Engine 4. After that I close visual studio and ue4 editor. I manually added public and private folders in the source folder. Then I made folders for the player, ...
0
votes
1answer
402 views

Accessing UAV data in a Pixel Shader SRV

I'm working with a basic compute shader which only task is to modify the input color of an UAV. This UAV data should then be passed to an SRV in a pixel shader which should then output this color. The ...
1
vote
1answer
1k views

How can i draw a curve in modern Opengl?

OpenGl is capable of rendering points, lines, triangles and quads; but what if i want to draw a bezier curve? I read online you should use something called GL_STRIP...
-1
votes
1answer
75 views

C++ Storing Mass Data Sets for Future Use

I didnt know how to title this... Background: I am currently trying to develop a windows command console game with C++ for a final project. The game is text based. I have only been programming C++ ...
1
vote
1answer
116 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
1answer
183 views

CreateShaderResourceView fails because of plane slice

I'm trying to write a wrapper for the CreateShaderResourceView method inside my Texture class, which shouldn't be any problem at all since everything was working ...
0
votes
1answer
134 views

Does it matter what file type my save file is?

So, I am looking into game development, and I just learned how save files work and how to create and implement them. Here is the code that I was using on Dev C++: ...
-1
votes
0answers
65 views

Cast a Ray In C++ Directx9.0c

I'm in the process of attempting to mod Quake 4, and one of the features I am attempting to implement is teleportation. With that said, I want to know how to perform the casting of a ray. I wish to ...
0
votes
2answers
152 views

Setting object-specific uniforms in a render queue

I am currently trying to write a (very simple) queued renderer using OpenGL. My current idea looks like this: ...
-1
votes
1answer
313 views

How can I build DOOM (SDL-Version) with MinGW?

I have recently been trying to build this source code here. I am building the original port with SDL infused, not the linuxdoom port and I’m having some issues. What I have tried first: I've ...
0
votes
1answer
114 views

How to create class for storing different types of vertex?

I am writing graphics engine for educational pursoses and have some problems. I need to have ability to use different vertex formats (for example position+normal+uv or position+normal+uv+bones+...
0
votes
2answers
127 views

Entity Component System data duplicate

I've read some articles about Entity Component System and I like this idea of "entities" having lots of "components" to define them, so I tried to implement it. Here is an simple overview of what i've ...
0
votes
1answer
481 views

How do i set up 9-slicing in Opengl?

What is the ideal way to set up 9-slicing? (for the people who don't know what 9-slicing is) Let's say we have a quad, with a texture applied to it. 9-slicing is basically a way of dividing a ...
0
votes
1answer
164 views

Approaches to draw multiple objects

I'm looking for an efficient way to render multiple object with unique texture sets each. Right now I combine multiple objects into a single static vertex and index buffers in the way like this: <...
5
votes
2answers
2k views

How can I round out the corners of a quad in OpenGL?

Even though I think the image is pretty self-explanatory, I'm going to explain what I am trying to achieve: I was working on a game, and I needed a GUI framework, that I decided to build myself. As a ...
0
votes
1answer
191 views

calculate the offset between a quad and the mouse position Opengl

I am working on a very simple "GUI framework" for my game. As you can see from the GIF, i have a window object that can be selected when the mouse is inside of it and dragged, when the left mouse ...