Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

SDL UDF


  • Please log in to reply
89 replies to this topic

#61 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,697 posts

Posted 20 January 2010 - 04:33 PM

Silly me :huggles:

For anyone that saw this comment:

Note1 = The _SDL_*Color funcs doesn't paint the right colors.

You can safely IGNORE IT.
I was only testing it the wrong way. It works fine if you use 0xRRGGBBAA :D

To make a solid red, use :0xFF0000FF
To make a solid green, use :0x00FF00FF
To make a semi-transparent blue, use :0x0000FF80







#62 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,697 posts

Posted 21 January 2010 - 07:30 PM

@ALL

I have been experimenting with something that would greatly simplify distribution for the UDF.

The idea is to have the dll file included as binary in the include, and in the beginning of the *Init() func, check if the file exist and create it if it doesn't.
This would mean that you would never have to package any dll, and the total filesize would be smaller (in compiled form).
Working with source would be easier too. Copy include and you're done!

What do you think?
Makes sense?
Doesn't make sense?
Am I crazy?
Am I hungry? (actually yes I am)

Here's something for you to test so you see what I mean:
1. Download the updated SDL.au3
2. Download the "blob" containing the dll
3. Run a test script, like this:

#include "SDL.au3" ConsoleWrite("FileExist(SDL.dll) says: " & FileExists("SDL.dll") & @CRLF) _SDL_Init($_SDL_INIT_EVERYTHING) ConsoleWrite("FileExist(SDL.dll) says: " & FileExists("SDL.dll") & @CRLF) _SDL_Quit()


4. Pay attention to the ConsoleWrite. Neat, right? :D

(attachment removed, it's worthless without the "blob" (damn upload site that keeps deleting my files for no obvious reason), if it isn't in the next release, you could probably rebuild it in minutes anyway, or just ask me for the code)

SDL.au3 (52.35K)
Number of downloads: 162

Edited by AdmiralAlkex, 26 April 2011 - 12:59 PM.


#63 jcval

jcval

    Seeker

  • New Members
  • 3 posts

Posted 15 March 2010 - 03:22 PM

Português
Olá pessoal,
preciso saber como enviar o pressionamento de um botão no joystick, pois o jogo "street fighter 4" o player 2 não tem comandos no teclado.
Alguém sabe me ajudar?

Translate by google
Inglês
Hello everybody,
need to know how to send the push of a button on the joystick, because the game "street fighter 4" player 2 has no controls on the keyboard.
Someone help me know?

#64 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,697 posts

Posted 15 March 2010 - 10:17 PM

@jcval

SDL can't do that, it's for creating games, not automating them.

#65 jcval

jcval

    Seeker

  • New Members
  • 3 posts

Posted 16 March 2010 - 01:28 AM

@AdmiralAlkex

SDL can't do that, it's for creating games, not automating them.


Obrigado,
mas você tem alguma idéia de como fazê-lo?

thanks,
but you have any idea how to do it?

#66 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,697 posts

Posted 16 March 2010 - 09:44 AM

thanks,
but you have any idea how to do it?

I'm sorry, but no, I don't.

#67 dantay9

dantay9

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 834 posts

Posted 08 May 2010 - 03:05 AM

If I am using _SDL_GuiCreate to construct a gui, how do I reposition the gui to the center of my screen? Currently, it is in the top left hand corner.
"Failure is not an option -- it comes packaged with Windows" Gecko Web Browser, Yahtzee!, Toolbar Launcher (like RocketDock)Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI Triangle Solver, TCP File Transfer, Valuater's Autoit WrappersOOP In AutoItUsing Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com

#68 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,697 posts

Posted 08 May 2010 - 09:57 AM

You could set where the window should be created by setting the environment variable "SDL_VIDEO_WINDOW_POS", like this:
EnvSet("SDL_VIDEO_WINDOW_POS", 0 & ", " & 0)
The first number is X, and second Y. Don't forget the comma between them. Note that SDL read the environment variables when you do _SDL_Init(), so set them before that or nothing will happen.

Then there's always WinMove() (but that wouldn't look good, would it?) or you could create a normal AutoIt window and let SDL use that with SDL_WINDOWID. See the script "SDL Example Transparent PNG on AutoIt GUI.au3" for that.
And remember, controls ARE windows, so you could create a label or something, get it's handle and pass that to SDL_WINDOWID.
Just get the sizes right or things will get really weird.


Big :idea: EDit:
I was a bit bored so I wrote this half-crazy example:
AutoIt         
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #Include "SDL.au3" Local $GX = 640, $GY = 480 $hWnd = GUICreate(@ScriptName, $GX, $GY, 0, 0) EnvSet("SDL_WINDOWID", $hWnd) _SDL_Init($_SDL_INIT_VIDEO) $pSurface = _SDL_SetVideoMode($GX, $GY, 0, $_SDL_SWSURFACE)     ;Just for some variation _SDL_FillRect($pSurface, 0, 0xFF0000) _SDL_Flip($pSurface) GUISetState() Do     Sleep(10) Until GUIGetMsg() = -3 _SDL_Quit() GUIDelete($hWnd) Local $GX = 320, $GY = 240 $hWnd = GUICreate(@ScriptName, $GX*2, $GY*2, @DesktopWidth/2 - $GX, @DesktopHeight/2 - $GY) $hWnd2 = GUICtrlGetHandle(GUICtrlCreateLabel("", 30, 10, $GX, $GY)) EnvSet("SDL_WINDOWID", $hWnd2) _SDL_Init($_SDL_INIT_VIDEO) $pSurface = _SDL_SetVideoMode($GX, $GY, 0, $_SDL_SWSURFACE)     ;Just for some variation _SDL_FillRect($pSurface, 0, 0x00FF00) _SDL_Flip($pSurface) GUISetState() Do     Sleep(10) Until GUIGetMsg() = -3 _SDL_Quit() GUIDelete($hWnd) Local $GX = 640, $GY = 480 EnvSet("SDL_WINDOWID", "") EnvSet("SDL_VIDEO_WINDOW_POS", @DesktopWidth -$GX & ", " & @DesktopHeight -$GY) _SDL_Init($_SDL_INIT_VIDEO) $pSurface = _SDL_GuiCreate(@ScriptName, $GX, $GY, 32, $_SDL_SWSURFACE) _SDL_FillRect($pSurface, 0, 0x0000FF) _SDL_Flip($pSurface) While 1     Sleep(10) WEnd

Please note that that script doesn't seem to close itself properly sometimes (not sure why) so you may want to check your task manager after running it.

Edited by AdmiralAlkex, 08 May 2010 - 10:36 AM.


#69 WeMartiansAreFriendly

WeMartiansAreFriendly

    Where's the kaboom?

  • Active Members
  • PipPipPipPipPipPip
  • 1,245 posts

Posted 08 May 2010 - 05:14 PM

AdmiralAlkex, Neither links are working for me.
Posted ImageDon't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()

#70 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,697 posts

Posted 08 May 2010 - 08:53 PM

AdmiralAlkex, Neither links are working for me.

The one on post #44 works for me. Maybe it was just temporarily "confused", please try to click it again.

#71 yehia

yehia

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 275 posts

Posted 18 May 2010 - 07:03 PM

is there anyway to flip an image?
like flipping it horizontally ...
it would save some time and effort
thanks

#72 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,697 posts

Posted 20 May 2010 - 06:24 PM

@yehia

Sorry buddy, missed you there a couple of days.

SDL_gfx can flip a surface, see description on the official website (do a search in page for "Rotozoomer").

Edited by AdmiralAlkex, 20 May 2010 - 06:24 PM.


#73 yehia

yehia

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 275 posts

Posted 21 May 2010 - 04:29 AM

yes thanks a lot
the function is _SDL_rotozoomSurfaceXY if anyone searched for this later

#74 yehia

yehia

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 275 posts

Posted 21 May 2010 - 09:08 PM

any chance for the support of animated gifs?

#75 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,697 posts

Posted 22 May 2010 - 12:05 AM

Well no, not from me anyway. I wouldn't even know where to begin.
How would you expect that to work anyway? Every frame gets loaded to separate surfaces? Wouldn't it be just as easy (and use less disk-space) to use multiple .png files?

#76 yehia

yehia

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 275 posts

Posted 22 May 2010 - 01:04 PM

i found a dll somewhere yesterday for that but still the idea itself seemed stupid where the gif is going in a direction and the whole script using another timing
i dont know but it seemed illogical
thanks for the help again

#77 Pottery

Pottery

    Adventurer

  • Active Members
  • PipPip
  • 139 posts

Posted 24 July 2010 - 06:42 AM

Can someone update the link lol

#78 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,697 posts

Posted 26 July 2010 - 04:24 AM

Did you try the link at post 44 as told? It works for me.

http://hem.passagen.se/amax/autoit/SDL%20v14½.zip

#79 Delta

Delta

    Oh Dear...

  • Active Members
  • PipPipPipPipPipPip
  • 612 posts

Posted 19 October 2010 - 04:26 AM

I'm getting an error from both links.

The second one from post 44 is giving me this.

Du har försökt att ladda en sida på Passagens medlemsserver som inte finns. Det kan bero på :

* Den angivna adressen är felaktig. Kontrollera stavningen och försök igen.
* Medlemmen uppdaterar sidan. Försök igen senare.

Du kommer att dirigeras om till Passagens f�rstasida om n�gra sekunder

Till Passagen


Please stop confusing "how to" with "how do"

#80 AdmiralClaws

AdmiralClaws

    Where is the fish?

  • Active Members
  • PipPipPipPipPipPip
  • 4,697 posts

Posted 22 October 2010 - 04:41 PM

Ignore the popup, the linked page should start the download. You could try downloading with another browser.

Some extra mirrors:
Some Swedish file upload site
My desktop (online at random times)

I have intentions to create a more "permanent" solution, but that will not happen right now.

It's pizza time! ;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users