[00:18:00] *** Dragonene has left #lwjgl [00:22:50] *** betel has quit IRC [00:24:57] *** cracoucas83 has joined #lwjgl [00:36:05] <cezero> is there an example of actionMap usage somewhere? I don't see anything in TWLExamples [00:36:24] <cracoucas83> cezero : is actionmap linked to keyboard usage? [00:36:33] <cezero> basically, I'd like to bind a hotkey, say, alt-f, to toggle the display of the fpscounter [00:36:52] <cezero> and it looks like something I can define in the theme as an actionmap with an action.. just not sure how to go about it [00:37:06] <MatthiasM2> cezero: easy - in the XML you define an input map eg key -> action [00:37:18] <cezero> right, got that part :) [00:38:15] <MatthiasM2> then you register methods - look at http://hg.l33tlabs.org/twl/file/1f2f1bb2f52a/src/de/matthiasmann/twl/EditField.java#l115 [00:38:26] <MatthiasM2> also look at the ActionMap class [00:38:42] <cezero> ah, ok, that's simple [00:38:59] <MatthiasM2> you can also let it register all methods of your class which have an @Action annottaion [00:39:36] <cezero> oh really? I like the sound of that [00:40:33] *** krumholt_ has quit IRC [00:41:37] <MatthiasM2> cezero: it's used in this class: http://hg.l33tlabs.org/twl/file/1f2f1bb2f52a/src/de/matthiasmann/twl/TableRowSelectionManager.java [00:42:20] <cracoucas83> Matthias do you a DLL to manage keyboard? [00:42:22] <cracoucas83> know [00:42:24] <cezero> nice, got it [00:42:47] <MatthiasM2> cracoucas83: don't ping we with this shit - use the Keyboard class and be done [00:43:23] <cracoucas83> and I will never get asynchronous. I need the millisecond precision not 16 ms precision [00:43:33] <MatthiasM2> lol [00:44:07] <MatthiasM2> learn how the input event system on each platform works - then you might try to create a modified LWJGL version [00:44:36] <MatthiasM2> but I highly doubt that you will get anywhere with that [00:45:15] <cracoucas83> I am close to come back to the AWTGLCanvas because you can use the very precise keylistener. but with AWTGLCanvas I am not sure you can have the fullscreen mode [00:45:50] <MatthiasM2> lol - did you even read what I explained to you a few days ago? [00:46:12] <cracoucas83> yes ? [00:46:15] <MatthiasM2> no [00:46:47] <MatthiasM2> the KeyListener in AWT is NOT async - it runs synchronous with the EDT [00:47:05] <MatthiasM2> and if you render your GL viewport - then this also happens on the EDT [00:47:25] <cracoucas83> so what keyboard input can be async? [00:47:31] <MatthiasM2> none [00:47:47] <cracoucas83> jinput ? [00:48:00] <MatthiasM2> but as you don't read answers - I'll stop giving you any [00:48:07] <cracoucas83> I read [00:48:17] <cracoucas83> but I am not very good in lwjgl [00:48:24] <cracoucas83> I do not understand evrything [00:48:24] <MatthiasM2> you are annoying as hell [00:48:38] <cracoucas83> I am trying to getting better in java [00:48:49] <cracoucas83> to create my game [00:49:05] <MatthiasM2> there is no reason to get async keyboard input [00:49:10] <MatthiasM2> esp for a game [00:49:36] <cracoucas83> I am going to explain you why. I send key state every 4 milliseconds to the server! [00:49:44] <cracoucas83> I need frequent polling [00:49:52] <cracoucas83> more than the refresh rate [00:49:53] <MatthiasM2> no - you need a better design [00:54:36] *** krumholt_ has joined #lwjgl [00:54:40] <NoobFukaire> I poll the keyboard slightly less than I advance our simulation code, and our simulation code updates 30 times per second [00:56:53] <MatthiasM2> the simpliest network approch was doom1/2 - it run at 35HZ and exchanged all keyboard events from each player every frame [00:57:38] <MatthiasM2> eg: get input, send input to all (broad cast), receive input from all other players, compute game updates, render, update music [00:58:45] <MatthiasM2> modern games decouple network from rendering and use prediction and history to compensate lag [01:00:03] <MatthiasM2> eg in an FPS - you aim at something and shoot - it takes a few ms to get that to the server via internet - the server remembers where each player has been in the last ~second and computes the hit for the time the player shoot [01:00:43] <MatthiasM2> local interpolation is used to make the movement of other players smoother [01:26:20] *** Diablo-D3 has joined #lwjgl [01:26:24] *** cracoucas83 has quit IRC [01:31:14] <NoobFukaire> I've been debating putting simulation and input polling in the same service (and thus thread) [01:31:33] <NoobFukaire> mainly because right now I lock the entire scene to do input, so I lock once for sim and once for input [01:31:37] <NoobFukaire> which is probably overkill [01:32:17] <NoobFukaire> but since they update so infrequently compared to something like the renderer, which may run as fast as it can if vsync isn't enabled, I haven't had a practical reason to change it [01:58:34] *** krumholt_ has quit IRC [02:03:40] *** Diablo-D3 has quit IRC [02:19:23] *** Diablo-D3 has joined #lwjgl [02:41:53] *** delt0r has quit IRC [02:55:21] *** delt0r has joined #lwjgl [02:58:15] *** OrangyTang has left #lwjgl [03:35:15] *** darkfrog has quit IRC [04:18:53] <NoobFukaire> http://www.youtube.com/watch?v=F04Z_Cw_nfs&feature=fvw [04:18:55] <NoobFukaire> what a bad ass [04:41:50] *** jweyrich has joined #lwjgl [05:12:47] *** jweyrich has quit IRC [08:37:19] *** MatthiasM2 has quit IRC [09:10:45] *** tametick has joined #lwjgl [09:16:30] *** indeterminatus has quit IRC [09:44:31] <Mazon> morning [09:59:27] *** indeterminatus has joined #lwjgl [10:42:17] *** delt0r has quit IRC [10:47:55] *** MatthiasM has quit IRC [10:47:59] *** MatthiasM has joined #lwjgl [10:55:45] *** tametick has quit IRC [10:55:55] *** delt0r has joined #lwjgl [12:08:31] *** Jari0001 has joined #lwjgl [12:48:44] *** betel has joined #lwjgl [12:51:37] <lwjglbot> lwjglforum: Re: Suggestions and questions <http://lwjgl.org/forum/index.php/topic,3224.msg17863.html#msg17863> [13:21:37] *** kulpae has joined #lwjgl [13:21:37] *** kulpae has joined #lwjgl [13:21:38] <lwjglbot> lwjglforum: Re: xRandR and dual screens <http://lwjgl.org/forum/index.php/topic,3225.msg17864.html#msg17864> [13:56:14] *** jonkri has joined #lwjgl [13:56:19] *** cezer0 has joined #lwjgl [13:58:53] *** Dragonene has joined #lwjgl [14:00:33] <Dragonene> !seen xNotch [14:00:33] <lwjglbot> Dragonene: xNotch was last seen in #lwjgl 3 weeks, 1 day, 15 hours, 43 minutes, and 24 seconds ago: <xNotch> seems it fit perfect for minecraft [14:00:38] <Dragonene> aw [14:13:43] *** betel has quit IRC [14:18:35] <cezer0> bah, TWL docs state alt is a valid key for input mappings, but in the code for KeyStroke, only shift, ctrl and meta are defined... [14:19:21] *** tametick has joined #lwjgl [14:31:59] *** darkfrog has joined #lwjgl [14:35:45] *** Schnitter has joined #lwjgl [15:01:27] <cezer0> I'm beginning to think that ActionMap actions are only valid for widgets with keyboard focus and not as a general way to a "global" command (like toggle FPS) to an app [15:07:25] <cezer0> nvm, apparently the "-defaults" theme isn't applied by default to all widgets... [15:13:54] *** rhk has joined #lwjgl [15:27:08] *** cezer0 has quit IRC [15:32:54] *** cezer0 has joined #lwjgl [15:36:17] <cezer0> ouch.. changing the resolution of my lwjgl app crashed this box... works fine on my home PC. This work machine must have craptastic drivers [15:46:16] *** betel has joined #lwjgl [15:55:28] *** NoobFukaire1 has joined #lwjgl [16:15:20] *** indeterminatus has quit IRC [16:15:25] *** Jari0001 has quit IRC [16:18:43] *** Jari0001 has joined #lwjgl [16:21:53] <lwjglbot> lwjglforum: Re: xRandR and dual screens <http://lwjgl.org/forum/index.php/topic,3225.msg17866.html#msg17866> || Re: Suggestions and questions <http://lwjgl.org/forum/index.php/topic,3224.msg17865.html#msg17865> [16:49:53] <cezer0> Matthias, you around? [17:03:19] *** tametick_ has joined #lwjgl [17:03:58] *** tametick has quit IRC [17:27:02] *** NoobFukaire has quit IRC [17:27:09] *** NoobFukaire1 is now known as NoobFukaire [17:27:19] *** NoobFukaire1 has joined #lwjgl [17:42:08] *** betel has quit IRC [17:43:36] *** betel has joined #lwjgl [17:44:22] *** carneades has joined #lwjgl [17:44:58] *** doohan has joined #lwjgl [17:45:17] *** daN-R-G has joined #lwjgl [17:45:39] *** carneades has left #lwjgl [17:45:44] *** carneades has joined #lwjgl [17:56:12] *** carneades has left #lwjgl [18:00:13] *** Dragonene has quit IRC [18:03:05] *** Core-Dump has joined #lwjgl [18:18:18] *** MatthiasM2 has joined #lwjgl [18:19:08] *** Diablo-D3 has quit IRC [18:22:37] <MatthiasM2> cezer0: yes [18:35:14] <MatthiasM2> cezer0, cezero: ALT key is now supported [18:40:52] <cezer0> :) [18:42:16] *** delt0r has quit IRC [18:44:47] <cezer0> what is the best way to set the width of an editfield? I tried calling setSize() and that didn't seem to work [18:45:15] <MatthiasM2> you could set a minWidth in the theme [18:45:29] *** doohan has quit IRC [18:45:32] <MatthiasM2> or the "columns" field [18:46:11] <cezer0> columns is in 'characters' ? ie: columns 5 equals a field that will hold 5 characters? [18:46:43] <MatthiasM2> http://hg.l33tlabs.org/twl/file/cefe1c8066a5/src/de/matthiasmann/twl/EditField.java#l172 [18:47:12] <cezer0> gotcha [18:49:46] *** ZeuPiark has joined #lwjgl [18:51:13] <cezer0> I guess the theme is the best place to do this, but I'm curious why EditField.setColumns() doesn't seem to work? What if I want to size an EditField via code for some reason? [18:51:38] <MatthiasM2> because the theme overrides that value? [18:52:28] <cezer0> I see. so theme > code always? [18:52:41] <MatthiasM2> except in a few special places [18:53:11] <cezer0> so to have a dynamically sized editfield, I'd need to assign it a theme that didn't set columns.. then I could set it via code? (hypothetically, not sure that I really want to do that) [18:53:41] <MatthiasM2> no - doesn't work: http://hg.l33tlabs.org/twl/file/cefe1c8066a5/src/de/matthiasmann/twl/EditField.java#l317 [18:54:09] <cezer0> lol, gotcha.. if no theme, then it'll be 5 [18:54:22] <MatthiasM2> you would have to subclass EditField and overwrite column ... [18:56:00] <cezer0> there's no way to set columns after applyTheme runs? I would have thought applyTheme would get called once when the widget is created... but then any calls to setColumns() etc after that would override the theme. [18:56:05] *** delt0r has joined #lwjgl [18:56:49] <ZeuPiark> hello [18:58:00] <cezer0> what's the point of the setColumns() function if the theme will always over-ride it? (just trying to understand the logic) [18:58:36] <MatthiasM2> not sure if you ask so direct :( [18:58:42] <cezer0> lol [18:58:59] <MatthiasM2> ahh - so that you can overwrite applyTheme :P [18:59:24] <cezer0> not trying to be a pain in the ass, just trying to wrap my head around it so I can better understand the toolkit. [19:00:31] <cezer0> when does applyTheme() get called? [19:01:12] <MatthiasM2> a) on GUI.applyTheme b) on addChild() when the parent is in the GUI tree (eg getGUI != null) and GUI has a theme [19:01:22] <MatthiasM2> and only if the theme is != "" [19:02:10] <cezer0> ah, so if I called setColumns() after adding it? [19:02:30] <MatthiasM2> yep - but the next GUI.applyTheme will change it back [19:03:43] <rhk> I would have thought that the number of columns is a data model thing, not a presentation thing. [19:04:05] <cezer0> Matthias: other than explicitly, when would GUI.applyTheme get called? [19:04:07] <MatthiasM2> it's not the max text length - only the value to compute the prefered width [19:04:19] <MatthiasM2> cezer0: never [19:04:53] <cezer0> ok, so if I setup my gui, add all my widgets, set the themes etc. and then make my calls to setColumns() and other related functions, it should work out ok :) [19:05:12] <MatthiasM2> until you switch your screen resolution [19:05:18] <cezer0> right :) [19:05:23] <MatthiasM2> as you have a call to applyTheme in there :DD [19:07:31] <cezer0> ok, I think I'm going about this wrong anyway... I just did a setColumns after the add etc, and it worked fine. However, I noticed something else.. I have to editfields in a vertical group, and both of them ended up with the new column width.. I assume this is because the second one was expanded to fill the space created by the first. This leads me to believe that I really should be somehow setting the width of the container in [19:07:41] <cezer0> s/to/two/ [19:08:23] <MatthiasM2> well - I assume you used a Dialoglayout with a parallel group for vertical or a vertical BoxLayout ? [19:08:35] <cezer0> DialogLayout [19:08:59] <MatthiasM2> if you want the EditFields with different width you can add a gap after the edit field in a sequential horizontal layout [19:09:14] <cezer0> I actually don't want that, but I understand what you are saying [19:09:30] <MatthiasM2> also when you add a gap in a parallel vertical group you can use this to force a width on the other widgets in that group [19:09:42] <MatthiasM2> *parallel horizontal [19:09:44] <cezer0> I'm constructing a login dialog.. username/password.. I'd like them both the same length [19:10:07] <MatthiasM2> yeah - then either set a minWidth or add a named gap [19:10:22] <cezer0> oh, so if I added another, empty row, with various gaps in the right places, it would force the EditFields to grow to match the gap size? [19:10:34] <MatthiasM2> no - you don't need an empty row [19:10:51] <MatthiasM2> you can just add the named gap in the parallel horizontal group [19:11:32] <MatthiasM2> eg: setHorizontal(createParallelGroup().addWidget(ef1).addWidget(ef2).addGap("ef-size")) [19:12:52] <cezer0> ok, so I'm misunderstanding how gaps work... I assumed they were packed in like another (empty) widget.. [19:13:18] <MatthiasM2> yes - but as they are not widgets - they don't have to appear in both groups [19:13:28] <MatthiasM2> eg you can add a gap where you want [19:13:36] <cezer0> to be honest, the whole layout/grouping mechanism is confusing to me.. I've gotten it working based on the examples, but don't really understand it that well [19:13:54] <MatthiasM2> hmm [19:15:58] <cezer0> I kind of pictured it like an HTML table... with horizontal groups being the <td> and vertical groups being the <tr> ... [19:16:16] <cezer0> and gaps being placeholders where you needed to push an empty cell to make stuff line up [19:17:12] <MatthiasM2> ok - for your login screen it would be like this: http://lwjgl.pastebin.com/qJ7455rL [19:17:32] <MatthiasM2> a table is a grid - it's more restrictive then these groups [19:18:38] <MatthiasM2> eg elements in a horizontal parallel group - like the edit fields - don't have to be consecutive in the vertical - you could eg have a list box between them which consumes the complete width [19:18:41] <cezer0> yes, this appears much more powerful, which is probably why it's more confusing :) [19:19:13] <cezero> hey cezero, shouldn't you be working? [19:19:27] <cezer0> lol [19:19:31] <MatthiasM2> ?!? [19:19:43] <cezer0> Cezer0 = me at work. Cezero = me at home [19:19:48] <cezer0> my wife must be at my computer at home [19:19:53] <cezero> sorry, his wife at his home computer saw he was slacking at work [19:20:17] <MatthiasM2> hehe [19:23:21] <cezer0> so beyond being a convienience for grouping widgets, parallel groups also share a size? ie: all elements in a parallel group will grow to be the same size if possible? [19:46:26] *** indeterminatus has joined #lwjgl [19:49:46] <MatthiasM2> yes [19:51:50] *** kappaOne has joined #lwjgl [20:10:42] *** Dragonene has joined #lwjgl [20:14:53] *** Core-Dump has quit IRC [20:21:03] *** betel has quit IRC [20:22:18] <lwjglbot> lwjglforum: Re: xRandR and dual screens <http://lwjgl.org/forum/index.php/topic,3225.msg17867.html#msg17867> [20:32:13] *** ZeuPiark has quit IRC [20:34:03] <tametick_> my university has such attractive special deals on macbooks! only slightly more expensive than buying directly from apple :/ [20:34:19] <NoobFukaire> sounds like a university [20:41:00] *** indeterminatus has quit IRC [20:46:26] *** Jari0001 has quit IRC [20:54:48] *** appel has joined #lwjgl [21:04:59] *** ZeuPiark has joined #lwjgl [21:24:54] *** betel has joined #lwjgl [21:38:27] * Mazon shakes fist as PS3 [21:38:54] <NoobFukaire> http://www.datacenterknowledge.com/archives/2010/03/01/punked-in-the-data-center/ [21:45:22] <ZeuPiark> bye bye ! [21:45:26] *** ZeuPiark has quit IRC [21:46:47] <MatthiasM2> good promotion [22:01:33] <cezer0> Matthias: I have an ActionMap setup on my root widget, which works fine as long as no EditField has focus. However, if an EditField has focus, the key-combo for the ActionMap never gets through to the root widget. [22:01:55] <MatthiasM2> which key combi? [22:01:58] <cezer0> ctrl F [22:02:11] *** uggwar has joined #lwjgl [22:02:35] <cezer0> using it to toggle the FPS indicator. I'll change it to alt F once I upgrade to your latest code :) [22:03:30] <MatthiasM2> ups [22:03:40] <MatthiasM2> let me fix that ... [22:07:25] <uggwar> according to visualvm, my application is spending approx. 30% of its time in glPopMatrix... this just seem weird [22:07:46] <MatthiasM2> cezer0: fixed [22:07:51] <NoobFukaire> don't use the stack unless you have to [22:08:20] <MatthiasM2> uggwar: assuming your code is faster then your GPU - then it will wait somewhere [22:09:02] <MatthiasM2> but you should just do all matrix math using nice and easy to use Java classes and upload the matrix using glLoadMatrix [22:09:03] <uggwar> sounds possible. i am now on a terrible laptop with a intel gpu and a fast cpu [22:09:10] <MatthiasM2> heh [22:09:27] <uggwar> that might explain it :-) [22:10:05] <uggwar> so using the opengl stack is "forbidden" outside simple examples? [22:12:01] <MatthiasM2> no - it's just that the stack model is too restricted for more complex things [22:12:11] <MatthiasM2> as you can only modify and access the TOS [22:12:43] <MatthiasM2> but when you use matrix objects you can compute & combine like you want - and keep as many precomputed matrices around [22:12:43] <uggwar> sorry for my ignorance... TOS? [22:12:50] <MatthiasM2> top of stack [22:12:51] <cezer0> Top of Stack [22:12:52] <uggwar> true [22:12:58] <uggwar> thanks :) [22:13:11] <uggwar> yes, this makes sense [22:13:39] <MatthiasM2> also the OGL matrix stack is not HW accelerated anyway - it might use SSE etc but the JNI overhead will compensate for that :/ [22:15:00] <uggwar> i am also struggeling to get my übersimple game to run as fast as my c++ code. 40% tells me i am doing something wrong in java [22:15:22] <MatthiasM2> do you allocate JNI buffers per frame? [22:15:34] <MatthiasM2> also which LWJGL version do you use? [22:15:42] <uggwar> 2.3 [22:15:45] <MatthiasM2> good [22:16:16] <uggwar> i think i lack a bit of knowledge to pinpoint the problem atm [22:16:38] <uggwar> not sure. what can allocate JNI buffers? :) [22:18:39] <uggwar> its just a simple layer based tile engine, sorting its sprite per texture (using texture sheets) [22:18:54] <uggwar> not doing any fancy [22:19:07] <MatthiasM2> BufferUtils.create* [22:19:19] <MatthiasM2> Byte/FloatBuffer.allocateDirect [22:19:32] <MatthiasM2> how about pasting code [22:20:31] <uggwar> i could make my project not private at bitbucket.org. give me a sec :) [22:21:20] <uggwar> http://bitbucket.org/uggwar/papercut/ [22:21:33] <uggwar> please don't make fun of me ;) [22:21:53] <MatthiasM2> where is the GL code? [22:22:24] *** jrz has joined #lwjgl [22:22:55] <uggwar> main loop: http://bitbucket.org/uggwar/papercut/src/tip/src/org/uggsoft/papercut/core/Kernel.java [22:23:10] *** cezer0 has quit IRC [22:23:27] <uggwar> gfx: http://bitbucket.org/uggwar/papercut/src/tip/src/org/uggsoft/papercut/graphics/ [22:23:41] <MatthiasM2> uggwar: in Render.java you use the map very inefficient [22:24:07] <MatthiasM2> instead of iterating over the keySet and using get() - iterate over entries [22:24:46] <uggwar> hey, thanks! i will fix this and see what is does [22:24:51] <NoobFukaire> I wouldn't really even use a map there [22:25:01] <MatthiasM2> also - you should not use the GL IDs as keys [22:25:49] <MatthiasM2> when you make your Texture an object - then you can just the object to store related data [22:26:57] *** Schnitter has quit IRC [22:28:48] <uggwar> ok, i guess i did notice the performance drop after the layer implementation [22:30:10] <kappaOne> hmm, starcraft 2 cracked with AI :) [22:30:56] <MatthiasM2> ? [22:31:12] <uggwar> thanks. i will look into your advice and see if i can fix this [22:32:29] *** betel has quit IRC [22:41:30] <uggwar> i just removed the layering system and did the same kind of iterative rendering as the c++ code, and now i have a far better framerate than c++ [22:41:38] <uggwar> something bogged it down completely... [22:41:55] <uggwar> and i have to redesign how i sort my sprites per texture... [22:42:03] <MatthiasM2> probably you created many objects with that kind of map iteration [22:42:32] <MatthiasM2> sprite.getTexture().addToQueue(sprite); [22:42:48] <MatthiasM2> for(Texture t : textures) { t.renderQueue(), t.clearQueue(); } [22:42:54] <uggwar> yes, something like that [22:43:09] <MatthiasM2> no map at all - just a few lists [22:43:22] <uggwar> lean and mean :) [22:43:25] <uggwar> thanks! [22:43:59] <uggwar> can you believe how many who have dropped java because of ignorance?! [22:45:44] <MatthiasM2> :) [22:46:17] <MatthiasM2> do you need an UI toolkit ? [22:47:11] <uggwar> yes, my bet is on twl ;) [22:47:19] <MatthiasM2> :P [22:47:22] <uggwar> hehe [22:47:31] <MatthiasM2> how come you knew that? [22:47:47] <uggwar> looked and fenggui first, but decided on twl [22:48:06] <MatthiasM2> cool :DD [22:48:57] <uggwar> google search landed me on some irc-log of #lwjgl 1. january [22:49:13] <uggwar> happened to see your nick talking about twl [22:49:19] <uggwar> so i checked it out [22:49:21] <uggwar> looks nice! [22:49:46] <uggwar> i was terrified that i had to make something on my own... [22:50:25] <MatthiasM2> :) [22:50:41] <uggwar> that is a LOT of work! [22:51:11] <uggwar> when i get to UI, i can use the latest and become a tester if you like [22:51:29] <MatthiasM2> sure [23:35:04] *** NoobFukaire has quit IRC [23:40:01] *** Dragonene has left #lwjgl [23:40:43] *** uggwar has quit IRC [23:45:19] *** betel has joined #lwjgl [23:54:30] *** jrz has quit IRC [23:54:44] *** rhk has quit IRC [23:54:57] *** rhk has joined #lwjgl