This is my first post so please dont hurt me :)

I recently discovered Win32ASM and i love the idea of programing windows in assembley laungauge. I had experimented with writting a couple of programs( none of which work right, but they always kinda work LOL).

The program i am trying to write at the moment is a Universal Crosshair for First Person Shooter (FPS) games. I am affraid that my imagination vastly outstrips my skill with programming. I had attached my most recent attempt at bringing my idea to life, its pretty simple, 2 black lines on the sceen one horizontal, one vertical(very simple please dont laugh ). The problem i have is that when useing the program in an FPS i dont know how to get the crosshair to refresh properly, it flickers and disappears at the moment. I would be grateful for any help or advice on how to solve this.

Thanks for your time :)
Bigger Thanks if you reply, im kean, just rubbish at programming

Im using MASM32 v7 and Windows XP SP1
Posted on 2002-11-22 08:50:39 by harry4321
Afternoon, harry4321.

Welcome to the messageboard:) .

For a start...
have a look through the examples which come with the Masm32 package, to see how the basic structure of a Windows proggy is set up.

The main thing you want to do, is to draw your crosshairs inside a WM_PAINT message handler.

FPS games use OpenGl or DirectX for render the graphics.

Cheers,
Scronty
Posted on 2002-11-23 20:23:30 by Scronty
Hi again

thanks for the reply

I have looked at aolt of the exmaples, but they all have a Windows "Window" i was trying to write the program to not have a window, but this means i cant understand how my program knows that the WM_PAINT message is for it? and where to i put the message loop(do i have a winmain())? etc.

Does anyone know of simlar program to mine or even just a ASM/C/C++ prog that works without a window.

Im learning :) slowly maybe ill get it by the time everyone is using 64 bit :)

i didnt want to complicate myself with OpenGL or DirectX, just wanted to stick with standard Win32API and GDI stuff for now(bad experiance with OpenGL as a child you see).
Posted on 2002-11-23 21:17:48 by harry4321
"Hello World!" *Doesn't* use a Window.
Check out the masm homepage.
Posted on 2002-11-23 23:25:39 by Homer
Afternoon, harry4321.

Those examples which don't use an actual window and wndproc are just that: examples.
They're meant to show the minimum needed to display something, however they're not meant to be used for a full-blown application:). (I'm talking about that "minimum" example in the Masm32 package).

For an actual application, you need to have a main window and a message handling proc. Even if you wish to draw over the whole screen, you will still need a window.

At the moment you're using the screens' dc. This isn't good, as a user could be running multiple applications at the same time. If the user switches between your application and one of the others, your proggy will still draw over the entire screen. That's not behaving properly :tongue:.

What you could do, is make your main window the size of the entire screen, and use the dc of the window to draw upon.

Cheers,
Scronty
Posted on 2002-11-24 15:34:59 by Scronty