Leaderboard
Popular Content
Showing content with the highest reputation on 05/21/2013 in all areas
-
You can find a lot of libraries (DLLs) to create OpenGL windows and contexts, to load images and data into textures, to load 3D models, and to call functions that are not in opengl32.dll. Are all these external libraries necessary? The zip files below contains UDFs to create contexts, load images and models, and call functions without any external libraries. They also contains a number of examples. Well, it's not quite true that I do not use any DLLs at all. In some examples I'm using The Embedded Flat Assembler (FASM) UDF by Ward (includes fasm.dll) to optimize loops. This is the ExLauncher, that can be used to run the examples: Press Play to run the first example, and Next to run the following examples. In the Samples menu you can select OpenGL 1.1, 2.1, and 3.3 examples. With Samples | Models you can open the 3D model Viewers, and run 3D model examples. With Samples | Templates you can see a number of templates, as you can use as a start for your own examples. The documentation is divided into five chapters: Chapter 1 is mostly about OpenGL 1.x. Topics like calling functions, creating a rendering context, and loading images into textures are also covered.Chapter 2 deals with OpenGL 2.x and the new concepts that appeared in these versions. Most important is the concept of shaders.Chapter 3 is mostly about OpenGL 3.x. There is also a section on OpenGL/GLSL versions and a section on error handling.Chapter 4 is about implementing a model loader for Wavefront (OBJ) 3D models.Chapter 5 is a summary.In bottom of the post you can download zip files. Use ExLauncher.au3 in top folder to run examples. To view Wavefront (OBJ) 3D models see section 4.0. Chapter 1 is mostly about OpenGL 1.x. Topics like calling functions, creating a rendering context, and loading images into textures are also covered. 1.1 Calling functions Functions defined in OpenGL 1.2 and higher and functions defined in extensions are part of the software that belongs to the video card. To access these functions you normally use a function loading library e.g. GLEW. You can also access the functions manually: 1.2 Rendering contexts (Update 2013-09-21) With OpenGL 3.0 and higher there are more ways to create a rendering context. In the OpenGL wiki the terms simple and proper are used to describe two different types of contexts. Update: New MSAA context. 1.3 Textures and images (Update 2013-09-21) A texture is an OpenGL object that contains an image. Without an image loading library or at least an image loading function it can be tricky to load an image into a texture. These functions loads BMP, GIF, ICO, JPG, PNG, RGB, RGBA, TGA, TGA(RLE), TIF and WMF files. Update: Anisotropic filter (bottom of spoiler). 1.4 OpenGL 1.1 examples (Update 2013-08-03) SamplesOpenGL 1.1 contains the OpenGL 1.1 examples. Here is a list: 1.5 Run examples (Update 2013-08-03) You can run examples in the Samples folder by double clicking, or you can run them from Scite. The easiest is to use ExLauncher.au3 in the top folder: 1.6 Threads example Imagine that when you move the mouse across the screen, it'll create a track on the screen that follows your mouse. Then imagine that there isn't just one track, but many tracks that are slightly offset relative to each other. This is threads: Chapter 2 deals with OpenGL 2.x and the new concepts that appeared in these versions. Most important is the concept of shaders. 2.1 New concepts In the last versions of OpenGL 1.x and especially in version 2.0 and 2.1 a new set of concepts showed up. It was concepts such as shaders, attributes, uniforms and vertex buffer objects (VBOs): 2.2 Shaders Shaders were introduced in OpenGL 2.0. A shader is a program running on the GPU. You write a shader in the OpenGL Shading Language (GLSL). It's a C-like language: 2.3 Math functions When you use shaders in OpenGL 2.0 and higher you don't use old functions like glMultMatrix, glRotate, glTranslate, gluLookAt or gluPerspective. You have to use a new set of functions that works with the functionality of the shaders: 2.4 OpenGL 2.1 examples (Update 2013-06-16) SamplesOpenGL 2.1 contains the OpenGL 2.1 examples. All these examples are based on shaders and the new concepts in OpenGL 2.1. Here is a list: Chapter 3 is mostly about OpenGL 3.x. There is also a section on OpenGL/GLSL versions and a section on error handling. 3.1 OpenGL versions OpenGL versions and corresponding GLSL version: 3.2 Error handling OpenGL error handling is done with glGetError and glGet-functions. Initialize error handling before a group of commands and check errors after the last command. Here error handling is illustrated with LoadGLSLshader in oglIncludesoglLoadShaders.au3: 3.3 OpenGL 3.3 examples (Update 2013-06-16) SamplesOpenGL 3.3 contains the OpenGL 3.3 examples. Most of these examples are added in an update on 2013-06-16. Chapter 4 is about implementing a model loader for Wavefront (OBJ) 3D models 4.0 View 3D models (New 2014-05-04) Added a few pictures that shows how the model Viewers works. 4.1 3D models (New 2013-08-03) When you need a 3D model in your OpenGL project you probably just want to find the model on the internet and load it into your project with some kind of model loading function. 4.2 Wavefront (OBJ) loader (Update 2013-09-21) A Wavefront 3D model (Wavefront .obj file) consists usually of two files: An OBJ-file (Object files) which contains vertices, texture coordinates, normal vectors and face triangles to describe the geometry of the model. And a MTL-file (Material files) with material definitions to describe the look of the model. Material definitions are parameters for the OpenGL glMaterial command to describe the light reflectivities of the surface of the model, and definitions of texture maps to put on the surface of the model. 4.3 Wavefront (OBJ) viewer (Update 2013-09-21) SamplesModelsModel Viewer contains two viewers for Wavefront (OBJ) 3D models. Model Viewer (OBJ) 1.1.au3 is an OpenGL 1.1 version (2.0 or lower) and Model Viewer (OBJ) 2.1.au3 is a 2.1 version (2.1 or higher). Model Viewer (OBJ).au3 calls the proper script depending on your OpenGL version. The latter can be opened through the Tools menu in ExLauncher.au3. 4.4 Example models (Update 2013-09-21) The Models folder at the top level contains the example models. The SamplesModels folder at the top level contains the viewers and the au3-scripts to run the examples. Example models are split into two groups: Samples and models. Models are further divided into three groups: Small, medium and large models: 4.5 Large models (Update 2013-09-21) The optimizations provided in this update and the 2013-08-24 update has largely eliminated the problems of large models. 4.6 Using the models (Update 2013-09-21) SamplesModelsOpenGL 1.1 and SamplesModelsOpenGL 2.1 contains some small examples which shows how to use the models. 4.7 Software (Update 2013-08-24) Blender is a program to edit 3D models. AssimpView is a model viewer. Both of these programs are able to export a model as a Wavefront (OBJ) triangle mesh. 4.8 Next version (Update 2013-09-21) Some issues should be handled in the next version: 4.9 Summary (Update 2013-09-21) This is a summary of the main features and limitations for the Wavefront (OBJ) 3D model loader: Chapter 5 is a summary 5.1 Sources for the UDFs (New 2013-06-16) The zipfile contains a number of OpenGL UDFs in the oglIncludes folder. This is a description of the sources for these UDFs: 5.2 Updates (New 2014-05-04) The example was released 2013-05-19. This is a summary of the updates. Zip files and downloads Included UDFs FASM.au3 and MemoryDll.au3 by Ward to optimize loops. The UDFs are included in the code zip. Contents of the code zip The zipfiles contains a number of files and folders: ExLauncher.au3 - to start the examples, run this fileImages - images used in the examples (not since 2014-05-04)Models - Wavefront (OBJ) 3D example modelsIncludes - utility functions and UDFsoglIncludes - OpenGL related constants and functionsSamples - a collection of examples and templatesTools - a few OpenGL toolszLinks - links to dokuUpdate 2014-05-04 for AutoIt 3.3.10 (code): OpenGL2-3.3.10.7z Downloads at Dropbox The images and 3D models can be downloaded from OpenGL Images and Models at Dropbox. The folder contains three 7z-files: Images.7z, 3.5 MB - the images from the first release 2013-05-19. You need these images, but if you have already installed the images, you do not need to download this package.ModelSamples.7z, 1.66 MB - sample 3D models. If you want to test the Wavefront (OBJ) 3D models and the model loading functions, you need this package.Models.7z, 39.15 MB (250 MB uncompressed) - larger models. The pictures in post 13, 14 and 16 are created from models in this package.If you don't want to test any 3D models there is no need to download and install the last two packages.Click the Download button in upper right corner to download all three packages in one big zip. Testet on XP 32 bit with a NVIDIA video card supporting OpenGL 3.3 and Win 7 64 bit with an Intel card supporting OpenGL 3.1. Use ExLauncher.au3 in top folder to run examples. To view Wavefront (OBJ) 3D models see section 4.0. AutoIt 3.3.8 You can get the 2013-09-21 version for 3.3.8 here. You need the images and possibly the 3D models. x64 issues (no x64 issues in 3.3.10)1 point
-
BinaryToAu3Kompressor v1.0.5.4 It's now possible to see the best compression ratio using LZMA, LZNT and Base64 compressions with differents combinations. Nothing too complicate, you drag'n drop a file on the picture and script Test all compression types and return the ratios. ( Test duration depends of file size, slowest compression is LZNT, but all decompressions are fast ) Free to you after, to choose the compression(s) you want... Yes, LZMA needs a dll ( embedded & compressed in script ) but brings a powerfull compression. It opens scite with your file compressed to an au3 script with or without decompression function as you want. Hold Left Shift key when clicking button for just copy script to clipboard. Use the 3 compressions at a time works but doesn't give a good ratio, that's why i don't display it. Usefull for little files you want include in your scripts ! No externals files needed, they are already in script. Previous downloads : 1103 Source and Executable BinaryToAu3Kompressor will be added to the next version of >SciTEHopper Thanks to Ward for his >Base64.au3 and LZMA.au3, and trancexx for his >LZNT functions and his >Base64Decode function.1 point
-
just noticed your first post...let me get a function in here that outputs all the controls on the window...then paste the output back to us...requires the winapi download from example scripts on forum...I've noticed, sometimes, if there is something like a grouping, and that grouping is at a higher zvalue than the controls within it, the info tool is not able to grab/focus on those other controls...this will return ALL controls on the window #include <Array.au3> #include <WinAPI.au3> $hWin = WinGetHandle("yourtitle") Var_GetAllWindowsControls($hWin) Func Var_GetAllWindowsControls($hCallersWindow) ;~ $giSubFunctionCounter += 1 ; Get all list of controls $sClassList = WinGetClassList($hCallersWindow) ; Create array $aClassList = StringSplit($sClassList, @CRLF, 2) ; Sort array _ArraySort($aClassList) _ArrayDelete($aClassList, 0) ; Loop $iCurrentClass = "" $iCurrentCount = 1 $iTotalCounter = 1 For $i = 0 To UBound($aClassList) - 1 If $aClassList[$i] = $iCurrentClass Then $iCurrentCount += 1 Else $iCurrentClass = $aClassList[$i] $iCurrentCount = 1 EndIf $hControl = ControlGetHandle($hCallersWindow, "", "[CLASSNN:" & $iCurrentClass & $iCurrentCount & "]") $text = StringRegExpReplace(ControlGetText($hCallersWindow, "", $hControl),"[\n\r]","{@CRLF}") $aPos = ControlGetPos($hCallersWindow, "", $hControl) $sControlID = _WinAPI_GetDlgCtrlID($hControl) If IsArray($aPos) Then ;~ If $gbPerformLog Then Var_SetLogAndActOnState ( 1, $gbLogLevel_Rtrn, "Var_GetAllWindowsControls()", "Func=[Var_GetAllWindowsControls]: ControlCounter=[" & $iTotalCounter & "] ControlID=[" & $sControlID & "] Handle=[" & $hControl & "] ClassNN=[" & $iCurrentClass & $iCurrentCount & "] XPos=[" & $aPos[0] & "] YPos=[" & $aPos[1] & "] Width=[" & $aPos[2] & "] Height=[" & $aPos[3] & "] Text=[" & $text & "].", False, False) ConsoleWrite("Func=[Var_GetAllWindowsControls]: ControlCounter=[" & $iTotalCounter & "] ControlID=[" & $sControlID & "] Handle=[" & $hControl & "] ClassNN=[" & $iCurrentClass & $iCurrentCount & "] XPos=[" & $aPos[0] & "] YPos=[" & $aPos[1] & "] Width=[" & $aPos[2] & "] Height=[" & $aPos[3] & "] Text=[" & $text & "]." & @crlf) Else ;~ If $gbPerformLog Then Var_SetLogAndActOnState ( 1, $gbLogLevel_Rtrn, "Var_GetAllWindowsControls()", "Func=[Var_GetAllWindowsControls]: ControlCounter=[" & $iTotalCounter & "] ControlID=[" & $sControlID & "] Handle=[" & $hControl & "] ClassNN=[" & $iCurrentClass & $iCurrentCount & "] XPos=[winclosed] YPos=[winclosed] Width=[winclosed] Height=[winclosed] Text=[" & $text & "].", False, False) EndIf If Not WinExists($hCallersWindow) Then ExitLoop $iTotalCounter+=1 Next ;~ $giSubFunctionCounter -= 1 EndFunc1 point
-
Keniger, Happens to us all from time to time - glad I could help. M231 point
-
1 point
-
Perhaps something like this will get you what you're looking for. #include <array.au3> Global $String = 'Calling command line: "C:\ACRA\kProgram\Db2PCM -v1 -n1 -f0 -dC:\ACRA\Database -mC:\ACRA\kProgram\Scribe -oC:\ACRA\kProgram\Xid\BCU101C_DSI002.xid' & @CRLF $String &= 'Process started successfully' & @CRLF $String &= @crlf & 'Db2PCM.exe :' & @CRLF $String &= 'Version 1.0.0.1349 (Release ) for Win32 Built on builder2 using cg2k7' & @CRLF $String &= 'Looking for scribe module entries and recording them...' & @CRLF $String &= 'Done.' & @CRLF $String &= 'Found and recorded 373 module entries' & @CRLF & @CRLF $String &= 'C:\ACRA\kProgram\Db2PCM.exe : 0 hint(s), 10 warning(s) and 0 error(s).'& @CRLF $array = StringRegExp($String, "C:\\ACRA\\kProgram\\Db2PCM.exe : \d+ hint\(s\), \d+ warning\(s\) and .+\d+ error\(s\)", 2) _ArrayDisplay($array) I'm sure one of the RegEx gurus will be able to make that more universal, but it is a starting point. You might notice you can change the number in the string (hints, warnings, errors) and it should still pick it up.1 point
-
Are you able to get the text from the control? If you can, then all you have to do is figure out what part of the text you need, what part you don't, and figure out what would make them different. You'd probably need a RegEx to find what you're looking for, or even something as simple as a stringinstr or _stringbetween. Because I don't know what it is you're trying to accomplish, what it looks like when you get the text, or what you want to get from that text, there's not much I can offer besides telling you to show us an example of the text in the control, and what you're looking for out of it.1 point
-
incepator, Some people are never satisfied! This will work: #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx_Mod.au3" #include <Array.au3> Global $aLV_List_Left, $aRet, $iEditMode = 0, $sNewName $Form1 = GUICreate("Form1", 354, 188, 437, 213) $ListView1 = GUICtrlCreateListView("nr|name", 0, 5, 346, 150) _GUICtrlListView_SetColumnWidth($ListView1, 0, 50) _GUICtrlListView_SetColumnWidth($ListView1, 1, 50) GUICtrlCreateListViewItem("1|myke", $ListView1) GUICtrlCreateListViewItem("2|albert", $ListView1) _GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) $Button1 = GUICtrlCreateButton("Save New Text", 8, 160, 90, 25) $iLV_Left_Index = _GUIListViewEx_Init($ListView1, $aLV_List_Left, 0, 0, True, 1 + 2 + 8, "1") GUISetState(@SW_SHOW) _GUIListViewEx_MsgRegister() _GUIListViewEx_SetActive(1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $sNewName Then ; If something was changed we can now read it $open = FileOpen("file.txt", 1) $write_line = FileWriteLine($open, $sNewName) FileClose($open) MsgBox(64, "Info", "New text: " & $sNewName & " succes saved !") $sNewName = "" EndIf EndSwitch $aRet = _GUIListViewEx_EditOnClick($iEditMode) ; An array is returned when you edit If IsArray($aRet) Then $sNewName = $aRet[1] ; Here we save the new value EndIf WEnd With this Beta version: See new version below Happy now? M231 point
-
After further deliberation, I find I should probably elaborate on my previous LOVE post. Is AutoIt perfect? In a technical sense, NO. In an objective sense, YES .... but with qualifiers. By objective, we are talking RELATIONSHIP. Just like any relationship, the partnership you have with AutoIt, is critical. Early on, your relationship can turn to love, and indeed for many, including myself, this happened with AutoIt. Many then later fall out of love with AutoIt, but not so myself and many others. As with any relationship that turns to love, there is a certain blindness in the early stages. That blindness can lead you to believe, that there is only PROS and no CONS. Obviously you eventually drift away from that stance with growth and gradually awakening of understanding. So, just like any worthwhile relationship over time, where you accept faults, and perhaps feel more endeared because of them, you can develop a different sense of perfection, that is not based on the object being perfect, but rather the overall potential you aspire to or have gained. In that regard, AutoIt is perfect to me ... and many others. Can that perfection be improved? Objectively, YES. Technically, NO. The brilliance about AutoIt though, is that you can achieve a relative sense of it being perfect, which is unlike many other languages out there ... most I deem.1 point
-
1 point
-
Regular expression way ;Working - Pattern ;Input : anything "." $s_sub (either "." or a digit) twodigits "." $s_ext ;Output : anything "." (first alphabet of $s_ext) twodigits $String = "test.dummy.part.03.rar" MsgBox( 64, "Return:", GetFileName_RegEx($String)) $String = "test.dummy.part001.rar" MsgBox( 64, "Return:", GetFileName_RegEx($String)) Func GetFileName_RegEx( $s_filename, $s_ext = "rar", $s_sub = "part" ) ;the file is not of the specified extension. If StringRight($s_filename, StringLen($s_ext)) <> $s_ext Then Return SetError(1, 0, 0) ;the following would be used in pattern so make sure there don't have any metachars. Escape_SpecialChars($s_ext) Escape_SpecialChars($s_sub) ConsoleWrite('$s_filename = ' & $s_filename & @crlf) ;### Debug Console ConsoleWrite('$s_ext = ' & $s_ext & @crlf) ;### Debug Console ConsoleWrite('$s_sub = ' & $s_sub & @crlf) ;### Debug Console Return StringRegExpReplace( $s_filename, "([^.]*)\." & $s_sub & "(?:\.|\d)(\d{2})(\." & $s_ext & ")$", "\1." & StringLeft($s_ext, 1) & "\2" ) EndFunc Func Escape_SpecialChars( ByRef $SRE ) $SRE = StringRegExpReplace($SRE, "[\\\-^]", "\\$0") ;the chars a set treats as special - escape them. $SRE = StringRegExpReplace($SRE, "[^\w\s]", "[$0]") ;insert any non-word/space in sets EndFunc Regards1 point
-
Hi, do you want it to start with .rar, or should the first one be the .r1? xxx.rar xxx.r1 xxx.r2 xxx.r3 Also, keep in mind that, the parameters are set to a specific filename, i mean, you mentioned before the filename "test.dummy.part.01.rar" now you're talking about "test.dummie.part001.rar" These are different, mainly because the second one has more dots. Now to make it work like you want for that specific filetype, try this: Func _rar01() Local $files, $filename, $x $files = _FileListToArray($Directory, "*.rar", 1) For $x = 1 To UBound($files) ;- 1 $Count = StringInStr ($files[$x], ".", 2, -2) $filename = StringTrimRight ($files[$x], $Count) If $x < 10 Then FileMove($Directory & "\" & $files[$x], $Directory & "\" & $filename & ".r0" & $x) Else FileMove($Directory & "\" & $files[$x], $Directory & "\" & $filename & ".r" & $x) EndIf Next EndFunc _ "1 point