User Tag List

Page 1 of 11 1 2 3 ... LastLast
Results 1 to 10 of 107

Thread: OpenGL Base object ( public beta )

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Nov 2009
    Location
    This side of the equator
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    OpenGL Base object ( public beta )

    Here we go again.

    OpenGL Base object ( public beta 01 )

    This is the first in what I hope to be a collection of extensions intended to replace the old OpenGL object that was made by Looki and me.

    This approach of dividing the extension into several smaller objects has many benefits, each object can be kept small in size and dedicated to a specific task, this means the objects will be a lot easier to maintain among other things. The purpose of the Base object is to display a window in the frame that other extensions can draw to using OpenGL commands.

    This object by itself cannot do anything besides creating an OpenGL compatible window in the frame. At the moment you can use the XLua extension or the .net Script extension to draw to the OpenGL Base object. Examples are included that show how to draw using the XLua extension.

    I'll try to answer questions as best as I can.

    Oh, and all you OpenGL/Lua/.net beasts, if you make any examples of your own, please post them, the more the better.

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: OpenGL Base object ( public beta )

    This is EXACTLY what I wanted, including actions and edit time properties. Awesome. Very well done.
    I'm going to play around with this, I'm really happy with your progress.

    Are you going to add multisampling support?

    EDIT: When I disable the double buffer, the OpenGL context apparently is not created, and the window is filled with the button face color.

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Nov 2009
    Location
    This side of the equator
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Base object ( public beta )

    Thank you. Let me know if there is anything missing in the Base object that is needed for things like shaders, you probably have a lot more knowledge about that stuff then I have.

    About the double buffer problem, that's strange, if there was no context created then the window creation process should be cancelled and the window destroyed before it is even displayed. :S
    The code looks like this:
    Code:
    // Create a rendering context
    rdPtr->hRC = wglCreateContext( rdPtr->hDC );
    if ( rdPtr->hRC == NULL ) { // Failed to create a rendering context?
    
    	ReleaseDC( rdPtr->hWnd, rdPtr->hDC );
    	rdPtr->hDC = NULL;
    	DestroyWindow( rdPtr->hWnd );
    	rdPtr->hWnd = NULL;
    
    	rdPtr->errorNo = 5;
    	rdPtr->rRd->GenerateEvent(4); // Trigger 'On create window failure'
    	return;
    }

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: OpenGL Base object ( public beta )

    Yeah, that bug is strange indeed... :S
    Shaders are stored in a similar way to textures, but you can store each shader independently in the memory. If you want to store shaders in a global array, you need a GLuint* in your rundata.
    In your CreateRunObject code, allocate an array,
    rdPtr->glsl = new GLuint[MAX_SHADERS];
    That's it. The rest is done via GL operations, which of course need to access the array. You don't need to do this, as I mentioned above, it just is more consistent when using in MMF.
    In XLua, however, you could just do this:
    shader = gl.CreateProgram()

  5. #5
    Clicker Multimedia Fusion 2
    Retriever2's Avatar
    Join Date
    Jun 2006
    Location
    United States
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Base object ( public beta )

    There's an important bugfix in LuaGL that's necessary to successfully draw with this extension.

    http://hocuspocus.taloncrossing.com/rii/xluagl.zip

    Also, you're not swapping the buffers in your examples

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Nov 2009
    Location
    This side of the equator
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Base object ( public beta )

    @Retriever: They have 'Auto swap buffers' enabled through actions. This is a small change from the private beta you have, if you haven't replaced the object then those actions might not appear. Sorry I didn't mention this, I've been so focused on making sure it was ok to release in public.

    @Looki: Ah, in that case dedicated shader extensions should be able to handle everything, no need to add anything extra to the initialization of the Base object?

    Regarding the buffer problem, I noticed that on my computer when I select 'Double buffer: Disabled' I get a single buffered pixel format ( there is always the chance there is no appropriate single buffered pixel format available ), but, I'm still required to call Swap buffers to have anything drawn. :S Is this the same problem you are experiencing?

    To know if the selected pixel format is double buffered or not, use the 'Is double buffered' condition after the window is created.

  7. #7
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: OpenGL Base object ( public beta )

    Yes, no initialization in the base.
    I don't think it's the same problem, not even the examples work.
    I just noticed something: when closing the application, I actually see the render for a single frame...

  8. #8
    No Products Registered

    Join Date
    Aug 2006
    Location
    Stockholm, Sweden
    Posts
    479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Base object ( public beta )

    So, is each model or world added by a separate instance of another extension?

  9. #9
    Clicker Multimedia Fusion 2

    Join Date
    Nov 2009
    Location
    This side of the equator
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL Base object ( public beta )

    @Looki: I think I found the solution , try adding gl.Flush() to the end of the script. The GL commands just sits in the command buffer, never knowing when to actually execute. If gl.Flush() doesn't solve it then you can also try gl.Finish(). I'm going to update the examples.

    @Bornemix: Pretty much yes, there could be extensions for working with camera views, for displaying models and for special effects and likely other things as well.

  10. #10
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: OpenGL Base object ( public beta )

    Thanks, that worked.
    By the way, not the end of the script but the end of the function!

Page 1 of 11 1 2 3 ... LastLast

Similar Threads

  1. Stretching OpenGL Base?
    By brawltaunts22 in forum Hardware Accelerated Runtime
    Replies: 8
    Last Post: 7th September 2011, 03:20 PM
  2. Minimap Object - Public Beta
    By DanielRehn in forum Extension Development
    Replies: 54
    Last Post: 3rd January 2009, 02:04 PM
  3. OpenGL object (new public beta)
    By Zyx in forum Extension Development
    Replies: 43
    Last Post: 15th December 2008, 05:21 PM
  4. New extension: OpenGL object (public beta 1)
    By Zyx in forum Extension Development
    Replies: 99
    Last Post: 11th December 2008, 11:00 PM
  5. Minimap Object - Public Beta 3
    By DanielRehn in forum Extension Development
    Replies: 26
    Last Post: 9th February 2008, 01:29 AM

Posting Permissions

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