Jump to content

eynstyne

Active Members
  • Posts

    235
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

eynstyne's Achievements

Polymath

Polymath (5/7)

1

Reputation

  1. FileSetTime("Your file","YYYYMMDDHHMMSS",flagtimestamp,recurse) Where Y is year, M is month, D is day, H is .. well you get the idea flagtimestamp 0 = Modified 1 = Created 2 = Accessed recurse (do it to a bunch of files in a directory if set to 1)
  2. It's WinSetOnTop("window","Text",flag) flag = 1 - Topmost 0 - Not topmost
  3. Don't add another while loop! Just take my code and put it in yours 1 line after the while 1 statement
  4. in order for it to work, you must have a variable for GuiCreate $window = Guicreate()
  5. forget my last suggestion
  6. forget that last suggestion. That was winging it and it won't work. This might While 1 $cursorinfo = GuigetCursorInfo($Window) if $cursorinfo[4] = $input then if $cursorinfo[2] = 1 then guictrlsetdata($input,"") endif endif Wend
  7. add an elseif $msg = $input then Guictrlsetdata($input,"") within the if and endif statements
  8. maybe I should just simplify this. Can 3D or OpenGL work with autoit at all?
  9. The Example OpenGL script in Dev C++ will work. I translated the C script as best as I can to autoit, but the basic shapes and vertices colors do not appear! I'm looking at my script and logically it should work. What proves that 3D is somewhat possible is that when you comment out glClear, You will get video buffers inside that window. Why doesn't 3D work in autoit? Anyway enough talk here is the code: CODE #include <guiconstants.au3> ;================================ ; 3d UDF (uses opengl and glu32.dll) ; Glu32.dll and other parts omitted for length ; Author :eynstyne ;================================ Const $PFD_TYPE_RGBA = 0 Const $GL_COLOR_BUFFER_BIT = 0x00004000 Const $GL_TRIANGLES = 0x0004 Const $PFD_MAIN_PLANE = 0 Const $PFD_DOUBLEBUFFER = 1 Const $PFD_DRAW_TO_WINDOW = 4 Const $PFD_SUPPORT_OPENGL = 32 Local $dc, $hdc $gui = GuiCreate("OpenGL",256,256,-1,-1) GuiSetBkColor(0x000000) GuiSetstate(@SW_SHOW) EnableOpenGL($gui,$dc,$hc) glFlush() $i = 0 While 1 $i = $i + 1 glClearColor(0,0,0,0) glClear($GL_COLOR_BUFFFER_BIT) glPushMatrix() glRotatei($i,0,0,1) glBegin($GL_TRIANGLES) glColor3i(1.0,0.0,0.0) glVertex2i(0,1) glColor3i(0.0,1.0,0.0) glVertex2i(.87,-.5) glColor3i(0.0,0.0,1.0) glVertex2i(-.87,-.5) glend() glPopMatrix() swapbuffers($dc) $msg = Guigetmsg() Switch $msg Case $GUI_EVENT_CLOSE DisableOpenGL($gui,$dc,$hc) Exit Wend ;===THE OPEN GL FUNCTIONS=== func EnableOpenGL($hwnd,Byref $varhdc,ByRef $varhrc) ;PFD is PIXELFORMATDESCRIPTOR TYPE in WINAPI $PFD=Dllstructcreate("short;short;int;byte;byte;byte;byte;byte;byte;byte;byte;byte;byte;byte;byte;byte;byte;byte;byte ;byte;byte;byte;int;int") $DC = Dllcall("user32.dll","int","GetDC","hwnd",$hwnd) Dllstructsetdata($PFD,1,Dllstructgetsize($PFD)) Dllstructsetdata($PFD,2,1) Dllstructsetdata($PFD,3,$PFD_DRAW_TO_WINDOW+$PFD_SUPPORT_OPENGL+$PFD_DOUBLEBUFFER) Dllstructsetdata($PFD,4,$PFD_TYPE_RGBA) Dllstructsetdata($PFD,5,24) Dllstructsetdata($PFD,19,16) Dllstructsetdata($PFD,22,$PFD_MAIN_PLANE) $format = Dllcall("gdi32.dll","int","ChoosePixelFormat","int",$DC[0],"ptr",Dllstructgetptr($PFD)) $setformat = Dllcall("gdi32.dll","int","SetPixelFormat","int",$DC[0],"int",$format[0],"ptr",Dllstructgetptr($PFD)) $HRC = Dllcall("opengl32.dll","int","wglCreateContext","int",$DC[0]) $ret = Dllcall("opengl32.dll","int","wglMakeCurrent","int",$DC[0],"int",$HRC[0]) $varhdc = $dc[0] $varhrc = $hrc[0] return $ret[0] Endfunc Func DisableOpenGL($HDC,$HRC,$Hwnd) Dllcall("opengl32.dll","int","wglMakeCurrent","int",0,"int",0) Dllcall("opengl32.dll","int","wglDeleteContext","int",$hrc) Dllcall("user32.dll","int","ReleaseDC","hwnd",$hwnd,"int",$HRC) Return endfunc Func glClearColor($r,$g,$b,$a) Dllcall("opengl32.dll","none","glClearColor","int",$r,"int",$g,"int",$b,"int",$a) endfunc Func glClear($mask) Dllcall("opengl32.dll","none","glClear","int",$mask) endfunc Func glPushMatrix() Dllcall("opengl32.dll","none","glPushMatrix") endfunc Func glPopMatrix() Dllcall("opengl32.dll","none","glPopMatrix") endfunc Func glRotatei($angle,$x,$y,$z) Dllcall("opengl32.dll","none","glRotatei","int",$angle,"int",$x,"int",$y,"int",$z) endfunc Func glBegin($mode) Dllcall("opengl32.dll","none","glBegin","int",$mode) endfunc Func glColor3i($r,$g,$ Dllcall("opengl32.dll","none","glColor3i","int",$r,"int",$g,"int",$ endfunc Func glVertex2i($x,$y) Dllcall("opengl32.dll","none","glVertex2i","int",$x,"int",$y) endfunc Func glEnd() Dllcall("opengl32.dll","none","glEnd") endfunc Func glFlush() Dllcall("opengl32.dll","none","glFlush") endfunc Func SwapBuffers($HDC) $ret = Dllcall("gdi32.dll","int","SwapBuffers","int",$HDC) Return $ret[0] endfunc
  10. == is to check whether something is true in C++, autoit doesn't really need this. A regular = will check and assign values = is to assign values to a variable
  11. Sometimes autoit will remember the last line executed in your program. Just run some other script and then run your script. It should refresh the code
  12. I've noticed this problem. I've used a system with a 3d card and cannot render a simple circle properly. It isn't nice and smooth, but blocky. This is because your video card handles vectored drawing. If you switch to software accelerator, then the edges might be smooth. This is just my opinion
  13. like in allegro c++, you must create a buffer first. In other words, a blank bitmap of full screen size. After that, you must create the desired picture bitmap onto the buffer. In a while loop, you clear the buffer and the screen does not flicker. In C++ it would kind of look like : BITMAP *buffer, *pic; buffer = create_bitmap(SCREEN_H, SCREEN_W); pic = load_bitmap("thing.bmp",NULL); blit(buffer, pic, 0,0,0,0,pic->w,pic->h); blit(screen, buffer,0,0,0,0,SCREEN_W,SCREEN_H); hope this sort of helps...If you've used allegro for c++, then you'll know what i'm talking about.
  14. Instead of creating a paint control, use guictrlcreategraphic. It can draw basic shapes and stuff. Use guictrlsetgraphic to draw different types of shapes.
  15. This UDF should help you... Mixer UDF by wiredbits
×
×
  • Create New...