Go Back   xda-developers > Development and hacking > Development and Hacking

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 8th August 2008, 01:29 AM
NuShrike's Avatar
NuShrike NuShrike is offline
Senior Member
 
Join Date: Sep 2007
Posts: 863
Default [REF/DEV] KaiserGL SDK (for Imageon on Qualcomm 72xx devices)

All REMOVED by user request.
__________________
Support what I do and donate me a frankfurter.

Last edited by NuShrike; 3rd September 2009 at 08:25 PM.. Reason: REMOVED by user request
Reply With Quote
Sponsored Links

  #2  
Old 8th August 2008, 01:32 AM
NuShrike's Avatar
NuShrike NuShrike is offline
Senior Member
 
Join Date: Sep 2007
Posts: 863
Default How-to

catch going to suspend: http://forum.xda-developers.com/show...41#post2776841

Last edited by NuShrike; 14th October 2008 at 10:02 PM..
Reply With Quote

  #3  
Old 8th August 2008, 01:33 AM
NuShrike's Avatar
NuShrike NuShrike is offline
Senior Member
 
Join Date: Sep 2007
Posts: 863
Default

* more reserved *
Reply With Quote

  #4  
Old 8th August 2008, 08:31 PM
NuShrike's Avatar
NuShrike NuShrike is offline
Senior Member
 
Join Date: Sep 2007
Posts: 863
Default

Following up from post getting OT in thread:
Quote:
Originally Posted by ycavan View Post
My opengl es init function is called after UpdateWindow(), so I'm still stumped as to why the surface still cannot be created... here's my winmain:
You might be missing some of the modern WM6 calls. Here's the relevant code from the working ported version of Graphics for the Masses.

I started with working code from the AppWizard. tabs/spaces is pushing the formatting everywhere:

Code:
int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPTSTR    lpCmdLine,
                   int       nCmdShow)
{
	MSG msg;
	HACCEL hAccelTable;
	int retval;

	// Perform application initialization:
	if (!InitInstance(hInstance, nCmdShow)) 
	{
		return FALSE;
	}

	hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_APPSTUFF));

	// Main message loop:
	for(;;)
	{
		switch(gMinimized_mode)
		{
		case 0:
game_loop:
			while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) == TRUE)
			{
				if (GetMessage(&msg, NULL, 0, 0) )
				{
					if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) 
					{
						TranslateMessage(&msg);
						DispatchMessageW(&msg);
					}
				}
				else
				{
					retval = (int) msg.wParam;
					goto out;
				}
			}

			if (!gMinimized_mode)
			{
				/* app code */
				eglSwapBuffers  (eglDisplay, eglWindowSurface);
				if(retval == 0)
				{
					/* app exit code */
					goto out;
				}
			}
			break;
		default:
			while (GetMessage(&msg, NULL, 0, 0) )
			{
				if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) 
				{
					TranslateMessage(&msg);
					DispatchMessageW(&msg);
				}
				if (msg.message == WM_PAINT)
				{
					gMinimized_mode = 0;
					goto game_loop;
				}
			}
			retval = (int) msg.wParam;
			goto out;
		}
	}
out:
	return retval;
}

ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass)
{
	WNDCLASS wc;

	wc.style         = CS_HREDRAW | CS_VREDRAW;
	wc.lpfnWndProc   = WndProc;
	wc.cbClsExtra    = 0;
	wc.cbWndExtra    = 0;
	wc.hInstance     = hInstance;
	wc.hIcon         = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPSTUFF));
	wc.hCursor       = 0;
	wc.hbrBackground = NULL;//(HBRUSH) GetStockObject(WHITE_BRUSH);
	wc.lpszMenuName  = 0;
	wc.lpszClassName = szWindowClass;

	return RegisterClass(&wc);
}

BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
    HWND hWnd;
    TCHAR szTitle[MAX_LOADSTRING];		// title bar text
    TCHAR szWindowClass[MAX_LOADSTRING];	// main window class name

    g_hInst = hInstance; // Store instance handle in our global variable

    // SHInitExtraControls should be called once during your application's initialization to initialize any
    // of the device specific controls such as CAPEDIT and SIPPREF.
    SHInitExtraControls();

    //LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	wcscpy(szTitle, appName);
    LoadString(hInstance, IDC_OGLESEXFW, szWindowClass, MAX_LOADSTRING);

    //If it is already running, then focus on the window, and exit
    hWnd = FindWindow(szWindowClass, szTitle);	
    if (hWnd) 
    {
        // set focus to foremost child window
        // The "| 0x00000001" is used to bring any owned windows to the foreground and
        // activate them.
        SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001));
        return 0;
    } 

    if (!MyRegisterClass(hInstance, szWindowClass))
    {
    	return FALSE;
    }

    hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);

    if (!hWnd)
    {
        return FALSE;
    }

    // When the main window is created using CW_USEDEFAULT the height of the menubar (if one
    // is created is not taken into account). So we resize the window after creating it
    // if a menubar is present
    if (g_hWndMenuBar)
    {
        RECT rc;
        RECT rcMenuBar;

        GetWindowRect(hWnd, &rc);
        GetWindowRect(g_hWndMenuBar, &rcMenuBar);
        rc.bottom -= (rcMenuBar.bottom - rcMenuBar.top);
		
        MoveWindow(hWnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, FALSE);
    }


    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);

	{
		/* EGL Setup */
		EGLContext ctx;
		EGLint majorVersion;
		EGLint minorVersion;

		//eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
		eglDisplay = eglGetDisplay(GetDC(hWnd));
		eglInitialize(eglDisplay, &majorVersion, &minorVersion);
		eglConfig = select_config(eglDisplay, EGL_WINDOW_BIT, 16, 16, 4); 
		ctx = eglCreateContext(eglDisplay, eglConfig, NULL, NULL);
		eglWindowSurface = eglCreateWindowSurface(eglDisplay, eglConfig, hWnd, NULL);
		eglMakeCurrent(eglDisplay, eglWindowSurface, eglWindowSurface, ctx);
		/* rest of app init */
	}

    return TRUE;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    int wmId, wmEvent;
    PAINTSTRUCT ps;
    HDC hdc;

    static SHACTIVATEINFO s_sai;
	
    switch (message) 
    {
        case WM_COMMAND:
            wmId    = LOWORD(wParam); 
            wmEvent = HIWORD(wParam); 
            // Parse the menu selections:
            switch (wmId)
            {
                case IDM_HELP_ABOUT:
                    DialogBox(g_hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, About);
                    break;
                case IDM_OK:
                    SendMessage (hWnd, WM_CLOSE, 0, 0);				
                    break;
                default:
                    return DefWindowProc(hWnd, message, wParam, lParam);
            }
            break;
        case WM_CREATE:
			{
				SHMENUBARINFO mbi;

				memset(&mbi, 0, sizeof(SHMENUBARINFO));
				mbi.cbSize     = sizeof(SHMENUBARINFO);
				mbi.hwndParent = hWnd;
				mbi.nToolBarId = IDR_MENU;
				mbi.hInstRes   = g_hInst;

				if (!SHCreateMenuBar(&mbi)) 
				{
					g_hWndMenuBar = NULL;
				}
				else
				{
					g_hWndMenuBar = mbi.hwndMB;
				}

				// Initialize the shell activate info structure
				memset(&s_sai, 0, sizeof (s_sai));
				s_sai.cbSize = sizeof (s_sai);
			}
            break;
        case WM_PAINT:
            hdc = BeginPaint(hWnd, &ps);            
            // TODO: Add any drawing code here...            
            EndPaint(hWnd, &ps);
            if (!gMinimized_mode) eglSwapBuffer();
            break;
        case WM_DESTROY:
            eglMakeCurrent(NULL, NULL, NULL, NULL);
            eglDestroyContext(eglDisplay, eglContext);
            eglDestroySurface(eglDisplay, eglWindowSurface);
            eglTerminate(eglDisplay);

            CommandBar_Destroy(g_hWndMenuBar);
            PostQuitMessage(0);
            break;

		case WM_SIZE:
			switch(wParam)
			{
			case SIZE_MINIMIZED:
				gMinimized_mode = 1;
				break;
			case SIZE_MAXIMIZED: case SIZE_RESTORED: case SIZE_MAXSHOW:
				gMinimized_mode = 0;
			default:
				{
					RECT wrect;
					GetClientRect(hwnd, &wrect);
					/* app resize code */
					break;
				}
			}
			break;

        case WM_ACTIVATE:
            // Notify shell of our activate message
            SHHandleWMActivate(hWnd, wParam, lParam, &s_sai, FALSE);
            break;
        case WM_SETTINGCHANGE:
            SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai);
            break;

        case WM_KEYDOWN:
        {
            switch(wParam)
            {
            case(VK_UP):
                break;
            case(VK_DOWN):
                break;
            case(VK_LEFT):
                break;
            case(VK_RIGHT):
                break;
            case(VK_RETURN):
                break;
            }
            if (wParam == VK_ESCAPE)
				SendMessage(hwnd, WM_CLOSE, 0, 0);
			break;
        }

        default:
            return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}
Reply With Quote

  #5  
Old 9th August 2008, 06:04 AM
ycavan ycavan is offline
Senior Member
 
Join Date: Nov 2007
Posts: 96
Default

I'm using evc4, so I can't build for a THUMB ( wince 5.0 ) device... any way you can recompile the lib for ARMv4?

Otherwise, I'm still linking w/ the Vincent lib.

Anyway, I started a whole new app ( appwizard hello template ) instead of writing the winmain from scratch and I still cannot generate a surface when I have anything but EGL_NONE in the config requests.

One thing I note is that fps is about 47-48, but once again, the texture is not mapped onto the object. If I put it in my folder w/ the Vincent dll, the texture is mapped and the fps is about 11-12.

I'm not quite familiar w/ EGL, but... does anyone know the EGLConfig structure? I tried searching for it to see what the requested width/height per config was so I can debug why the surface just doesn't get created.

anyway, here's my code:
TestApp2.zip
Reply With Quote

  #6  
Old 9th August 2008, 11:56 AM
NuShrike's Avatar
NuShrike NuShrike is offline
Senior Member
 
Join Date: Sep 2007
Posts: 863
Default

Quote:
Originally Posted by ycavan View Post
I'm using evc4, so I can't build for a THUMB ( wince 5.0 ) device... any way you can recompile the lib for ARMv4?
That's ARMv4 or ARMv4i? I'm going to assume latter because that's what most of the dlls seem to be targeting. I'll put this up soon.

Meantime, GetClientRect() on your hwnd and make sure the rect is sane before you pass it on to eglCreateWindowSurface().

Also, Imageon may work better with GLfloat values although it probably kills Vincent (with software emulation on the ARM without native FP support in armv6 by the compiler) with anything but GLfixed. Try some benchmarking to see which works out better.

Last edited by NuShrike; 3rd September 2008 at 01:21 PM..
Reply With Quote

  #7  
Old 9th August 2008, 12:06 PM
raiisak's Avatar
raiisak raiisak is offline
Senior Member
 
Join Date: May 2008
Location: Oslo
Posts: 1,053
Default



100000xtimes thanks!
Reply With Quote

  #8  
Old 9th August 2008, 02:03 PM
NetrunnerAT NetrunnerAT is offline
Senior Member
 
Join Date: Mar 2007
Location: Vienna
Posts: 1,335
Default

can you make a sourceforce project??
Reply With Quote

  #9  
Old 9th August 2008, 04:32 PM
ycavan ycavan is offline
Senior Member
 
Join Date: Nov 2007
Posts: 96
Default

Quote:
Originally Posted by NuShrike View Post
That's ARMv4 or ARMv4i? I'm going to assume latter because that's what most of the dlls seem to be targeting. I'll put this up soon.

Meantime, GetClientRect() on your hwnd and make sure the rect is sane before you pass it on to eglCreateWindowSurface().
.
ARMv4 is what evc4 targets...
GetClientRect() is giving me very sane values, 268x240... 268 due to the bars up top & below.

I guess I'm just confused as to why Vincent is able to properly create the proper surface while our drivers cannot...

Edit:
Quote:
//eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
eglDisplay = eglGetDisplay(GetDC(hWnd));
eglInitialize(eglDisplay, &majorVersion, &minorVersion);
eglConfig = select_config(eglDisplay, EGL_WINDOW_BIT, 16, 16, 4);
ctx = eglCreateContext(eglDisplay, eglConfig, NULL, NULL);
eglWindowSurface = eglCreateWindowSurface(eglDisplay, eglConfig, hWnd, NULL);
eglMakeCurrent(eglDisplay, eglWindowSurface, eglWindowSurface, ctx);
/* rest of app init */
I just realized that you don't provide egl config attribs for for eglCreateWindowSurface or for eglCreateContext... huh. Doing that, the surface and context are created ok, but the texture still isn't loaded... mebbe a problem w/ texture loading. :P

Last edited by ycavan; 9th August 2008 at 05:00 PM..
Reply With Quote

  #10  
Old 9th August 2008, 06:08 PM
cp_kirkley cp_kirkley is offline
Senior Member
 
Join Date: Oct 2007
Posts: 130
Default

Quote:
Originally Posted by NuShrike View Post
That's ARMv4 or ARMv4i? I'm going to assume latter because that's what most of the dlls seem to be targeting. I'll put this up soon.

Meantime, GetClientRect() on your hwnd and make sure the rect is sane before you pass it on to eglCreateWindowSurface().

Also, Imageon may with better with GLfloat values although it probably kills Vincent (with software emulation on the ARM without native FP support in armv6 by the compiler) with anything but GLfixed. Try some benchmarking to see which works out better.
In the words of the great Sammy L.
Quote:
ENGLISH MOTHAF*CKA DO YOU SPEAK IT!?!
__________________
AT&T Kaiser
Rom: Garmin's Manila DK4.3a

No more flashes until M3D is stable.
------------------
CoolerMaster Mystique Case
Gigabyte GA-P35 DS3-L
Thermaltake 650 PSU (Modular)
Visiontek HD3870 - 512 DDR4
Seagate Barracuda 250GB/32MB Cache x 2 - Raid 0
LG BluRay Burner
E8400 O'Ced - 3.73 Ghz
6 Gig OCZ Reaper HPC DDR2 1066 - 4/4/4/15
Vista x64/XP/Linux Triple Boot - Huzzah!
Reply With Quote

Reply

Tags
3d drivers, kaisergl, opengl

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:11 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.