|
Some recent topics started on our forums |
Thread-safe any_ptr: Is this code actually thread-safe?
|
It's been quite some time since this article has been posted on GameDev, and recently I got to thinking if a thread-safe version was possible without having to use any (platform specific, or library dependent) synchronization mechanism.
I hap... |
Posted December 9, 2010 4:34:36 PM
|
C++ object loader - feedback required
|
Hello all,
I've been writing a serialization framework in C++. The deserialization part is completed (serialization is in the works).
The project is available here:
http://sourceforge.net/projects/daabli
This project can be used for loading... |
Posted June 27, 2009 8:58:04 AM
|
Article on simple Serialization for C++
|
In my spare time, I'm writing a Serialization utility for my game engine, and was wondering if an article about it would be of use to someone.
The reader is almost complete (the writer is still in the works); to be released under the MIT license.
... |
Posted June 5, 2009 11:26:45 AM
|
Paddle Ball
|
Paddle Ball is a clone of Pong for 2 players, developed (hacked together rather) as a test of the Nonnie engine which is currently in development. Nonnie is a 2D engine written in C++ and aims to be multi-platform (currently supported platforms are P... |
Posted January 16, 2009 10:07:54 PM
|
RayWatch
|
RayWatch (http://sourceforge.net/projects/raywatch/) is a simple raytracer, written in (OS-portable) C++, for educational purposes. It uses SDL (http://www.libsdl.org/) for loading images (textures). The source code is written for clarity (not perfor... |
Posted February 1, 2008 3:31:49 PM
|
Nibbles!
|
This (the source) is intended as a tutorial for programmers at the beginner level who are starting out with GDI+ using C++, and who would like to see a simple game as an example.
It's the classic 'Nibbles' or 'Snake' game. The graphics are stylize... |
Posted June 29, 2007 1:13:09 AM
|
STL List question
|
Hello everyone,
When I remove an element from an STL List, are all iterators (other than the ones related to the removed element) valid?
As far as Google goes, they're supposed to be valid for a List and not necessarily valid for a Vector,... |
Posted March 26, 2007 12:46:06 AM
|
No news about the article I've submitted...
|
Hi,
I'm not sure where to post this, but I'd sent an article (sweet snippet actually) about 1.5 months back, and it never got published, nor have I received any feedback.
I know that you guys receive lots of such articles, but I was just a bit... |
Posted March 1, 2006 12:21:55 AM
|
Verlet Physics: Help!
|
Greeting all,
I've been trying to implement some Verlet physics stuff, as described in the "Advanced Character Physics" article.
The problem I've come across is this:
For test purposes, I just create a tetrahedron with a particle at each cor... |
Posted January 17, 2005 9:05:16 AM
|
Physics frequency
|
Greetings,
I implemented some rigid body physics from the paper Non-convex rigid bodies with stacking (but I didn't implement everything in it such as shock propulsion). At the moment, there are no joints, just a simple rigid body with gravity/use... |
Posted November 22, 2004 6:03:33 AM
|
View All Topics Started By This User
|
|
Some recent replies made on our forums |
Thread-safe any_ptr: Is this code actually thread-safe?
|
Quote:Original post by Shinkage
Quote:Original post by FrancisXavier
Now the question remaining is, within the scope of where it's supposed to work (an executable), will it work in a thread-safe manner?It's not universally thread-safe, no. In fact... |
Posted December 10, 2010 8:41:41 PM
|
Thread-safe any_ptr: Is this code actually thread-safe?
|
Quote:Original post by Hodgman
Neat idea.
You could do a simmilar thing with the RTTI structures, though it might suffer the same issue that Antheus noted:
*** Source Snippet Removed ***
Or you could replace int with a new type based on th... |
Posted December 10, 2010 2:56:28 AM
|
Thread-safe any_ptr: Is this code actually thread-safe?
|
Quote:Original post by Antheus
It's not reliably unique. It's perfectly possible for typeid<Foo>() != typeid<Foo>().
It's the same issue as with allocators across DLLs or member function pointer signatures across compilation units and... |
Posted December 10, 2010 2:48:56 AM
|
A Type-safe Generic Pointer
|
Quote:Original post by CmpDev
Using a typed NULL pointer as a cast error has a side effect. What if the original pointer was NULL? When cast to type how would a user known what the NULL pointer after the cast indicates ie is it a bad cast or was the... |
Posted August 19, 2010 9:05:24 AM
|
A Type-safe Generic Pointer
|
Quote:Original post by Matias Goldberg
... it seems your code may not work on a multithreaded environment ...
To fix this it should use InterlockedAdd instead of simply ++idYou're right, I didn't consider multithreading when I wrote this. Th... |
Posted August 19, 2010 4:23:08 AM
|
A Type-safe Generic Pointer
|
Quote:Original post by noe
And again: why not just use boost::any to simply store the pointer? ;)If you're using boost::any to store pointers:
* boost::any allocates memory on the heap to store the object (via new/delete). This happens durin... |
Posted August 18, 2010 8:45:25 AM
|
A Type-safe Generic Pointer
|
Quote:Original post by i_luv_cplusplus
Few questions
1. Why are you saying that void* is a popular way for generic pointer in C++? AFAIK it is more C way of doing things?Correct me if I'm wrong, but I think void pointers are used in C++ when the... |
Posted August 18, 2010 5:10:25 AM
|
Enum Name
|
While I agree that it's a little error prone, the methods mentioned are not without use. There are plenty of cases where string support is required for existing enumerations from libraries. (like some enum from SDL, for example).
|
Posted August 5, 2010 9:17:54 AM
|
Enum Name
|
Using Daabli, some pseudocode with your example:
#include "Daabli.h"
#include <iostream> // For cout
enum Color
{
Red,
Green,
Blue
};
// String conversion support
Daabli_Begin_Enum( Color )
{
Daabli_Enum( Red )... |
Posted August 5, 2010 8:46:51 AM
|
Enum Name
|
You could try the following two methods (the second evolved from the first):
1.) Specifically for enumerations: Stringizing C++ Enums
2.) A generic approach: Daabli - String conversion support
(See the section "String conversion support", an e... |
Posted August 5, 2010 8:33:27 AM
|
View All Replies Made By This User
|