Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: Vector Graphics

  1. #11

    Re: Vector Graphics

    WOW, it looks just what I was dreaming about.

    Ok Pipes, now you are officially our gui developer. Joke aside, I hope you will bring this baby to TBGL, because that is something we are missing. A nice gui lib. Great job. Can you post the skin file so I can see how this was organized?

  2. #12
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Vector Graphics

    Whoa!

    That looks pretty good Pipes!
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #13

    Re: Vector Graphics

    Hey,

    Thanks guys. Here are the skins that I constructed the windows, borders, headers with. 1st two are header files with a color key to tell the program what colors to use on the windows. The next two are custom border files. The final two are the bmpFonts for the controls. The user can designate custom headers, borders or bmpFonts or use default settings for plain windows, controls and tt fonts. The rest is just vector or primitive graphics drawn with different functions. I will give it the ole college try to transfer to TBGL. I'm sure I'll have questions for this endeavor. TBGL is a lot different than Blitz. (It is about the passion )

    [img][/img]
    Attached Images Attached Images
    Contempt Prior to Investigation = Everlasting Ignorance

  4. #14

    Re: Vector Graphics

    Hey,

    After some research this afternoon, I see there will be more than a few problems with this whole endeavor to port the GUI from Blitz to TBGL. There just doesn't seem to be any 2D handling capabilities in OpenGL, TBGL (Other than sprites and textures) or thinBasic. At the minimum the following functions would be required:

    handle = LoadImage(Filename) ---Load png,jpg,bmp etc.
    handle = CopyImage(handle) ---Copy one image to another
    handle = CreateImage(width,height,frames) ---Create images on the fly
    handle = LoadAnimImage(filename,width,height,first,count) ---Load and animation image sequence
    handle = GrabImage(image,x,y,frame) --- Grab an image or a portion of an image
    DrawImage(handle, x,y,frame) --- Darw an image to the current image buffer (Screen or back buffer)
    DrawImageRect(handle,x,y,rect_x,rect_y,rect_width,rect_height,frame) ---Draw a portion of an image to another image
    FreeImage(handle) ---Free an image from memory
    TileImage(handle,x,y,frames) ---Tile an image to another
    MaskImage(handle,red,green,blue) ---Set image transparency
    ResizeImage(handle,width#,height#) ---Resize image
    ScaleImage(handle,xscale#,yscale#) ---Scale by percentage
    RotateImage(handle,value#) ---Rotate image
    int = ImageWidth(handle) ---Get image width
    int = ImageHeight(handle) ---Get image height
    SetBuffer buffer ---Set current drawing buffer
    LockBuffer buffer ---Lock current buffer for fast drawing
    UnlockBuffer buffer ---Unlock current buffer for normal drawing operations
    buffer = ImageBuffer(handle,frame) ---Get an image buffer
    buffer = FrontBuffer() ---Get the front buffer
    buffer = BackBuffer() ---Get the backbuffer
    PutPixel(buffer)
    GetPixel(buffer)
    GetPixelColor(buffer, x, y)
    blit(src_x,src_y,src_width,src_height,dest_x,dest_y,src_buffer,dest_buffer)
    CopyRect(src_x,src_y,src_width,src_height,dest_x,dest_y,src_buffer,dest_buffer)
    SetColor(red,green,blue)
    ClsColor(red,green,blue)
    Line x1,y1,x2,y2
    Rect x, y, width, height, solid = (True/False)
    Oval x,y,width,height,solid = (True/False)
    Circle x,y,width,height,solid = (True/False)

    These are all extensive 2D image routines. Does thinBasic or TBGL have any of these capabilities?

    Hey Michael, do you recognize some of these functions from Blitz3D. (See why I like it) DirectX7 was the bomb for handling 2D and plastering images all over 3D graphics scenes and Blitz wrapped all that up in a nice layer that hid the mess from the average user.

    May all your thinBasic endeavors be successful,

    Pipes

    Contempt Prior to Investigation = Everlasting Ignorance

  5. #15

    Re: Vector Graphics


    Hi Pipes,

    I'll leave it to the experts but it seems to me that these classic basic functions could all be emulated with TBGL/Opengl. The pixel operations, for instance closely relate to texture mapping onto a flat surface and if necessary, Opengl will also allow you to handle individual pixels in the projected image.

    Charles.

  6. #16

    Re: Vector Graphics

    Hi pipes
    Yes i know them. And will try to replicate them if you like.

    Michael


  7. #17
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Vector Graphics

    Hi Pipes,

    as guys said - there are equivalents of those functions in TB. They do not have same names, but they are here.
    The command you listed (considering I do not know Blitz) show approach similar to one used in GDI.
    As Charles said, OpenGL rather than manipulating images renders polygons with images mapped. This way is much more efficient for hardware and is adopted by most game developers*.

    One thing you should know - TBGL supports BMP and TGA file formats at the moment. PNG, JPG will follow once ThinBASIC 2.x is out.

    The reason is that OpenGL does not provide any image handling routines, it only accepts raw buffers of RGB(A) components. So adding support for JPG and PNG would mean bloating the TBGL with loading code for these formats.
    Once ThinBASIC 2.x (WinXP+) is out, I can rely on fact GDIPlus library is always present, so I can take advantage of its image format magic.


    Petr

    * Yes, there are functions like glDrawPixels in OpenGL, but I never used them as they seem little inefficient to me.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  8. #18

    Re: Vector Graphics

    Quote Originally Posted by Michael Hartlef
    Hi pipes
    Yes i know them. And will try to replicate them if you like.

    Michael

    Ok, then it is maybe better to wait till then.

  9. #19
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732

    Re: Vector Graphics

    Pipes,

    could you tell us how is your GUI library designed from function calls point of view (not implementation, just the function names and parameters)?

    Thanks
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  10. #20

    Re: Vector Graphics

    Hi Charles,

    I'll leave it to the experts but it seems to me that these classic basic functions could all be emulated with TBGL/Opengl.
    I'm sure you are right. There's always more than one way to climb a mountain. It will require more investigation on my part. I have to rely on the experts to point me in the right direction. I'm certainly not one myself. I've always been a BASIC programmer from the old school. The more layers I have between me and some of these complex libraries, the better I like it. (DirectX, OpenGL, Windows API)

    Hi Michael,

    Yes i know them. And will try to replicate them if you like. Ok, then it is maybe better to wait till then.
    Yes, I would like it, but it would probably be a lot of work. Seems that a module for handling 2D graphics would be beneficial. I just don't know how to go about it myself.


    Hi Petr,

    The command you listed (considering I do not know Blitz) show approach similar to one used in GDI.
    Yes, I believe I mentioned GDI in one of the above post. Although, I don't like GDI much. It has some similar functions. That seems like going backwards to me for some reason.

    OpenGL rather than manipulating images renders polygons with images mapped. This way is much more efficient for hardware and is adopted by most game developers*.
    I'm sure you are right. You are the OpenGL pro in my opinion. I understand the concept but how to apply it will require more effort on my part. I have worked with DirectX before and way back in DX7 the capabilities were there for great 2D handling. Microsoft changed it in DX8 similar to OpenGL. Whether or not it bloated the library is a matter of debate. The industry direction went towards 3D so it only makes sense the libraries would change. That may be the other way around. The libraries went towards 3D so the industry followed. (Who knows?) However, I liked the 2D capabilities (or at least the way it was handled) and I still do. It probably is more efficient for hardware and you are correct. Most professional game programmers have gone the way the 3rd dimension. I'm an old school amateur and perhaps a little strange. I seem to think programming is interesting, fun and my favorite pass time. (It's the passion as I've heard many times around thinBasic )

    The reason is that OpenGL does not provide any image handling routines, it only accepts raw buffers of RGB(A) components.
    Okay... I admit I don't know what that means, The rgb and alpha component rings a bell but the raw buffer thing draws a blank in my mind. (Hardware memory?)

    Oh well... I will endeavor to persevere and may all your programming endeavors be successful.

    Pipes
    Contempt Prior to Investigation = Everlasting Ignorance

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Example: passing vector or array to same function
    By e90712 in forum Math scripts
    Replies: 2
    Last Post: 19-07-2008, 00:33

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •