|
Tricks of the Windows Game Programming Gurus is a great beginner game programming book.
But I'd suggest you learn some console C++ programming and some other windows stuff before tackling a game.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
My suggestion is that you play around with VC, and try to fix any errors you don't understand at first. Make sure that you get a grip on the windows API before trying to use DirectX. It is much simpler to learn to program by trial and (finding and fixing) error than by reading any book. When you have a basic understanding of windows, you could start blitting and flipping using OpenGL (somewhat simpler to learn) or DirectX (cooler and faster).
Another thing - if you have taken prevoius programming courses, forget anything they might have said about clean code. Game programming is not clean - it is fast. Read "T&T of the game programming gurus" from SAMS. It is one of few gameprogramming books that are affordable and really useful for beginners.
Hope to see your name on the box of the next bestselling game;)
/moliate
|
|
|
|
|
my program gets a assertion error when i try to fire an event from my (made with VC) OCX, the reason why i get it is because at the beginning of a method in the ocx, i make a thread so multiple controls can run at once, and i think what the event is doing is trying to Fire the event, but since it's in a new thread, there isnt that control to catch the event... ? Am i right?
But how do i fix it!?! CWinThread? I NEED this to be multithreaded, is there any way to make sure the event gets fired to the correct thread? Am I way off base? Help me!!!!!
<sigh> desperate.
|
|
|
|
|
Hi!
I've written a shell extension which allows you to browse your Linux ext2 filesystem from windows explorer on NT/2000. A new icon will pop up below My Computer.
It has full read-capability, you can copy and paste from your Linux filesystem to C:, D: or for example to a network resource.
Since not a single write command exists in the code, it is impossible for the extension to destroy anything.
The reason for writing this letter is that it needs beta testing. If you are interested, mail olowo726@student.liu.se. If there is any interest, I will release it as freeware in the future.
//Olof Wolgast
|
|
|
|
|
When compiling a regular dll in Beta2, it gives the following error:
error C2065:'ILS_NORMAL':undeclared identifier c:\program Files\...\atlmfc\include\afxcmn.h line 1336
It seems 'ILS_NORMAL' is not defined in any of the header files in beta2. It is more like ILS_??????? has something to do with the internet than with the image lists. Defining ILS_NORMAL as 0x0 (re: cmnctl.h) at the top of afxcmn.h makes the compile go through, but are there better solutions?
|
|
|
|
|
#define ILS_NORMAL 0x00000000
#define ILS_GLOW 0x00000001
#define ILS_SHADOW 0x00000002
#define ILS_SATURATE 0x00000004
#define ILS_ALPHA 0x00000008
from commctrl.h in RC1...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
You mean to say to include commctrl.h besides afxcmn.h?
|
|
|
|
|
Ernest wrote:
You mean to say to include commctrl.h besides afxcmn.h?
Yep, the following is from the latest Platform SDK (in the buttom it says what header to include)
ILS_NORMAL (0x00000000)
The image state is not modified.
ILS_GLOW (0x00000001)
Adds a glow effect to the icon, which causes the icon to appear to glow with a given color around the edges. The color for the glow effect is passed to the IImageList::Draw method in the crEffect member of IMAGELISTDRAWPARAMS.
ILS_SHADOW (0x00000002)
Adds a drop shadow effect to the icon. The color for the drop shadow effect is passed to the IImageList::Draw method in the crEffect member of IMAGELISTDRAWPARAMS.
ILS_SATURATE (0x00000004)
Saturates the icon by increasing each color component of the RGB triplet for each pixel in the icon. The amount to increase is indicated by the frame member in the IMAGELISTDRAWPARAMS method.
ILS_ALPHA (0x00000008)
Alpha blends the icon. Alpha blending controls the transparency level of an icon, according to the value of its alpha channel. The value of the alpha channel is indicated by the frame member in the IMAGELISTDRAWPARAMS method. The alpha channel can be from 0 to 255, with 0 being completely transparent, and 255 being completely opaque.
Constants Information
Header commctrl.h
Minimum operating systems Windows XP
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
Does anyone know how to fix the bars of a CSplitterWnd bar so the user cannot resize them? I can't find any info in the MSDN, CP, or CodeGuru. Thanks for any help.
Mark
Sonork ID 100.10778:Waxy
------------------------------------------------
I am not discouraged because every wrong attempt discarded is another step forward
-- Thomas Edison --
|
|
|
|
|
1)
Use ClassWizard to create a new class named CMySplitterWnd of class type "generic CWnd" and change the references to CWnd in the class declaration and BEGIN_MESSAGE_MAP macro to CSplitterWnd.
2)
Using ClassWizard, create message handlers for WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, and WM_MOUSEMOVE. Bypass the CSplitterWnd functionality in each of these overrides by calling the corresponding CWnd handlers. The following example illustrates the WM_LBUTTONDOWN handler:
void CMySplitterWnd::OnLButtonDown(UINT nFlags, Cpoint point)
{
CWnd::OnLButtonDown(nFlags, point);
}
3)
Change any embedded CSplitterWnd members of your frame class to type CMySplitterWnd.
4)
Remove any menu items that generate a ID_WINDOW_SPLIT command (such as the "Split" item on the VIEWEX sample's "Window" menu). This prevents CView::OnSplitCmd() from being called.
By the way, this is "Copy-Paste" from the MSDN.
--BlackSmith--
|
|
|
|
|
I guess it all depends what you're searching for. "Tracking" was the keyword I should've searched for. It worked like a charm. I also over-rode the OnMouseMove message so the cursor doesn't change to a resize cursor.
Thanks for the help!!
Mark
Sonork ID 100.10778:Waxy
------------------------------------------------
I am not discouraged because every wrong attempt discarded is another step forward
-- Thomas Edison --
|
|
|
|
|
I'm developing serv-cli game
( using CSocket, negotiating with Send()/Receive() )
I also have these classes:
[1]
class CMsg{
public:
virtual void method() = 0;
};
[2]
class CMsgDerive : public CMsg{
public:
virtual void method()
{
AfxMessageBox("Moo");
}
};
both sides familiar with this classes. Next, I send the data to the server:
clientSocket.Send((void*)&CMsgDerive(), sizeof(CMsgDerive));
I receive the data at the server:
void CServrSocket::OnReceive(int err)
{
TCHAR lpBuffer[1024]; //The data is much smaller
Receive(lpBuffer, sizeof(lpBuffer));
CMsg *pMsg = (CMsg*)lpBuffer;
pMsg->method(); //Here I get "unhandable exception" error, WHY???
}
Thank you all!
--BlackSmith--
|
|
|
|
|
I think the server try to call CMsg::method() which is abstract. There is AFAIK no way the server knows that it's actually a CMsgDerive class that you are sending...
Virtual functions are great, but I have seen a lot of errors when used like you do...
Have you tried CMsg *pMsg = (CMsgDerive*)lpBuffer; instead, or even CMsgDerive *pMsg = (CMsgDerive*)lpBuffer;?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
It is crashing because the virtual function pointers are not the same on the client and the server. Your current approach is really bad, try looking through the source of some open source client/server network games for some better ideas.
Chris Hafey
|
|
|
|
|
I am developing a piece of software for my Diploma Thesis Project. When I created the framework with AppWizard, I was asked what language I wanted my resources in. The only choice was English (U.S.). But I run a Greek version of Windows 98 and, after all, Greek is my mother tongue. How can I have an application with all resources in Greek?
George Metaxas
Student of Electrical & Computer Engineering
Aristotle University of Thessaloniki, Greece
|
|
|
|
|
I would like to check the status of the SQL Server Service from within a C++ app.
My Installshield app installs MSDE if needed so I can assume SQL Server is a least present on the PC.
The functions I am looking for:
- See if it is installed - I currently do this via CurrentVersion item under the Software\Microsoft\MSSQLServer\MSSQLServer\CurrentVersion key
- See if it is running
- See if it is configured to start automattically at boot time
I would also like the ability to set up SQL Server to run and start at boot time from my app as well.
The difficult part is that I am looking to do this under Windows 98, ME, NT, 2000 and XP. I know there are functions in NT, 2000 and XP that I can use but I need all OS's.
Thanks
AW
|
|
|
|
|
You need to Cheek the status Service.
Use OpenService and then use QueryServiceStatus for check the status of service....
Best Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Carlos:
It appears OpenService and QueryServiceStatus do not run under Win 98.
AW
|
|
|
|
|
|
Look on MSDN for "Windows Address Book"
Michael
|
|
|
|
|
|
here's how i do it with std::wstring:
void replace_all(wstring& target, const wstring& to_find, const wstring& replacement )
{
if (to_find.empty())
return;
size_t replace_inc = replacement.length();
for (size_t loc = target.find( to_find );
loc != wstring::npos;
loc = target.find( to_find, loc + replace_inc ) )
{
target.replace( loc, to_find.length(), replacement );
}
}
-c
Smaller Animals Software, Inc.
|
|
|
|
|
If you don't mind a little unsupported code you can use CString from WTL.
|
|
|
|
|
I want to catch WM_CLOSE from WinAmp and then my app will do something.
Is it possible to catch a windows message in my app that is in WinAmp??
Win32 API programming code example if you want to give code example
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|