Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
14
votes
4answers
16k views

What are the current books for DirectX (w/ focus on 3D)? [closed]

For OpenGL, the OpenGL SuperBible 5th edition was just released only a few months ago, and is considered a fantastic, highly rated book for not only learning OpenGL 3 (Part 1 of the book), but it also ...
4
votes
4answers
30k views

Starting programming in 3D with C++ [closed]

EDIT: There aren't sufficient enough tutorials for what I'm trying to do in Python, so I'm going to take my time and slowly build up my skills in C++. It's hard to trip and not land in a book of C++ ...
3
votes
4answers
3k views

What's wrong with this OpenGL model picking code?

I am making simple model viewer using OpenGL. When I want to pick an object OpenGL returns nothing or an object that is in another place. This is my code: ...
3
votes
6answers
3k views

What is the easiest and shortest way to draw a 2d line in c/c++?

I am fairly new to c/c++ but I do have experiance with directx and opengl with java and c#. My goal is to create a 2d game in c with under 2 pages of code. Most of what I have seen requires 3 pages of ...
9
votes
3answers
1k views

Using “friend” classes in game development

Typically in C++ game development speed is valued over encapsulation, you therefore see a ton of publicly accessible class members which really shouldn't be public. I seem to find in most cases that ...
3
votes
3answers
2k views

When to return a reference and when to return a copy?

I was looking at the d3dx math .h and noticed that a difference between the "+" and "+=" operators: ...
5
votes
3answers
2k views

Why do games dynamically link to the CRT?

Almost all big titles that I have played require you to install the MSVC runtime. There have been numerous questions about "statically vs. dynamically linked CRT" on StackOverflow, the reasons for ...
17
votes
5answers
11k views

When should vector/list be used?

I can understand when to use lists, but I don't understand when it is better to use vectors than using lists in video games: when it is better to have fast random access ? (And I understand why it's ...
3
votes
1answer
847 views

How to use Irrlicht with Objective-C?

Irrlicht uses namespaces, a C++ feature not available in Objective-C: ...
4
votes
1answer
1k views

Client-side login and password save

I'm wondering what would be the best way to store password and login in the client. Many people complain that they need to re-enter this every time they log in and they want me to make a way to save ...
14
votes
6answers
10k views

What scripting language would you recommend for a C++ game project? [closed]

By scripting here I mean not just putting config data in a script, but scripting parts of the project like some class methods, test specific game loop, etc. This would be not just to accelerate ...
5
votes
3answers
3k views

Writing Logic behind card games

I'm not a dev noob, but definitely never done anything in game dev. There is a trump based card game we play in town that I plan on coding. I'll be either using python/ajax/pyqt or c++/qt. My ...
11
votes
1answer
3k views

Register Game Object Components in Game Subsystems? (Component-based Game Object design)

I'm creating a component-based game object system. Some tips: GameObject is simply a list of Components. There are ...
7
votes
1answer
2k views

Huge slowdown when running Lua as statically linked lib versus stand alone interpreter

I'm developing some algorithms in Lua which are run mostly in Lua (few calls to C++) and I'm noticing a huge slowdown when I'm running them from my app rather than the default Lua interpreter. The ...
4
votes
2answers
2k views

Writing a custom model file format

I am using Ogre for my rendering engine, and I planned on just using the .mesh format that is setup by default with Ogre. However, I recently purchased a large number of 3d assets from a company, only ...
4
votes
4answers
2k views

Change from Bullet/OgreAnim to Havok?

I have been working on a game in Ogre for the last 6 months or so. It started as a learning project, and after a few rewrites it actually turned into a real game project. Physics scared me, and using ...
6
votes
4answers
879 views

What data should I use to track the player position on a world at the same size of the earth in a multiplayer game?

I guess this kind of game or simulator already exist somewhere, but I'm not sure... Let's imagine I'm making a game where the proportions of the planet earth and the humans beings on it are the same ...
8
votes
5answers
5k views

What is Serialization?

I have been around programming for a while as a hobby, but I did not start seeing this concept until recently. I have google'd "what is serialization" numerous times, but I never actually get any sort ...
6
votes
2answers
2k views

How do I build games with scripted actors?

The idea I have an idea for a game. A few games, actually, that can built on top of the same general design. There is a game world that the player and the other actors exist in. The player can get ...
129
votes
9answers
87k views

What are some programming design patterns that are useful in game development? [closed]

I have a few books on Design Patterns, and have read some articles, but cannot intuitively figure out which programming design patterns would be useful in game development. For example, I have a book ...
0
votes
0answers
312 views

Choosing an Audio API [duplicate]

Possible Duplicate: Cross-Platform Audio API Suggestions I have gone down this road a few times, and always decided to put it off. I am finally to the point I need to choose an Audio library and ...
13
votes
5answers
2k views

Custom Content Package for Files

I am about to purchase quite a few model packs from a website for prototyping my game. In the contract it states that I must protect them as to prevent the public from gaining access to them. I ...
17
votes
4answers
6k views

How can I write a Save/Load system for my game?

I'm trying to figure out a way to write a save/load system for my game in C++. As of right now, I'm doing it all using binary flags. Anyone got a clue on how to do it another way? I don't mind using ...
4
votes
6answers
3k views

Any free 2D C\C++ framework that supports iPhone? [closed]

I'm looking for a C\C++ game dev framework that supports iPhone. It should have least Objective-C requirement to use it. The closest one I could find is Kanji engine. But that's not free. Other ...
6
votes
3answers
2k views

Most Efficient way to read a Settings Configuration File

I have been working on a game for quite a while, and I am using Ogre3D for the rendering engine. It is getting to the point I need to move adjustable settings to a configuration file such as video ...
24
votes
4answers
12k views

Should collision detection be done server-side or cooperatively between client/server?

I am working on an online game that will have very heavy collision detection processing. Player models will collide with other players, mobs, structures, terrain, and solid objects that only exist ...
6
votes
4answers
12k views

2D AABB collision response

I'm making a simple platformer, and I wanted simple collision handling. So I gave all my objects an AABB hitbox and tried to resolve collisions. However, I can't get it to work. My main character has ...
8
votes
1answer
470 views

How can I copy or back-calculate definitions for an entire b2World?

I'm working on a platformer where I'd like to be able to move or copy bodies between multiple Box2D b2Worlds. The desire has cropped up three times now - moving objects between documents in my editor, ...
1
vote
4answers
2k views

When learning, nothing is better than practice [closed]

A little introduction: I'm 25, and going to this private french school, CreaJeux, which begins in october. I will be learning mostly game programming, something I wanted to do a long time ago, since ...
8
votes
7answers
15k views

What is a good book to start programming a 2D C++ game? [closed]

I have a degree in Computer Science and while I was in college, I created a simple 2D game in Game Maker. I would like to recreate this game in C++ as a start to learning how to create games in C++. ...
65
votes
9answers
94k views

Good GUI for OpenGL? [closed]

I am starting to learn OpenGL with FreeGLUT using the Superbible and the knowledge I have from my elementary graphics to brush up on my skills. To get more from this experience I want to integrate a ...
2
votes
1answer
259 views

Social Network Gaming on Windows, Linux and OS X

I'm working on mobile platforms as Android, IOS... Many users of Moblox ask us a windows and an OS X version. There is no difficulties to provide these versions, because we are developing on OS X C++ ...
4
votes
8answers
5k views

What technology is best for building my first game [closed]

I have started a few game projects in the past, but have never finished anything. I decided that it was probably because I was writing everything thing from scratch, and just ended up dropping the ...
7
votes
4answers
2k views

Where to start the coding of online leaderboards?

I NEVER, EVER did ANY sort of network code in C++, I don't know even the libraries that exist, but a popular demand for my game is online leaderboards... So, what sort of libraries I should research ...
15
votes
1answer
8k views

How can I tell how much video card memory I'm using?

I want to programmatically determine at runtime how much video card memory is being used by my program. Specifically I'm wondering about how to do it on a Windows machine using OpenGL, but am ...
4
votes
1answer
1k views

Defining GUI control event responses using Lua in C++

I'm using Irrlicht(C++) for a 3D engine, and it has a built in GUI system. The GUI events are something like this: switch(eventtype) case button_pressed:     stuff case ...
3
votes
2answers
3k views

Camera rotation (OpenGL)

I am having trouble with a camera class I am trying to use in my program. When I change the camera_target of the gluLookAt call, my whole terrain is rotating instead of just the camera rotating like ...
7
votes
3answers
10k views

Binding C++ and V8 Javascript from Google

The examples are quite challenging to grasp if you are still getting your head around other things, so the simplest example would be great. Is there a simpler example?
8
votes
7answers
3k views

Throwing Exceptions in C++ game DLL's? Pros and Cons

What are the pros and cons of using Exceptions in C++ in relation to game development. Google style guide says that they don't use Exceptions for a variety of reasons. Are the same reasons ...
13
votes
8answers
3k views

Which unit test framework for c++ based games? [closed]

Which combination of testing tools do you feel is best? Given the framework / library of your choice you might consider: suitability for TDD ease of use / productivity dealing with mock objects setup ...
48
votes
10answers
19k views

C++: Smart pointers, Raw pointers, No Pointers? [closed]

Within the scope of developing games in C++, what are your preferred patterns in regard to use of pointers (be it none, raw, scoped, shared, or otherwise in between smart and dumb)? You might ...
14
votes
2answers
5k views

Tips for implementing MMO quest mechanics?

What tools, patterns, or best practices would you recommend to implement the quest mechanics given below listed requirements? I am talking about software architecture (how generic should you be) and ...
9
votes
2answers
1k views

Splitting into files - how much splitting?

If I say I have a hierarchal entity framework, rather than a component model. Something like: (Yes, this is made up) Weapon->Gun->AutomaticGun->MP44 Or, more of a classical example: Entity->...
5
votes
2answers
1k views

Atmospheric Scattering

I want to add some nice atmospheric scattering to my 3D game engine but I am very concerned with conserving resources. I am not very familiar with how its done but can someone please give me some ...
18
votes
8answers
41k views

What are good solutions for serialization in C++? [closed]

I'm curious what solutions game developers have come up with for serializing the different types of data that they deal with for their games. Do you guys use some monolithic GameObject hierarchy that ...
18
votes
3answers
8k views

Upgrade OpenGL version on Windows?

How do I update the version of OpenGL on Windows so that I can use anything newer than the Version 1.1 header file that is included in the Platform SDK? Even version 7.0A of the SDK for Windows 7 ...
2
votes
2answers
1k views

Audio Design and XAudio2 Performance Issues

I have a very basic understanding of audio and was hoping I could get some help to resolve a problem with the audio design in my engine. Let me give you a run-down of how I've currently got it fitting ...
8
votes
2answers
3k views

Frustum Culling with VBOs

I have terrain being rendered in my project using VBOs in OpenGL. I would like to apply some Frustum Culling but have no idea how to access each polygon as its drawn to check if it is in view. I think ...
12
votes
8answers
22k views

Getting Started with 2d Game Dev (C++): DirectX or OpenGL? [closed]

So, i'm a student looking to get my foot in the door of game development and im looking to do something 2D, maybe a tetris/space invaders/something-with-a-little-mouse-interaction clone. I pointed ...
19
votes
12answers
2k views

3D theory before graphics APIs? [closed]

I'm a software engineer and I'm hoping to move my career towards game development. I'm reading a book right now on 2D using C++/DirectX. When I get into 3D I know I want to do it correctly. For ...