Zisly Posted June 25, 2009 Posted June 25, 2009 I'll try to make use this for a little game, let's see how fast it is
AdmiralAlkex Posted June 25, 2009 Author Posted June 25, 2009 (edited) I'll try to make use this for a little game, let's see how fast it is I haven't done any serious benchmark's but It should be faster than GDI+ (and it's easier to use when you learned it).Please tell me if you would like any special benchmark's or examples created Edited June 25, 2009 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Zisly Posted June 25, 2009 Posted June 25, 2009 (edited) I think I get it Little example of what I got #include "SDL v10.au3" #include "SDL_image v1.au3" _SDL_Init_image() _SDL_Init($_SDL_INIT_EVERYTHING) $Surface = _SDL_SetVideoMode(640, 480, 32, $_SDL_SWSURFACE) $map = StringSplit(FileRead("map.txt"), ',') $ii=0 For $i = 1 To $map[0] $Loaded1 = _IMG_Load("C:\Documents and Settings\lars\Desktop\AutoIt Game (SDL TEST)\Sprites\" & $map[$i] & '.bmp') _SDL_BlitSurface($Loaded1, 0, $Surface, _SDL_Rect_Create($ii, 96, 32, 32)) $ii +=32 Next _SDL_Flip($Surface) While 1 WEnd _SDL_Quit() _SDL_Shutdown_image() Any faster way I could do that? And is _SDL_Flip really function is a bit misleading lol, (the name) is it really done to show the rendered things? Edited June 25, 2009 by Zisly
AdmiralAlkex Posted June 25, 2009 Author Posted June 25, 2009 Well I don't have those images and the txt but it looks alright to me . About _SDL_Flip(), it's actually for "flipping" the screen buffers when using doublebuffered (hardware?) rendering. When used like in your script it's the same as _SDL_UpdateRect($Surface, 0, 0, 0, 0) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Zisly Posted June 25, 2009 Posted June 25, 2009 Ok Working on a tile based game just for fun now, the hard part will be rendering the character
AdmiralAlkex Posted June 25, 2009 Author Posted June 25, 2009 Doesn't sound very hard to me . Ah well you know where to find me if you need help .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Zisly Posted June 26, 2009 Posted June 26, 2009 Seems pretty fast if you load everything before starting rendering
madflame991 Posted June 26, 2009 Posted June 26, 2009 (edited) P.S. A cookie to the one who knows where the quotes in the MsgBox is from It's from Startrek... It was the vulcans motto. I think it was first said by Spock in the first series ever produced.Regarding your SDL library... YOU DID A GREAT JOB! I have been waiting for this since I joined the forums back in 2006 and saw on the first page of Autoit's website "Feaures: bla bla bla... you can make games calling the SDL library... bla bla bla". I think they erased that part when, in jan 2008, I actually asked for an example hereKeep up the good work! I'll most likely want someday to make a game.Thx! Edited June 26, 2009 by madflame991 Game Game Gadget! - read about indie games, gadgets, chiptunes and demoscenesAssembly-like language interpreter and custom machine emulatorSuper Mario Screen Mate - official website or autoit forum pageCogut - Puzzle Game + Editor like sokoban and others
ProgAndy Posted June 26, 2009 Posted June 26, 2009 Ohh, why did i propose PtrStringRead for SDL_WM_GetCaption? I just found a way to do it without this func: you can use str*, too. ;Written by ProgAndy Func _SDL_WM_GetCaption() Local $aResult = DllCall($__SDL_DLL, "none:cdecl", "SDL_WM_GetCaption", "str*", 0, "str*", 0) Local $aTemp[2]=[($aResult[1]), ($aResult[2])] Return $aTemp EndFunc *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Zisly Posted June 26, 2009 Posted June 26, 2009 (edited) Edit: Solved, was pretty easy Edited June 27, 2009 by Zisly
JRSmile Posted June 27, 2009 Posted June 27, 2009 (edited) any chance to hook an existing directx game and display test as overlay via SDL? Edited June 27, 2009 by JRSmile $a=StringSplit("547275737420796F757220546563686E6F6C75737421","") For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4) Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])));''Chr("a")&"HI" Next ;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile; MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)
AdmiralAlkex Posted August 2, 2009 Author Posted August 2, 2009 @AllNew update uploaded.Implemented SDL_sprig:Advanced library dealing with 2D graphics, Surfaces and more.Implemented SDL_sge:More basic library dealing with 2D graphics, and more.Updated SDL_gfx:Implemented functions for controlling framerate (tested and 100% working)Lots of other things done:Fixed SDL_WarpMouse()Added new _SDL_WM_GetCaption() from ProgandyFixed _SDL_SaveBMP_RW()New example: SDL Example Convert Image to BMP.au3 (loads any image in the usual formats and spit out a bmp)+Lots of minor(ish) things. Run your favourite file comparing utility and check for yourself if you are curious Please note that SDL_sprig and SDL_sge was (mostly) automatically converted by a tool I built and not by me. That means that the local variable-names look like crap, but it saved me a shitload amount of time to not have to write around 200 funcs. I will try to find a way to clean them up in a future update.Download is as usual in second post.@madflame991You won the cookie! Swing by my place next time you go to Sweden and I will buy you the biggest one I can find P.S. Did you see the reference in SDL.au3? It's not really hidden, but you need to have seen VOY to get >_< @ProgAndyThank you, it's really nice to see some contributions. This function is included with V.11 and forward.@JRSmileNot that I know off, SDL was created to make games, not interface with them. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
AdmiralAlkex Posted August 5, 2009 Author Posted August 5, 2009 Is seems 2 of the examples in the download gives errors on "duplicate funcitons". If you get that open THE EXAMPLE and remove those funcs. They are leftovers from v10. And remember that "q" is for exiting the scripts with a SDL gui so you don't panic when you run "SDL Example WarpMouse.au3" >_< .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Zisly Posted August 7, 2009 Posted August 7, 2009 I didn't notice the update until now >_< I just gotta test the UDF later today
AdmiralAlkex Posted August 7, 2009 Author Posted August 7, 2009 I didn't notice the update until now I just gotta test the UDF later today Well there wasn't anything spectacular, both sge and sprig is mainly for primitives. I highly recommend sprig if you are into that kind of things, it has loads of more options (and a bit better speed to) than the others.Next update will probably be released next week, and should (if nothing unexpected happens) have sound and events implemented. More details when that day come >_< .You know, I could send you a message when I update it if you want, just add the hotmail-address in my profile to your Live Messenger . I am online almost every day. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
liten Posted August 7, 2009 Posted August 7, 2009 OMG i will love you forever if you add 3d My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
AdmiralAlkex Posted August 7, 2009 Author Posted August 7, 2009 OMG i will love you forever if you add 3dThat's not really needed. There already exist an OpenGL UDF written by trancexx. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
liten Posted August 7, 2009 Posted August 7, 2009 That's not really needed. There already exist an OpenGL UDF written by trancexx.Wow thanks see me and liek 20 other guys from auto it are trying to start on and cretes the first 3d Game in autoit, we have done 3d games(Bad Graphics) in C++ Etc, never improved on them so we think we know the concept just neede to find out how to load 3d objects you helped TY My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
AdmiralAlkex Posted August 7, 2009 Author Posted August 7, 2009 Wow thanks see me and liek 20 other guys from auto it are trying to start on and cretes the first 3d Game in autoit, we have done 3d games(Bad Graphics) in C++ Etc, never improved on them so we think we know the concept just neede to find out how to load 3d objects you helped TYMaybe you should look at the Au3IrrLicht too, it's quite impressive for being free and all. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Suirad Posted August 9, 2009 Posted August 9, 2009 (edited) great job with this, its coming along greatly! i really consider using this from now on as a replacement of gdi+. tho running your png in gui example, ive come to an issue. where would i be able to specify were on the gui to draw the image Edited August 9, 2009 by Suirad
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now