|
Some recent topics started on our forums |
Why does the win32 API use strings as class identifiers instead of handles?
|
It seems at odds with the rest of the API. Pretty much everything is based on handles like HWND and HMODULE, so I would expect that RegisterClass(Ex) would return an HCLASS. The ATOM behaves like a handle, but I still have to generate a string i... |
Posted March 7, 2010 9:49:51 PM
|
How do I save an std::string to a file if there are non-ascii characters present
|
I'm using std::string in my project, and I have selected "Unicode" as my character set in visual studio, which I assume means UTF-8. Now, I want to just be able to do this:
stream.write(string.data(), string.size());
But looking at documentation ab... |
Posted September 3, 2009 6:24:24 PM
|
Is it okay to use a reference instead of a pointer in this case?
|
This is something I have never tried before.
My game engine is based around events. The main event class of my event system is the EventDispatcher. The EventDispatcher is responsible for making sure all the event subscribers get notified when an e... |
Posted January 23, 2008 3:25:10 PM
|
Odd syntax errror
|
I really thought that syntax errors were behind me, but Visual Studio 2008 just served me a cold plate of humble pie.
I am getting the errors:
videosystem.h(27) : error C2065: 's' : undeclared identifier
videosystem.h(27) : error C3867: 'liche... |
Posted January 21, 2008 9:21:56 AM
|
Help! My monitor is stuck at 60 Hz.!
|
Hey everyone, hope you all had a merry Christmas, or just a merry random day if you don't celebrate Christmas. Anyway, here is my horrible dilemma:
For Christmas, I got a new Radeon HD 2600XT! But, since I have a six-year-old CRT monitor, I have t... |
Posted December 26, 2007 9:48:23 AM
|
Engineering a Win32 Api wrapper in C++. Best Architecture.
|
I'm quite a newbie in the field of software engineering, so I could really use some help creating my Win32 wrapper. I've been working on this for about a week and I just seem to be going in circles. First, I will talk about what this wrapper wil... |
Posted December 18, 2007 11:38:40 PM
|
How do you combine static library files?
|
I am making a simple game engine which has each subsystem as its own library file (engine_renderer.lib, engine_input.lib, etc.) but I want the user to have the option of simply linking one library file that includes everything (engine.lib). Also... |
Posted December 12, 2007 4:10:38 PM
|
What is up with side-by-side assemblies?
|
Okay, I've had this problem for a while, and I'm thinking of just changing programming languages all together. Here's the problem: every time I try to use Visual C++ 2005 with certain libraries (like SDL) I get this weird error that says "this applic... |
Posted November 1, 2007 11:40:04 AM
|
Another SDL "Entry point must be defined" error.
|
Okay, this error seems pretty common, so I've been searching for solutions for the past hour and none have helped.
I am using Visual C++ 2005 and SDL, and getting the error "LNK1561: entry point must be defined".
Now:
-I have linked against sd... |
Posted October 7, 2007 4:03:34 PM
|
How to set individual bits in a bit field
|
Hello, I'm writing a memory manager for my game engine (for purely educational purposes), and I've hit a wall. The way I divide up my heap is into segments, where each segment is divided into pages, and each page is divided into homogenously sized me... |
Posted September 30, 2007 6:10:01 PM
|
View All Topics Started By This User
|
|
Some recent replies made on our forums |
Why does the win32 API use strings as class identifiers instead of handles?
|
Quote:Original post by Codeka
I would say it's because class names are for more than just registering your own class. There's also the "well-known" class names such as "BUTTON", "EDIT", "LISTBOX", etc. They need to be strings so that you can refer t... |
Posted March 8, 2010 10:18:12 AM
|
How do I save an std::string to a file if there are non-ascii characters present
|
Alright cool, and each code unit in UTF-8 is a byte so I can be like:
stream.write(str.data(), str.size());
and it'll work right. Thanks everyone, for your help.
Edit: and by work right I mean it will copy the entire buffer through the str... |
Posted September 3, 2009 8:07:05 PM
|
How do I save an std::string to a file if there are non-ascii characters present
|
Quote:
The short of it is: Unicode in C++ is a mess. size() and length() will get you the number of code units in the string, not the number of code points. This is because neither std::string nor std::wstring know which encoding is being used.
O... |
Posted September 3, 2009 6:50:52 PM
|
least crazy way of doing real time music synthesis?
|
Oh, check this out too:
Buzz Machines |
Posted August 30, 2009 5:42:57 PM
|
least crazy way of doing real time music synthesis?
|
I was having a similar problem as you, basically I ended up having to synthesize on my own!
Yes, MIDI only describes synthesizer instructions, and requires a synth be present to hear anything. Windows has a default (kind of crappy) synth... |
Posted August 30, 2009 3:10:07 PM
|
April Fools day prank gone wrong - Downgraded crashes my car
|
That's heartbreaking! It's like your good friend just gave you up, let you down, and just ran away from it all. I hope no one else ever deserts you like this again boolean. |
Posted April 1, 2008 10:02:41 AM
|
creating own browser
|
Do you mean this? It actually looks quite nice from the screen shots (as an editing tool). |
Posted January 31, 2008 4:07:01 PM
|
Is it okay to use a reference instead of a pointer in this case?
|
Quote:
The idea with events is to help with MVC separation. Your button doesn't need to know how to do the task that's associated with it; it only needs know that it controls some object, and to tell that object "hey, I've been clicked!" The ob... |
Posted January 25, 2008 6:18:34 PM
|
Is it okay to use a reference instead of a pointer in this case?
|
Quote:
(EDIT: Careful of order of initialization! And if you have a cyclic dependency, you'll have to use pointers, because references must be initialized, and there's a chicken-and-egg problem with the initialization.)
Ooo, I didn't even think... |
Posted January 25, 2008 2:48:14 PM
|
Is it okay to use a reference instead of a pointer in this case?
|
Quote:
Er, how exactly is that? Do you just create a local Game instance in main() or something?
Yes, actually:
int main(int, char**) {
Game game;
game.Run();
return 0;
}
|
Posted January 24, 2008 10:41:42 PM
|
View All Replies Made By This User
|