Jump to content

  • Log In with Google      Sign In   
  • Create Account

//Lumia

Member Since 22 Dec 2012
Offline Last Active Today, 01:21 PM

Topics I've Started

Gathering information on input systems

04 February 2014 - 10:57 AM

Hi,

 

i'm currently trying to gather as much information on input systems as possible.

In order to this i looked up some different libraries like GLFW and SDL.

While getting in touch with them, i noticed that it is required to have an instance of a window to actually gain input information from the underlaying OS via that libraries.

 

So here is my question(s):

Would you call it a bad practice if one would try to gain input information directly from the OS even if there is no window instance? (the input system should run fine without a window to do its job)

The game itself would then decide whether to handle the input event that is emited by the input system or not because it has some knowledge about the window it is running in.

If the window of the game has focus then the event would be handled. If the window has no focus then the event would be consumed or whatever but not handled.

If doing so - are there any pitfalls one would have to deal with while the project is growing?

What are typical approaches in commercial products to do things like this?

 

I really appreciate any information on this subject.

Thank you in advance.

 

 

 

 


conditional object creation

16 August 2013 - 06:56 AM

Hi there,

 

i'm currently trying to write a kind of XML-Parser for my gui framework and i'm struggling with the object creation.

 

So a possible XML-File could look like this:

<Window id="Notification" title="Notification" message="An Error occured while...">
   <button id="Button_try_again" caption="Try again" />
   <button id="Button_cancel" caption="cancel" />
</Window> 

For iterate through all tags i'm using StaX. The name of each tag is accessible by calling the getLocalName()-method.

Furthermore there is an corresponding class for each valid tag (just like window and button in the example above) and i need to get an object of one of them.

 

So here is a little snippet of what came to my mind to achieve this:

String tagname = Staxparser.getLocalName();

if(tagname.equalsIgnoreCase("Window")) {
     // instantiate window class
} else if(tagname.equalsIgnoreCase("Button")) {
     // instantiate button class
}

Well, this looks pretty much nasty and should not be done like this.

 

So here is the actual question:

Is there a way to not use a whole bunch of if-else-statements to figure out what class needs to be instantiated?

Is there a design pattern or anything else that is able to simplify the problem?

 

Thanks in advance.

 


Class Diagram - where to start?

22 February 2013 - 08:25 AM

Hello everyone,

 

i was struggeling a lot in the past few days because i want to create an editor.

The requirements are the following:

  • the editor should be maintainable in the future
  • high performance
  • plugins can be installed easily
  • architecture: MVC

So, to achieve all this points i wanted to create the application from scratch instead of start coding like crazy until the first problems come up.

In order to this, my first step is to create a class diagram.

But this is exactly my problem. I don't know where to start (,though i know exactly what i want and how the application should act like) wacko.png

Shall i start off with the view-classes or maybe with a specific one from the model-part...

 

So my question(s):

How do you start such diagrams (where is your starting point)? Do you follow a strict procedure or something else?

 

Thank you in advance.

 

 


PARTNERS