NASM - The Netwide Assembler

NASM Forum => Example Code => Topic started by: BalticMusicFan on January 30, 2018, 06:45:51 AM

Title: Windows GDI animation with semitransparent pixels and custom shape 64 bits
Post by: BalticMusicFan on January 30, 2018, 06:45:51 AM
I had fallen into too much bogus information when I tried to create a program for the first time that draws something to the screen. To decrease your chance to get stuck with this topic, I am sharing code that does more than showing sample picture within rectangle. Since source code is way larger than I would like to scroll over here, it is available at https://pastebin.com/nLQgpNqn (https://pastebin.com/nLQgpNqn) .

Some myths I would like to debunk with this code:
If you are only on 32 bit OS or not very friendly with assembler, you might still see some hints how to deal with Windows graphics some other way.
Title: Re: Windows GDI animation with semitransparent pixels and custom shape 64 bits
Post by: Frank Kotler on January 30, 2018, 07:39:43 PM
Thanks, BalticMusicFan!

Nasm's Windows users need all the help they can get from each other!

Best,
Frank

Title: Re: Windows GDI animation with semitransparent pixels and custom shape 64 bits
Post by: avcaballero on January 31, 2018, 08:42:04 PM
Hello. I couldn't compile it with

nasm.exe -w-orphan-labels "messageboxa x64.asm" -f win64 -o "messageboxa x64.obj"
GoLink.exe "messageboxa x64.obj" "kernel32.dll" /dynamicbase /entry start /largeaddressaware /nxcompat /fo "messageboxa x64.exe"

I'v got the next error: nasm: fatal: unable to open input file `messageboxa x64.asm'

Thank you
Title: Re: Windows GDI animation with semitransparent pixels and custom shape 64 bits
Post by: Frank Kotler on January 31, 2018, 09:29:37 PM
Hi Alfonso,

Filename on effing pastebin seems to end in "asm.asm". Lemme see if I can attach it here... Thanks for the heads-up!

Best,
Frank

Title: Re: Windows GDI animation with semitransparent pixels and custom shape 64 bits
Post by: avcaballero on February 01, 2018, 02:04:08 PM
Hello, Frank. Great work, as ever  :)  It was my fault naming the file ???
Title: Re: Windows GDI animation with semitransparent pixels and custom shape 64 bits
Post by: BalticMusicFan on February 01, 2018, 09:11:18 PM
Thanks for the heads up!

I was experimenting with export labels feature to figure out best way how to properly sort and annotate code pieces so looking at them would make sense what each code block is about to accomplish for programs that are at reasonable size. Preparing myself for greater challenges.
So far figured out one rule that serves well: Every Label Name Is Correct And Unique no matter how labelled position is reached. It is drastic against usage of if elseif else blocks because you are not forced to name them unique, though I have not intended to blame them in first place. Unintended consequences for otherwise nice features.

Thanks, BalticMusicFan!

Nasm's Windows users need all the help they can get from each other!

Best,
Frank
Title: Re: Windows GDI animation with semitransparent pixels and custom shape 64 bits
Post by: Frank Kotler on February 01, 2018, 10:28:09 PM
Well, thanks again in any case. I think you'll find that after four(?) posts you'll be allowed to attach files. I blame the spammers for the fact that the Forum is such a PITA.

Beginners hoping to program for Windows often find an example for Linux, which of course won't work. Your comments at the top of the file showing command lines for Nasm and GoLink are a great help. Nasm will do a lot of things, and the wrong commend line is no help. I haven't worked with Windows since win98 was current, so I can't help much.

Best,
Frank

Title: Re: Windows GDI animation with semitransparent pixels and custom shape 64 bits
Post by: BalticMusicFan on February 19, 2018, 12:08:23 AM
So there goes first and most likely final changelog. Last version is available at GitHub https://github.com/BalticMusicFan/messageboxa-x64 (https://github.com/BalticMusicFan/messageboxa-x64) .