Titlebarless Graphics()

BlitzMax Forums/BlitzMax Programming/Titlebarless Graphics()

TwoCorin517(Posted 2009) [#1]
I see alot of this for B3d, but anything for BMax, before you tell me to google it, I have.


Retimer(Posted 2009) [#2]
http://blitzmax.com/Community/posts.php?topic=55899#622214

alternatively, it is pretty easy to set up in maxgui (if you have it) or wxmax (if you dont have maxgui).


TwoCorin517(Posted 2009) [#3]
Yes, but adding MaxGUI is adding more cans of worms than I want to open... I have it, but I don't need it for this project.

Do you have anything that's more cross-platform? I'm devving on Ubuntu and would like to maximize support for it... (Seeing as BMax doesn't seem to work in my VM)


Retimer(Posted 2009) [#4]
Perhaps you can edit the source code to the graphics context you're using to create the window and recompile.

It's out of my scope, but maybe take a look at

brl.mod/glgraphics.mod/glgraphics.linux.c

There has to be 'some' way to create the window without a titlebar.


Retimer(Posted 2009) [#5]
I've found a method for windows that doesn't require any api and should be possible to the same effect on linux.

In brl.mod/glgraphics.mod/glgraphics.win32.c

in the BBGLContext *bbGLGraphicsCreateGraphics function I changed:

hwnd_style=WS_CAPTION|WS_SYSMENU;


to

hwnd_style=WS_POPUP;


Ofcourse this isn't ideal if you want support for title bars as well, however there's no reason you couldn't extend the module to have an additional argument to support window arguments, rather then being so limited.


TwoCorin517(Posted 2009) [#6]
Any ideas for linux?

http://www.ogre3d.org/forums/viewtopic.php?f=4&t=11437

Seems to say alot... But surely there's a will and a way.

Edit; I've tried it out in Windows and that doesn't work either... I think I need to recompile somehow...


Retimer(Posted 2009) [#7]
Yes you need to recompile the brl.glgraphics module after making the edit. Make sure to back them up.

Do you have mingw for building the modules? if so go into command prompt and type:

>> cd c:\<blitzmax directory location>\bin
>> bmk makemods brl.glgraphics

once built, you should be able to run your app without the border.


degac(Posted 2009) [#8]
And if you want to change 'permanentely' the DirectX version - without using the Indiepath hack - you can change the file

mod/dxgraphic.mod/d3d7graphics.bm

Function Create:TD3D7Graphics


If depth
hwnd=CreateWindowExA( 0,_wndClass,title,WS_VISIBLE|WS_POPUP,0,0,width,height,0,0,hinst,Null )
Else
Local style=WS_VISIBLE|WS_POPUP



Maybe BRL (in future) can decide to insert a GLOBAL window_style variable to manage these features.


Retimer(Posted 2009) [#9]
He's using opengl and wants it cross-platform, so directx probobly isn't what he wants to change. He needs 2 other fixes, one for mac and linux in glgraphics.mod files. One for windows was already made available.


Again though, there's no limit to altering the modules to add support for this feature as an 'optional' argument, or adding a command function into the driver methods to preset the window flags. It just wouldn't be official. I tried this yesterday with windows and it worked alright - but getting it for mac and linux requires a bit more work. You can fix it for linux/mac by altering the below sections of code somewhere and somehow:

Linux:

glgraphics.linux.c
In BBGLContext *bbGLGraphicsCreateGraphics( int width,int height,int depth,int hz,int flags ){
else
	{		
		swa.border_pixel=0;
		swa.event_mask=StructureNotifyMask|ResizeRedirectMask;
		swa.colormap=XCreateColormap(xdisplay,RootWindow(xdisplay,0),vizinfo->visual,AllocNone);
		window=XCreateWindow(
			xdisplay,
			RootWindow(xdisplay,xscreen),
			0,
			0,  
			width,height,
			0,
			vizinfo->depth,
			InputOutput,
			vizinfo->visual,
			CWBorderPixel|CWColormap|CWEventMask,
			&swa
		);
		displaymode=MODE_WINDOW;
	}

Something above needs to be altered.

And

Mac:

glgraphics.macos.m
In BBGLContext *bbGLGraphicsCreateGraphics( int width,int height,int depth,int hz,int flags ){

}else{
		int style;
		NSRect rect;
		
		style=NSTitledWindowMask|NSClosableWindowMask;
		rect=NSMakeRect( 0,0,width,height );
		
		window=[[BBGLWindow alloc]
			initWithContentRect:rect
			styleMask:style
			backing:NSBackingStoreBuffered
			defer:NO];

		if( !window ) return 0;
		
		[window setDelegate:window];
		[window setAcceptsMouseMovedEvents:YES];
		[window setTitle:[NSString stringWithCString:bbStringToCString(bbAppTitle)]];
		[window center];
		[window makeKeyAndOrderFront:NSApp];
		mode=MODE_WINDOW;
	}



I'm guessing if you just add the line:

HideMenuBar();


before

mode=MODE_WINDOW;


would probobly do the trick for mac.


TwoCorin517(Posted 2009) [#10]
I've gotten it to work for Windows... I love BLIDE...
It'll take some time before I can figure it out for Linux. (Including how to compile Modules)

Is there a way to compile FOR linux while IN Windows?


plash(Posted 2009) [#11]
Is there a way to compile FOR linux while IN Windows?
Not really.


Retimer(Posted 2009) [#12]
Is there a way to compile FOR linux while IN Windows?


VMWare or microsoft virtual pc, but that's it.