Code question

Talk about anything concerning the source code.
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Code question

Post by Matlo »

IDEs: Eclipse CDT, Codeblocks
Compiler: gcc
Libraries: libSDL, libxml, wxWidgets, pthread

I also use bluez and glib only for the Linux/bluetooth version, and pthreads-w32 for the Windows version.
GIMX creator
User avatar
Zero
Posts: 68
Joined: Tue Aug 16, 2011 9:10 pm

Re: Code question

Post by Zero »

Matlo wrote:Sorry, but I don't really like windows exclusive software. As a developer, I work on my OS first (Linux), and only after that I may port it to other OSes (which is easy as I use cross platform development tools). I'm developing GIMX to meet my needs (I'm the first user of it), and I don't have the time to help you build something I will never use.
Sure mate, I was just asking. I've placed an order for a ps3 it should be here by the end of the week ... if they still have the KZ3 bundle :roll:

@cldfusion. If I start working on the emulator, I won't be needing any additional frameworks but the standard .NET and VS 2010 as IDE.

Or if I go java.

Eclipse + RXTX for serial port com.
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Code question

Post by Matlo »

Zero wrote: Or if I go java.

Eclipse + RXTX for serial port com.
The rxtx library doesn't seem a good choice to me: link1 link2.
GIMX creator
User avatar
Zero
Posts: 68
Joined: Tue Aug 16, 2011 9:10 pm

Re: Code question

Post by Zero »

Matlo wrote:
Zero wrote: Or if I go java.

Eclipse + RXTX for serial port com.
The rxtx library doesn't seem a good choice to me: link1 link2.
Oh snap ! O.o

oh well C# it is ... I was feeling like coding something fresh in C# anyways.
Hmm I could use Mono that way it will also work on my android phone :O


-------------

I have a question, how do you handle the mouse movement hook to avoid the focus of other windows or clicks outside of the capture window.
I see that you open a window Sixaxis Controll and when the window is focused the mouse cursor disappears.
I've created a quick form/window where I plan on capturing input for processing and I lock the cursor to the window bounds while focused. I plan on reading the coordinates at 1ms intervals and after every read I re-position the cursor to the center of the window. Thus creating the illusion that the cursor is locked to the window center.

Is there a better way of doing this? I'm surprised that the cursor is completely "gone" in your implementation.
User avatar
Zero
Posts: 68
Joined: Tue Aug 16, 2011 9:10 pm

Re: Code question

Post by Zero »

nvm bad post

:P wrong structure
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Code question

Post by Matlo »

I'm using a customized SDL library that gets raw events from the mouse. Getting coordinates is a bad idea as it gives the worst precision (rounding, pointer acceleration...). The SDL library provides a function to grab the mouse.

1ms intervals seems very hard to reach...
GIMX creator
User avatar
Zero
Posts: 68
Joined: Tue Aug 16, 2011 9:10 pm

Re: Code question

Post by Zero »

Matlo wrote:I'm using a customized SDL library that gets raw events from the mouse. Getting coordinates is a bad idea as it gives the worst precision (rounding, pointer acceleration...). The SDL library provides a function to grab the mouse.

1ms intervals seems very hard to reach...
Yes ... I'm now using a low level mouse and keyboard hook so I get every event as it happens ... well more like as it hits the event queue. I've started to coded a basic library to hook raw input some time ago but haven't got around finishing it. After I get everything working ill probably replace the input system to use the raw input library. That way I will also be able to tell the devices apart. But that's a long way to go :roll:
casio1987
Posts: 8
Joined: Thu Nov 10, 2011 5:53 pm

Re: Code question

Post by casio1987 »

Zero wrote:oh well its just to clear some things up on how to use the controller. I'm not 100% sure on the structure that needs to be sent to the controller (teensy++), values and stuff. I'm not a master in C/C++ and in my view some things did not add up.

I wana build my own application to talk to the controller you've created, however I'd like to code it in Java or C#. At the moment I'm leaning more towards C# ... that will lock its usage to windows platform but I don't care, I do this for the fun of it.


Once I have something solid I'd like to post it here, get feedback from you. I'll probably be using WPF. Maybe we can work together? :roll:
No, it's not. Linux supports C# through Mono, already for a long time and if you wanna implement something in WPF, you better choose Moonlight (using Mono). Personally, I would stick with C#, that can be used in both Linux and in Windows.
User avatar
Zero
Posts: 68
Joined: Tue Aug 16, 2011 9:10 pm

Re: Code question

Post by Zero »

I've had a look at mono a long time ago but I don't feel like using it, I'm only "gaming" on the Win platform anyway.

Besides I have very little to no time to work on improving the actual code.

Fell like adding to the project?
casio1987
Posts: 8
Joined: Thu Nov 10, 2011 5:53 pm

Re: Code question

Post by casio1987 »

Zero wrote:I've had a look at mono a long time ago but I don't feel like using it, I'm only "gaming" on the Win platform anyway.

Besides I have very little to no time to work on improving the actual code.

Fell like adding to the project?
No, not yet. My time is way too limited for another project right now. I'm currently still on uni, next to working on a major project as hobby, doing some freelance work and rl.

I've downloaded the source and a lot of work has already done from what I've seen (great job Matlo!). I need to carefully study it first, but it takes time I don't have.

Hmm, I don't like wrappers for the native code. They're always getting out of date and the effort it takes to keep up to date is not worth it imho. It's better to stick with Matlo's branch, also for performance.

Besides that, I don't think it's possible to hook kb or mouse globally in mono (clr) or wine (boxed). The only way afaik know (no hard core linux user, so correct me if I'm wrong) is to capture it via x11 events. Otherwise you need to port the whole project to c# and p/invoke calls don't work either in mono (you can try com), so you may need wine. Wine on the other hand afaik does only support max .net framework 2.0 correctly.
Both options are poor options due to performance.

So if you are asking for participation for Windows development only usinig a cli language, my answer is no, sorry. I tend to develop businss apps in c# nowadays (rad), but it's not smart to develop this solution in it, cause it's all about performance and you can't get it with jit, because of the natural overhead.
Post Reply