Tagged Questions

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

learn more… | top users | synonyms

0
votes
1answer
145 views

why is glVertexAttribDivisor crashing?

I am trying to render some trees with instancing. This is rather weird, but before sleeping yesterday night, I checked the code, and it was in a running state, when I got up this morning, it is ...
0
votes
0answers
29 views

“Unresolved external symbol” errors in DirectX: LNK1120 and LNK2019 [duplicate]

I'm making a DirectX 11 framework, but debugging gives me these errors: error LNK2019: unresolved external symbol __imp__DrvGetModuleHandle referenced in function "private: void __thiscall ...
2
votes
3answers
270 views

How can I avoid repeatedly setting up SDL in VS 2013?

Do I have to set up SDL 2.0.3 every time I make a new project? I tried putting sdl.dll in system32 so that I don't have to include it in my project folders, but that didn't work.
1
vote
0answers
81 views

Text alignment in OpenGL with FreeType2

I'm trying to implement font rendering and have got into some trouble with glyph metrics. Here's the code where I get the metrics: Glyph gl; gl.width = face->glyph->metrics.width / 64; ...
0
votes
2answers
218 views

In a multiplayer game, should I store the list of character names on the Player class?

I am writing a multiplayer game that has account system and character creation system like standart MMORPGs. I have a question about name creating issue. I think that I can create a static variable on ...
3
votes
1answer
150 views

What are the performance and size tradeoffs of Eigen::Transform versus Eigen::Matrix4f?

We finished migrating from DirectXMath to the Eigen math libraries for our 3D-Game Engine last week for portability reasons. After implementing transformations with matrices as we know them, we found ...
-1
votes
1answer
109 views

Unity's pack 4 floats

Linked to: GLSL pack floats into an RGBA texture I found EncodeFloatRGBA/DecodeFloatRGBA shader functions in Unity https://gist.github.com/hecomi/9580605 Now I try to figure out how they work. So I ...
0
votes
2answers
173 views

Directx9, FBX sdk and indices problem

So I've set up my program, know how to get everything going except for one thing: indices. I've been stumped as to how I retrieve that set of data. Does anyone know what I function I need to get them? ...
3
votes
1answer
324 views

Dynamic Quad/Oct Trees

I've recently discovered the power of Quadtrees and Octrees and their role in culling/LOD applications, however I've been pondering on the implementations for a Dynamic Quad/Oct Tree. Such tree would ...
3
votes
2answers
199 views

OpenGL - Index buffers problem

I have a custom file format that has all the needed information for a 3D mesh (exported from 3ds Max). I've extracted the data for vertices, vertex indices and normals. I pass to OpenGL the vertex ...
0
votes
1answer
95 views

Camera rotation around point, but without centering

Let's say i have the following: Point somewhere in space Camera with position and orientation (up, right, forward) I want to rotate camera around the point, but also keep this point in same place ...
0
votes
2answers
206 views

Is networking programming quite generic

I have only looked into the basics, at least I assume it gets more complex. So does network code really change from one game to the next or is it pretty much portable. For example I can create say a 2 ...
1
vote
3answers
149 views

Implementing a score cheating prevention system in an offline game with an online score board: How to protect game fairness?

This is hopefully a very simple question. It isn't about loading assets (which is all I found while searching) Basically I have a template, say Object_Monster that has stats, abilities, etc. But I ...
0
votes
2answers
201 views

2D Rendering in DX11. Texture Storage and Reference

I'm trying to think of the best way to manage textures in my 2D game. First, I am using DX11, so right now my "textures" are just pointers to a ID3D11ShaderResourceView created by ...
2
votes
2answers
204 views

How do I make a character follow behind another?

I'm creating a game in C++ using OpenGL. I want to add a character into my game who, after meeting the main player, follows the player around. The follower should position themselves directly behind ...
0
votes
1answer
522 views

using eclipse instead of visual studio for cocos2d-x project

im using coco2d-x v 3.0 i made a new windows project to test it and it is working but when i try to build and run a project using this command cocos run -p win32 it is print this error it seem ...
0
votes
0answers
69 views

Bounding box center after transformation - want degree values for GUI

Similar to my previous question, I have a bounding box that I have transformed and scaled. Now, I want to get its center by doing this operation and store this value. bbCenter = glm::vec3(bbMin_x + ...
0
votes
1answer
86 views

Adding Components (classes) to unordered_map in Entity? (Possible typeid as key issue)

I've got a little test put together that has a couple simple Components that are supposed to be added to an Entity, but the addComponent function isn't working; I think it's got something to do with ...
1
vote
2answers
422 views

glGenVertexArrays causes crash

My code keeps crashing at runtime, I have done some creative debugging and determined that it was the glGenVertexArrays that was causing the crash, I've looked around and come across some answers that ...
0
votes
0answers
55 views

Focus a turntable style camera on an object

I have a turntable style camera in the maya / blender / alembic / opensubdiv example. I want to be able to match the camera translation to any objects translation pivot point in the scene and then ...
0
votes
1answer
98 views

Loading Wavefront Data into VAO and Render It

I have successfully loaded a triangulated Wavefront (.obj) into 6 vectors, the first 3 vectors contain the locations for vertices, UV coords, and normals. The last three have the indices stored for ...
3
votes
1answer
144 views

Should my GLSL Shader object/wrapper encapsulate loading/setting a VertexArrayObject?

I am working on a 2D game in C++, with a simple rendering layer over OpenGL. I have a wrapper for GLSL shaders and shader programs, these wrappers encapsulate shader objects into C++ classes and ...
40
votes
7answers
6k views

How does Lua work as a scripting language in games?

I'm a little hazy on what exactly Lua is and how a game that is programmed in C++ would use it. I'm asking primarily about how it is compiled and run. For instance when you use a program written in ...
4
votes
3answers
363 views

Make openGL program only update every 1/60 seconds

I'm learning C++ and openGL and have this program as a result from tutorials and playing around. The problem is that the main loop is running at "full speed", making the program unnecessarily cpu ...
0
votes
1answer
84 views

Point rotation around point, accuracy question

I study OpenGL ES 2.0. But I think it's more a C++ question rather then an OpenGL one. I am stuck with the following rotation question: It is known, that rotation transformation can be applied using ...
1
vote
1answer
209 views

How do I fix my planet-facing camera?

Summary I'm having trouble implementing a camera controller suitable for first person use around a planet. The camera needs to be oriented correctly according to gravity (vector from camera ...
0
votes
0answers
33 views

Calling interactivity functions from object classes

Let's say I have a class object_door. An instance of said class is now in the game world in a locked state. Now to enable the player to open it, he needs to attempt to pick the lock. So I was ...
1
vote
2answers
168 views

Single or multiple inheritance for game world objects

So I am currently laying out on paper the system I want to code for a game in C++. Now currently I am debating whether to have e.g. a class object_door that inherits from another class ...
0
votes
3answers
168 views

How necessary are shader coders? [closed]

I know that gameplay mechanics programmers, either directly working with source or with scripting are needed, however there are so many shaders written already that I would imagine you could find ...
1
vote
1answer
271 views

What is Ogre::String?

I was working with the OGRE .NET bindings (MOGRE) for quite a long time. To improve my (not that good) C++ skills, I am switching from C# to C++. After implementing a basic OGRE application, I was ...
0
votes
0answers
42 views

alBufferData() sets AL_INVALID_OPERATION when using buffer ID obtained from alSourceUnqueueBuffers()

I am trying to stream audio data from disk using OpenAL's buffer queueing mechanism. I load and enqueue 4 buffers, start the source playing, and check in a regular intervals to refresh the queue. ...
0
votes
2answers
304 views

OpenGL - How can I make the edges of this textured circle smoother?

I'm building a game and I've applied a certain texture (RAW file) to a circle (GL_POLYGON) in OpenGL. It loads correctly, with the right size and all, but the edges seem a bit jagged and I would ...
-1
votes
1answer
179 views

Slight pause/delay when moving

I've been working on this little framework for my game today and realized that moving delays when moving around. I've used SFML before and have had the same problem, but never bothered to fix it. I'm ...
5
votes
2answers
283 views

Do I really need to clear the renderer every iteration?

Just a quick question about fine-tuning/optimization. If I'm making a 2D platformer with a parallax-scrolling background (meaning no two frames are the same) do I really need to clear my renderer for ...
22
votes
6answers
4k views

How to solve the big video memory requirements in 2d game

We are developing 2d game (Factorio) in allegro C/C++ and we are facing the problem with increasing video memory requirements as the game content increases. What we currently do is, that we gather ...
1
vote
0answers
37 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 ...
3
votes
1answer
172 views

How can I implement a dialogue where the words appear as if they were being typed?

I'm planning on putting a dialogue system into my game, I don't really work with surface so my way of implementing SDL_Ttf is by turning it into a texture, in other words, every paragraph would be ...
1
vote
2answers
243 views

Creating weapons/armor procedurally

In my current project I am creating a 2d game (rpg) which should be able to dynamically create new weapons and armor based on different components. So, i.e. a sample weapon would consist of barrel1, ...
0
votes
2answers
120 views

irrlicht: drawing two textures with draw2dImage issue

Im just starting out with irrlicht (and c++) for 2d development and I followed the 2d tutorial, so I am able to draw a 2d texture on the screen (With draw2DImage) this seems to work fine. So I made a ...
0
votes
1answer
95 views

How big a transition from programmer to modeler/level designer/creator [closed]

So I think I may take a break from the programming side, I have put in 6 hard months learning C++ and graphics theory, I have learned a huge amount but over the last few days have been studying level ...
7
votes
1answer
289 views

Hotplugging Joysticks And Gamepads On OSX

I've tested the cross platform joystick support features on GLFW, SDL2 and SFML. SDL2 appears to be the most complete, but it can't detect when joysticks have been unplugged on OSX. To me, this is a ...
0
votes
0answers
367 views

Cocos2d-x , setup the debug environment and remove the red marks in my eclipse

I am struggling with this issue since last week. I still can’t figure out where is the error. My code is compiling perfect if I restart the eclipse. but, when I edit the c++ file it shows red marks ...
1
vote
1answer
57 views

Do I need to call Release() on D3D objects when I use them in another function?

For example, I have an IDirect3DSurface9 * Surface and IDirect3DSurface9 *BackBuffer. If I were to use them directly in the render_frame function, I would need to release them on the closeD3D ...
2
votes
0answers
86 views

How can I load an image into the back buffer? [closed]

How can I load and display an Image?... I have tried something but it didnt.. worked.. this is what I've tried.. File : StrikeOps_main.cpp .. void : render_frame : Intro::DisplayIntro(d3ddev, ...
5
votes
2answers
220 views

What does the Particle engine do and how are special effects created/processed?

For example, take bullets, sparks, fireballs, light sabers, lightning bolts, any kind of special effect in a game. Are there various ways to implement these effects in a game. As far as I can see you ...
0
votes
0answers
155 views

How to make an Game Intro

How do I display my logo (a short video) before displaying the main menu? For example when you start Call of Duty, it displays the IW / 3ARC logo, Activision, and then a cinematic. I just need to ...
0
votes
1answer
70 views

How are vertices determined complex geometries in an ever changing game state

For example say you wanted to draw a 3D cube you can define an array of hard coded vertices using float3, here is an example. http://msdn.microsoft.com/en-us/library/windows/desktop/jj552949.aspx But ...
0
votes
1answer
163 views

Separating axis Theorem rotation issue

I made a post yesterday to see if anyone could understand my problem. However I did not receive much guidance, probably because my question was not clear. I have worked on it a little more and ...
1
vote
1answer
435 views

glsl shader to allow color change of skydome ogre3d

I'm still very new to all this but learning a lot. I'm putting together an application using Ogre3d as the rendering engine. So far I've got it running, with a simple scene, a day/night cycle system ...
1
vote
3answers
696 views

How can I implement a main menu?

I have been following the tutorials at http://lazyfoo.net/tutorials/SDL/index.php and although they are all very well written and I have learned more than I would have on my own, I am not sure how to ...