News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Information Needed

Started by Dark Schneider, February 17, 2005, 07:28:25 AM

Previous topic - Next topic

Dark Schneider

Hello again,

I want to know completely about bitmap and sound.
Where can I find this information?
Does any detailed tutorial exist somewhere?

Please help me, thanks.

petezl

You are asking too much to expect an answer! Comprehensive information doesn't exist for win32 asm. You have to learn it by searching asm forums, experimenting, studying snippets of code and asking questions. If you are in a hurry then learn a higher level language like C. It still won't teach you everything but will teach you a syntax that's capable of doing most of what you ask.

Peter.
Cats and women do as they please
Dogs and men should realise it.

fallenhobbit

Comprehensive info for c/C++ does exist because most games are written in c/c++ using one of various graphics libraries. Now for the fun trick. Find some C source, get yourself an install of MinGW, and then at the command line run g++ -c-S somefile.cpp
an assembly listing file will be generated. Enjoy.

pbrennick

Way to go fallenhobbit.  And after you have done that, take a look at Donkey's graphics library.  He has put a lot of work into it and works on bettering it all the time.  It is written in GoASM syntax, but that is very similar to masm and is callable from masm.  Also, it is not a bad idea to eventually know how to work with more than one assembler.  Just don't be surprised about what might happen next!

Paul

Dark Schneider

I means the very basic concepts of bit map and sound (e.g. how it works, basic APIs that manupulate it) not that complex graphic libraries.
Thanks for your advice anyway, I will take time to learn it I'm not in a hurry at all.

petezl

Ok!... , "completely" was a tall order. Basics I can help you with.

The easiest way to use Bitmaps and sound is to load them into a resource.

4000 BITMAP mybitmap.bmp
5000 WAVE mysound.wav

There are several ways to handle a bitmap in the program, best to start with something like .elseif uMsg==WM_INITDIALOG
invoke LoadBitmap, hInstance, 4000
mov hbitmap, eax

.elseif uMsg == WM_PAINT
invoke BeginPaint, hDlg, addr ps
mov hdc, eax
invoke CreateCompatibleDC, NULL
mov hMemDC, eax
invoke SelectObject, hMemDC, hbitmap
invoke GetClientRect, hDlg, addr rect
invoke BitBlt, hdc,0,0, rect.right, rect.bottom, hMemDC,0,0, SRCCOPY
invoke DeleteDC, hMemDC
invoke EndPaint, hDlg,addr ps


For the sound, have a look at the "PlaySound" api call
invoke PlaySoundA,5000,hInstance,40005h    ; SND_RESOURCE+SND_ASYNC

Peter.



Cats and women do as they please
Dogs and men should realise it.