flat assembler
Message board for the users of flat assembler.
Index
> Projects and Ideas > Fasm with SDL.DLL |
Author |
|
sleepsleep 04 Jun 2012, 21:01
just wanna try something new
i start from here, http://www.lazyfoo.net/SDL_tutorials/lesson01/index2.php SDL.DLL is downloadable from http://www.libsdl.org/download-1.2.php Code: format PE GUI 4.0 include 'win32ax.inc' SDL_INIT_EVERYTHING = 0x0000FFFF SDL_SWSURFACE = 0 .code start: invoke SDL_Init,SDL_INIT_EVERYTHING invoke SDL_SetVideoMode,640,480,32,SDL_SWSURFACE mov [screen],eax invoke SDL_RWFromFile,"hello.bmp","rb" invoke SDL_LoadBMP_RW,eax,1 mov [hello],eax invoke SDL_UpperBlit,[hello],NULL,[screen],NULL invoke SDL_Flip,[screen] invoke SDL_Delay,2000 invoke SDL_FreeSurface,[hello] invoke SDL_Quit .data hello dd 0 screen dd 0 section '.idata' import data readable writeable library kernel32, 'kernel32.dll',\ user32, 'user32.dll',\ msvcrt, 'msvcrt.dll',\ sdl, 'sdl.dll' include 'API\KERNEL32.INC' include 'API\USER32.INC' include 'API\MSVCRT.INC' include 'API\SDL.INC'
|
|||||||||||
04 Jun 2012, 21:01 |
|
Picnic 11 May 2014, 17:39
^^I had the same mood today, inspired by your post.
After reading Lazy foo tutorial 20, here is an enhanced example of animating sprites and parallax scrolling with SDL. Use keyboard arrows left/right to move hero. I used SDL 1.2.11 includes written by Raedwulf.
Last edited by Picnic on 21 Mar 2020, 07:42; edited 1 time in total |
|||||||||||
11 May 2014, 17:39 |
|
JohnFound 12 May 2014, 08:34
Picnic, it is really very good example!
I decided to develop it a little and to turn it to a portable example, using FreshLib. (SDL is portable library, so why to limit yourself to Windows only?) Additionally I cleaned up the source a little and adapted it to FreshLib requirements. I hope you don't mind it... Are you? In this post is attached the edited example (contains compiled binaries for Win32 and Linux). For compilation you will need the recent FreshLibDev (or newer). If you want to compile it with FASM, set following environment variables: lib = directory where FreshLibDev is unpacked (where "freshlib.inc" and "freshlib.asm" resides. TargetOS = "Win32" or "Linux" Ah, and one more note: The Windows example needs more .dlls: "libpng" and "zlib" in order to be self-contained. I added them to the package as well.
_________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||||||||||
12 May 2014, 08:34 |
|
m3ntal 14 May 2014, 18:40
Picnic: Cute example Good luck with your web site!
John: Why can't you write your own code? I'm not surprised to see John begging programmers for their code. He has been doing this since the MASM community. But John only asks for permission when he has to. He would outright steal your work if he could get by with it! See, John wants you to write code for him. "Don't use if... because John only likes to copy and paste ''real" assembler. He doesn't want to have to convert your .if's to cmp's. |
|||
14 May 2014, 18:40 |
|
JohnFound 14 May 2014, 19:18
Come on, mental! It seems to me you are simply jealous, because your code is not included in the Fresh project. Sorry, but it is because Fresh is only asm. Write some valuable asembly code and I will ask you as well to use your code. If you don't have ideas, I can think a task for you.
|
|||
14 May 2014, 19:18 |
|
sleepsleep 15 May 2014, 03:56
awesome!!,, =) picnic!!
|
|||
15 May 2014, 03:56 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.