Web Toolbar by Wibiya

New renderer


A place to ask questions or discuss issues relating to implementing applications with Axiom. If you are unsure of where to post, post here.

Veteran

Posts: 220

Joined: Fri Apr 17, 2009 7:38 am

Location: Fi

Post Mon Apr 27, 2009 5:08 am

New renderer

Hi.

I tried axiom (from trunk) on linux, with no luck.

So, I
* removed DevIL, and now it uses c# bitmap loaders. DDS not yet implemented.
(i removed this because its hard to find binaries on mac!)
* removed SDL (problems and so much native libraries)
* updated to use Tao 2.1.
* programmed Platform.OpenTK and Platform.OpenGL.OpenTK

Now linux and mac uses opentk (and in windows if sets ForceOTK flag to true).
In linux, doesnt work yet:
i have tried x32 and x64,
free and ati drivers, and on 2 different computer, but doesnt work
(x64 there was in Core/Memory.cs Copy method causes trouble but now when I removed ati's drivers
it just opens window and stucks, like on ubuntu x32).

But in virtualbox, with ubuntu x32, it works!

--

Edit: so it does work on x32 linux, it was just I must move the window first, then it starts. Try to fix it.
(And when exits, stack trace etc comes *fixed*).. x64 when move, some flickering garbage comes to screen.
Last edited by migel on Fri May 08, 2009 6:43 am, edited 1 time in total.
User avatar

Team Member
Team Member

Posts: 1614

Joined: Thu Mar 02, 2006 11:29 pm

Location: Boston, MA, USA

Post Mon Apr 27, 2009 2:21 pm

Re: New renderer

This is excellent. I've reworked your code a little so that it fits back into the core. I currently have it working with version 0.7.5.0 ( woodhall ) but making it work with 0.8.0.0 ( crickhollow ) would be trivial. I can either commit the changes to OpenGL and Add the OpenTK Platform Manager to 0.7.5.0 ( and 0.8.0.0 ) or you can get space in the Axiom Contrib project for it. If you want me to add it to core I'll need you to sign the Axiom Contributor Agreement.
Borrillis
The Steward of Axiom

Veteran

Posts: 220

Joined: Fri Apr 17, 2009 7:38 am

Location: Fi

Post Tue Apr 28, 2009 4:21 am

Re: New renderer

I updated [link removed]

* now starting works on linux (but if compiz enabled, sometimes you have to push mouse button in the screen).
* X (close window) button doesnt work
* on x64 linux release build sometimes throws segmention fault or stack trace when exit
* on x64 linux background color is right, anything else isnt (flickering triangles).

Does axiom work on any 64bit OS?
Does it work right when using SDL on 64bit linux?


One idea about DevIL.
If axiom checks if devil exists, it uses it (through plugins or so) but if it doesnt exist,
it "fall back" to C# bitmap loaders (better cross platform compatibility).

Is there a way to get rid of these DirectX & directinput warnings on linux?
I tried to check if its not windows, then do not add these that plugins but maybe these
checks are wrong place now.


Hmm, how I can hide mouse pointer?
This
System.Windows.Forms.Cursor.Hide();
doesnt hide cursor in linux.

And if I want grab mouse, put it to the center of the window
System.Windows.Forms.Cursor.Position = new Point(CX, CY);
does not put pointer always center of the window.

I tried to make that the mouse is always centered (grabbed) and now moving camera mouse doesnt exit the window,
but i didnt success.
Last edited by migel on Fri May 08, 2009 6:43 am, edited 1 time in total.
User avatar

Contributor
Contributor

Posts: 205

Joined: Mon Jan 19, 2009 10:39 am

Location: Istanbul, TURKIYE

Post Tue Apr 28, 2009 6:36 am

Re: New renderer

System.Windows.Forms.Cursor.Position = new Point(CX, CY);
does not put pointer always center of the window.


cursor works with global coordinates of your screen, so you must convert it to relative coordinations,

to get Center of your forms myComponent

  Code:
Point componentCenter = myComponent.PointToScreen(new Point(myComponent.Width / 2, myComponent.Height / 2));


then you can grab the cursor to componentCenter

but it is a little wierd to snap your mouse on a windowed application so you might do it on your components focus event, like below:

  Code:
protected override void OnGotFocus(EventArgs e)
        {
            base.OnGotFocus(e);
            Point componentCenter = myComponent.PointToScreen(new Point(myComponent.Width / 2, myComponent.Height / 2));
            Cursor.Position = componentCenter;
        }
Too far from imagination, too far from reality...
Image

Veteran

Posts: 220

Joined: Fri Apr 17, 2009 7:38 am

Location: Fi

Post Tue Apr 28, 2009 8:33 pm

Re: New renderer

Ok.

There's few things I cannot do on OpenTK window yet.

But "Investigate possible WinForms-based GameWindow implementation." in OpenTK forums, it will be better so know when window is unactive
and (i think) more form's method

Veteran

Posts: 220

Joined: Fri Apr 17, 2009 7:38 am

Location: Fi

Post Wed May 06, 2009 3:00 pm

Re: New renderer

Jup, back again.

Updating this a little.
So I downloaded latest trunk and made some changes on that opentk window code.
It works fine now on x32 linux (at least on my ubuntu).

On ubuntu 64, only in particle demo, I can see that rain, but nothing else. So it isnt crashed,
i think maybe there is camera or projection matrix/model matrix wrong at some reason.
I tried compile x32, x64, mixed, any cpu ..same results.

I added new image codecs so can use devil or c# bitmaploader
(can set a flag or it checks if there is DevIL.dll on windows or *DevIl*.config on other os, if not, then uses C# bitmaploader)
(which does not load dds, tga, ..)

Then I once again convert to use tao 2.1 (not too much to change, and I just rip'n paste them from crickhollow's sources).

edit:
Using trac from now on.

Contributor
Contributor

Posts: 853

Joined: Wed Mar 22, 2006 8:06 pm

Post Sun May 17, 2009 5:57 pm

Re: New renderer

Honestly I didn't really get the benefit from having the OpenTK implementations, not against, but is there a difference from SDL?
User avatar

Team Member
Team Member

Posts: 1614

Joined: Thu Mar 02, 2006 11:29 pm

Location: Boston, MA, USA

Post Sun May 17, 2009 9:36 pm

Re: New renderer

andris11 wrote:Honestly I didn't really get the benefit from having the OpenTK implementations, not against, but is there a difference from SDL?


If I'm not mistaken, the biggest benefit is that the OpenTK implementation works on Mac whereas there was some problems with the SDL on MAC.
Borrillis
The Steward of Axiom

Contributor
Contributor

Posts: 853

Joined: Wed Mar 22, 2006 8:06 pm

Post Mon May 18, 2009 4:26 am

Re: New renderer

Borrillis wrote:If I'm not mistaken, the biggest benefit is that the OpenTK implementation works on Mac whereas there was some problems with the SDL on MAC.
Thought so somehow, not that I was sure about any details so a note from migel from another thread made me ask
migel wrote:...SDL and OpenTK renders well on linux and mac...
...or linux/mac then can choose sdl/otk...
But rather a side interest for me, need to let the topic off for Mac users

Veteran

Posts: 220

Joined: Fri Apr 17, 2009 7:38 am

Location: Fi

Post Wed May 20, 2009 5:20 am

Re: New renderer

Yes, the main reason was that I had some problems with sdl on linux
(now it work again, i just was missing some files, I think).
So then I started this "renderer" (window,input) using opentk because it doesnt need any native libraries.

andris11 wrote:migel wrote:...SDL and OpenTK renders well on linux and mac......or linux/mac then can choose sdl/otk...


Oops that was my mistake (that mac talk, old habit),writed it tired, because I havent tested sdl on mac (dont have one), i didnt find sdl
binaries on mac. But some older post someone make it to work so its possible.

Return to General Q & A

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.