|
What language/library are you using? I don't recognise outtext() or outtextxy() . The only place I know them from is the old Borland Turbo Pascal/C BGI drivers, but I haven't used them for years.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
The only place I know them from is the old Borland Turbo Pascal/C BGI drivers, but I haven't used them for years.
Same here...
John
|
|
|
|
|
For fullscreen games, use OpenGL or DirectX. I found OpenGL was easier to learn. They both deal with 2d and 3d graphics.
I can't help you for non fullscreen games like minesweeper though... perhaps learn GDI+ or something?
dog_spawn
http://hatekill.yojutsu.com[^]
|
|
|
|
|
dog_spawn wrote:
perhaps learn GDI+ or something?
GDI+ is nice and powerful, but much slower than GDI, although for a simple game like minesweeper, I'd hardly say performance was an issue
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
dog_spawn wrote:
They both deal with 2d and 3d graphics.
Uhhh, in all honesty OpenGL is a 3D API. Sure, you can (with some effort) use its 3D functionality (slapping quads) in conjunction with awkward texture-replacing primitives to implement a 2D API, but then you also can use a hammer to pound on the keyboard.
DirectDraw/DirectX deals with 2D gfx in a way more direct, to-the-point and familiar way than any 3D API ever could, or even should, do.
If the game gfx-speed isn't time critical, I'd rather suggest GDI than DirectDraw (since the latter is inherently way more complex and error-prone). Creating a DIBSection and blitting around within only the gfx cards memory can get you quite reasonable speeds also (way faster than screen refresh rate).
|
|
|
|
|
i think that you are using the good old turbo c++.
try the funtion itoa(int val,char* buffer,int base) to convert the integer to a string and then use the string.
for floats you can use ftoa(float val,char* buffer,int base).
to get the int ir the float back use atoi or atof etc.
The Debugger
|
|
|
|
|
hey debugger thanx man..i wanted exactly that!!these guys were talking about openGL and all that stuff.hey but i'm just a tyro..thanx once again.i'll try that out.. ;)
|
|
|
|
|
Convert the number to a string...
John
|
|
|
|
|
I noticed the forum for "Managed C++", what exactly does that mean?
Thanks, Dave
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
|
Subset of C++ with some MS proprietary extensions and GC, running inside a virtual environment.
|
|
|
|
|
Thanks both
Dave
"The man who reads nothing is better educated than the man who reads nothing but newspapers."- Thomas Jefferson
|
|
|
|
|
I am using the MFC. I have created a dialog, which has a static control and a comboBox, both elements have membervariables. I want to show the dialog like this:
....<br />
CMyDialogDlg mydialog;<br />
mydialog.m_static.SetWindowText("this works");<br />
mydialog.m_combo.AddString("this crashes");<br />
mydialog.DoModal();<br />
....
There is no problem setting the windowtext of the staticcontrol. But if i use AddString before the dialog is shown by DoModal(), it crashes. If i use AddString in InitDialog() , it works.
Can you explain me why?? what have i forgotten?
|
|
|
|
|
AddString() sends a message to a window that hasn't been created yet. You can't do this. You have to call it after the window has been created - OnInitDialog() is the place to do it.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks,
as i mentioned, I know that it works, if i put this in InitDialog (or OnInitDialog() ) . But why does it work with a static control or a textbox?
sledge
|
|
|
|
|
W. Hammer -sledge- wrote:
But why does it work with a static control or a textbox?
No idea. It shouldn't work.
I wouldn't do it there anyway. Dialog boxes are responsible for showing the data. The class or function that uses the dialog box is responsibe for giving it the data - the dialog should then set the controls to reflect that data - the calling function shouldn't really need any knowledge of how the data is shown to the user.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
this code would not budge because you are trying to add the strings to some objects which aren't even created, forget about the initialization which is manatory for the working of the gui object
The Debugger
|
|
|
|
|
I thought I read somewhere (yeah I know, real scientific.....) that static controls are available as soon as the dialog box they live in is instantiated. Combo boxes call malloc when they are created and contain pointers internally. Trying to call them before they are properly initialized will crash you.
I'm going to live forever or die trying!
|
|
|
|
|
I am looking for a way to get the mouseleave/mouseout method
for my activex control. When I test with ActiveX container tester
mousemove can get the event when it is on the control.
However, once the mouse is out of control, i don't get anything.
Thank you for help
Shin
|
|
|
|
|
You can use the TrackMouseEvent[^] API.
It only works on Win98 or above, so if you need Win95 compatibility, you'll have to simulate MouseLeave using a timer: Start the timer when the mouse is first moved into the control. In the timerproc, use GetCursorPos to see if the cursor is outside of the window. If it is, fire a MouseLeave event, and stop the timer.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Cool! I wish I'd known about that. The number of times I've used SetCapture() and tested the location of the mouse cursor...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks for the helpfull post
How to use this TrackMouseEvent?
I have been looking for and
they said I have to add
#define _WIN32_WINNT 0x0400
this line. Still said TrackMouseEvent
is not defined. So I added #include <winuser.h>
the result is the same....
|
|
|
|
|
Hi, all
I am planning on an http web server, and I have read some of the I/O completion and multithread server articles, but I really don’t understand why anyone would develop a multithread server? Would it just make it more difficult and slow, because of all the critical sections that have to be thread-safe? Why use worker threads that loops until a service is requested. Can’t you just use completion callback and windows message-based notification of network events to serve connected users? What’s the point of using multiple threads in a server?
My server is going to run on older windows versions (95/98/ME) so I have to handle the worker threads (if I should use them) and connection sockets by my self, and of course the server has to support at least 500 user connections simultaneously.
Anyway, I really don’t see any performance advantage by using multiple threads, so please tell me what I am missing because it seems like everyone is using it.
Thanks in advance
Aidman » over and out
|
|
|
|
|
Aidman wrote:
windows message-based notification of network events to serve connected users? What’s the point of using multiple threads in a server?
This is slooooow, and needs a Window which most servers dont have
Aidman wrote:
My server is going to run on older windows versions (95/98/ME) so I have to handle the worker threads (if I should use them) and connection sockets by my self, and of course the server has to support at least 500 user connections simultaneously.
500 users at the same time on Win9x, interesting
Aidman wrote:
Anyway, I really don’t see any performance advantage by using multiple threads, so please tell me what I am missing because it seems like everyone is using it.
Normally I use asynchronous socket, or if on NT based systems, IO Completion Ports.
A limited number of threads is a good thing, it makes the application scale on multi-CPU computers, a single threaded server only uses a single CPU.
And also, when a thread is "suspended" when waiting for IO like disk or network activity, it's good to have extra threads to keep the processor(s) working (if there is work to do, of course)
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Multiple threads buy you nothing as long as you don't have an extra CPU available.
Oh and if you are never waiting on resources.
Well, such as reading a file.
Then multiple threads buy you everything.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|