User Tag List

Page 5 of 23 FirstFirst ... 3 4 5 6 7 15 ... LastLast
Results 41 to 50 of 227

Thread: OpenGL collection

  1. #41
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: OpenGL collection

    SEELE, I think you mean glu, not glut. glut is a library to create cross-platform opengl applications with a simple GUI easily.

  2. #42
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL collection

    I did mean GLU, i always confuse the two :P

    And i did see your nice example too; but didn't mention as you said because it want using the standard OpenGL multitexturing.

  3. #43
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL collection

    Quote Originally Posted by Min
    In the meantime I've made an extension that can load textures from external image files, since I know a lot of people want this feature.
    Cool that sounds great, why not just make it part of the current Texture Bank though? In anycase it sounds great because external loading of textures/images at runtime is very useful.

    Offtopic -

    Not sure how much use to you they would be but as well as flipcode for learning theres code sampler which is lots of code samples with stuff like Mip-mapping and Multi-Texturing so it could be worth a look.

    http://www.codesampler.com/oglsrc.htm

    Nehe also has some good openGL stuff

    http://nehe.gamedev.net

  4. #44
    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 collection

    Quote Originally Posted by Atom
    Quote Originally Posted by Min
    In the meantime I've made an extension that can load textures from external image files, since I know a lot of people want this feature.
    Cool that sounds great, why not just make it part of the current Texture Bank though?
    Externally loaded textures are handled a bit differently from how the textures in the bank are handled, having them both in one extension would likely cause confusion, like which type of texture is affected by which action and so on.

  5. #45
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL collection

    Ok thanks for the information, im looking forward to testing im sure it will be great.

  6. #46
    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 collection

    The preview problem persists, I need some help with this. It's a pain to debug since it works fine on my own computer. I've got a friend whom it does not work for and I'm having him test it ( poor guy. :P ) Even though I've tried a lot of different things so far I've gotten nowhere.

    To sum up the problem for those who don't know about it; the Texture bank dialog box has a frame to the right that is supposed to show a preview of the selected texture, it works for some people but for some it is just a grey box. I thought I'd post some of the relevant code here and see if you guys can find anything.


    The preview frame in resources with SS_OWNERDRAW flag specified:
    Code:
    LTEXT           "", IDC_PREVIEW, 197, 17, 96, 96, WS_BORDER | SS_OWNERDRAW
    setupPreview function called at WM_INITDIALOG message in the dialog proc:
    Code:
    static HDC   hDC;
    static HGLRC hRC;
    
    
    static void setupPreview( HWND hPreview )
    {
    	if ( !hPreview ) {
    		MessageBox( 0, "Handle is NULL!", 0, MB_OK );
    		return;
    	}
    
    	hDC = GetDC( hPreview );
    
    	if ( !hDC ) {
    		MessageBox( 0, "GetDC failed!", 0, MB_OK );
    		return;
    	}
    
    	PIXELFORMATDESCRIPTOR pfd = { 0 };
    	pfd.nSize = sizeof( PIXELFORMATDESCRIPTOR );
    	pfd.nVersion = 1;
    	pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL;
    	pfd.cColorBits = 24;
    	pfd.cDepthBits = 32;
    
    	int iFormat = ChoosePixelFormat( hDC, &pfd );
    	if ( !iFormat ) {
    		MessageBox( 0, "ChoosePixelFormat failed!", 0, MB_OK );
    		return;
    	}
    	if ( !SetPixelFormat( hDC, iFormat, &pfd ) ) {
    		MessageBox( 0, "SetPixelFormat failed!", 0, MB_OK );
    		return;
    	}
    
    	hRC = wglCreateContext( hDC );
    	if ( !hRC ) {
    		MessageBox( 0, "wglCreateContext failed!", 0, MB_OK );
    		return;
    	}
    	wglMakeCurrent( hDC, hRC );
    
    
    	// Set up OpenGL
    	glClearColor( 0.4f, 0.4f, 0.4f, 1.0f ); // Dark grey
    	glClearDepth( 1.0f );
    
    	glEnable( GL_DEPTH_TEST );
    	glDepthFunc( GL_LEQUAL );
    
    	glEnable( GL_TEXTURE_2D );
    	glEnable( GL_ALPHA_TEST );
    	glAlphaFunc( GL_GREATER, 0.0f ); // Don't draw completely transparent fragments
    
    	glEnable( GL_BLEND );
    	glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); // Set up alpha blending
    
    	glEnable( GL_CULL_FACE );
    	glCullFace( GL_BACK );
    
    	// I use polygon stipple to create the chequered pattern in the background
    	GLubyte mask[32*4] = {
    		0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 
    		0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 
    		0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
    		0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
    		0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 
    		0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 
    		0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
    		0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
    	};
    	glPolygonStipple( mask );
    }
    drawPreview function and when it is called:
    Code:
    static int previewStyle = 0;
    
    
    // In the dialog proc...
    		case WM_DRAWITEM: {
    			if ( wParam == IDC_PREVIEW ) {
    				drawPreview( GetDlgItem( hDlg, IDC_PREVIEW ) );
    				return TRUE;
    			}
    			break;
    		}
    
    
    // Not in dialog proc, obviously...
    static void drawPreview( HWND hPreview )
    {
    	wglMakeCurrent( hDC, hRC );
    
    	glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    
    	glMatrixMode( GL_PROJECTION );
    	glLoadIdentity();
    	glOrtho( 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f );
    
    	glMatrixMode( GL_MODELVIEW );
    	glLoadIdentity();
    
    	// Draw chequered pattern
    	glColor3f( 0.6f, 0.6f, 0.6f ); // Lighter grey
    	glBindTexture( GL_TEXTURE_2D, 0 ); // No texture
    	glEnable( GL_POLYGON_STIPPLE );
    	glDepthMask( FALSE );
    	glBegin( GL_QUADS );
    		glVertex3f( 0.0f, 0.0f, 0.0f );
    		glVertex3f( 0.0f, 1.0f, 0.0f );
    		glVertex3f( 1.0f, 1.0f, 0.0f );
    		glVertex3f( 1.0f, 0.0f, 0.0f );
    	glEnd();
    	glDepthMask( TRUE );
    	glDisable( GL_POLYGON_STIPPLE );
    	glColor3f( 1.0f, 1.0f, 1.0f ); // White
    
    	switch ( previewStyle ) {
    
    		case 1:
    			drawPreviewStretched( hPreview );
    			break;
    
    		case 2:
    			drawPreviewCube( hPreview );
    			break;
    
    		case 3:
    			drawPreviewPlane( hPreview );
    			break;
    
    		default:
    			drawPreviewExact( hPreview );
    			break;
    	}
    
    	glFinish();
    	SwapBuffers( hDC );
    }
    drawPreview is also called whenever a texture is changed.

    There is more code for drawing the different kinds of previews, still, this alone should display something ( a chequered pattern ), not just a grey box. The code produces no gl errors and the set up is completed without any of the error messages being displayed.

    Let me know if you wish to see other parts of the code.

  7. #47
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Sep 2006
    Location
    Dublin, Ireland / Covilha, Portugal
    Posts
    227
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL collection

    haven't tested it yet, but going trough the replies it seems cool, at the same time, since this deals with open gl I was wandering if artoolkit could be implemented alongside this, or even with xlua - http://www.hitl.washington.edu/artoolkit/

    if so could you guys give it a try? I think it would be a very good addition to mmf

  8. #48
    No Products Registered

    Join Date
    Sep 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL collection

    Has anyone been able to successfully do Vertex Arrays or Vertex Buffer Objects? I seem to crash when ever I do. Display Lists work fine.

  9. #49
    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 collection

    I was able to use VBOs on the old OpenGL object. In fact you could try copying my code over from the OpenGL example included with XLua, and see if it crashes.

    Sorry, I haven't been able to look at your files yet, probably not until tomorrow.

  10. #50
    No Products Registered

    Join Date
    Sep 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: OpenGL collection

    Hmm ya, probably my code is bad, because your's works fine for me. Just seemed odd for it to crash instead of just give me an error. Np on the file. I probably should put it in a thread rather than PM you so other's might be able to resolve the problem too or expose my newbness.

Page 5 of 23 FirstFirst ... 3 4 5 6 7 15 ... LastLast

Similar Threads

  1. OpenGL Collection Beta download
    By Min in forum OpenGL
    Replies: 2
    Last Post: 15th May 2017, 05:24 AM
  2. Garbage Collection
    By fawfulfan in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 19th August 2012, 09:50 AM
  3. Garbage Collection For IOS
    By sinister in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 25th August 2011, 10:49 AM
  4. OpenGL Collection--Efficiency of Camera?
    By SuperChiken in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 4th May 2010, 03:10 AM
  5. Help with garbage collection?
    By Pixelthief in forum Lua Scripting
    Replies: 33
    Last Post: 4th September 2009, 12:34 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
  •