Switch to DuckDuckGo Search
   December 10, 2013  
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | >

Toggle Join/Part | bottom
[00:00:15] <jezek2> technically the implementation can do anything (like never deallocating :P) to meet the specs
[00:01:02] <ra4king> huh, that's cool i guess
[00:01:05] <jezek2> in fact I've had such situation where I handled improperly files and not closing them, thinking the GC would do it for me... yet the program (simple IRC bot) was too simple for GC to kick in in any reasonable amount of time
[00:01:11] <jezek2> so it ran out of file descriptors :P
[00:01:12] <jezek2> always
[00:01:31] <ra4king> also pretty interesting that the GC kicked in at the 90589th loop to cause the WeakReference to be null heh
[00:02:15] <jezek2> I would say that because nothing else was triggering the GC it just did it after some timeout or something
[00:02:55] <jezek2> but it's not guaranteed to behave this way, see my example :)
[00:03:18] <jezek2> depends also on what other threads are doing
[00:03:31] <ra4king> of course
[00:06:03] *** ksclarke has quit IRC
[00:24:06] *** devnewton has quit IRC
[00:24:50] *** mr_monty has joined #lwjgl
[00:24:55] <mr_monty> http://pastebin.com/Bb7hWWhY
[00:24:59] <mr_monty> interesting
[00:25:06] <mr_monty> from my 1/2 assed assessment
[00:25:14] <mr_monty> I'm thinking rvals aren't considered strong
[00:25:21] <mr_monty> and neither are arguments
[00:26:27] <mr_monty> null & java.lang.Object@cafebabe1234 is displayed
[00:26:42] <mr_monty> f' me
[00:26:47] <mr_monty> I wonder if it will work under ibm j9
[00:26:57] <mr_monty> seems like this could be very jvm dependent
[00:27:19] <jezek2> nope, the second version is basically identical to the first one
[00:27:33] <jezek2> it would be different if you would use x after passing it to the method
[00:27:44] <jezek2> try putting it into a println for example
[00:27:55] <mr_monty> then why am I getting different results
[00:27:56] <mr_monty> the only difference is that the first is an rval object
[00:28:32] <mr_monty> I would think that the first would be attached in main's stack frame
[00:28:32] <mr_monty> for sure the second is explicit
[00:28:40] <jezek2> internall rval is set to some local variable/register, and passed as the parameter, you see it's the same code
[00:28:43] <jezek2> :)
[00:28:51] <mr_monty> in either case, method's "o" doesn't hold it
[00:29:06] <jezek2> you need to use x after passing it
[00:29:15] <jezek2> to enforce it
[00:29:28] <jezek2> or storing it into a static field
[00:29:33] <mr_monty> the second works as expected
[00:29:44] <mr_monty> because it's explicity assigned
[00:29:46] <jezek2> ah you print it
[00:30:06] <mr_monty> I'd expect both to return the created object
[00:30:11] <mr_monty> to be printed
[00:30:17] <jezek2> that's interesting, but it doesn't prove anything
[00:30:34] <mr_monty> perhaps
[00:30:46] <mr_monty> definitely learning a bit more about behavior
[00:30:50] <jezek2> yeah
[00:31:03] <jezek2> however try changing to a different GC algo
[00:31:04] * ra4king kills mr_monty
[00:31:11] <jezek2> it could be totally different
[00:31:17] <jezek2> even withing the same JVM :)
[00:31:22] <mr_monty> exactly
[00:31:39] <mr_monty> for the sake of argument
[00:31:50] <mr_monty> suppose oracle jdk says, rvals aren't considered strong
[00:32:01] <jezek2> simply put the way you're trying to use weakreferences is against the specs, no matter what black magic you find to "make it work"
[00:32:02] <mr_monty> is this guarnteed on another jvm?
[00:32:03] <mr_monty> if not, I'm f'ed
[00:32:11] <mr_monty> bingo
[00:32:26] <mr_monty> truly a black box
[00:32:27] <jezek2> the thing is that they're strong... as long as you don't mix in weak references it's all behaving like expected
[00:32:33] <jezek2> but the interaction with them breaks that
[00:32:41] <jezek2> so it might appear that it's not strong
[00:32:47] <ra4king> mr_monty: I built a similar test to and noticed the same thing as you
[00:32:55] <ra4king> sometimes ref.get() becoming null
[00:32:57] <ra4king> that is strange indeed
[00:33:07] <jezek2> I don't recommend to use weakreference unless you truly know what are you doing
[00:33:17] <jezek2> and never use softreference it's bad by design
[00:33:24] *** BlueThen has joined #lwjgl
[00:33:24] <mr_monty> from my pov the method's stack frame has the object assigned - and was assuming that it was strong.
[00:33:38] <mr_monty> perhaps on a different jvm that would be true
[00:33:42] <jezek2> like I know why they tried to introduce it, but it just can't work in practice that way...
[00:33:43] <mr_monty> but it seems there are no guarantees
[00:34:01] <mr_monty> well
[00:34:01] <mr_monty> that was edifying
[00:34:06] <mr_monty> terribly dissappointing :P
[00:34:06] <mr_monty> and at the same time
[00:34:51] <jezek2> hehe
[00:35:19] <jezek2> yeah I think I had similar evaluation of such things, more how it interacts with reference queues or something
[00:35:38] <jezek2> and also with interfaces... get these right took me some time when I was new to java :)
[00:35:56] <jezek2> like realizing that I can use interface isntead of class :D
[00:36:02] <jezek2> at it's usage
[00:36:11] <jezek2> and exceptions :D
[00:36:14] <jezek2> that was longer...
[00:37:32] <jezek2> mostly realizing that checked exceptions are bad concept (problems with deciding what exceptions are to be checked or not, that depends highly on context, and problem with throwing them across some common API that don't count with them and realistically it can't even... like collections), not having them is not ideal either though but seems lesser evil
[00:38:22] <jezek2> in some of my projects I use throws Exception and it truly seems right to do (in a web app)
[00:38:31] *** mr_monty has quit IRC
[00:41:13] <ra4king> if you run the example in the debugger instead of standard server java, then you'll never get null :)
[00:42:21] *** Htbrdd has joined #lwjgl
[00:44:31] *** mr_monty has joined #lwjgl
[00:44:33] <mr_monty> damn
[00:45:00] <mr_monty> I though the java stack frame is augmented with reference information.
[00:45:00] <jezek2> well this is when some system is not using deterministic approach (GC)... with ref counting you would always end up with getting null right after you created the weak reference :)
[00:45:04] <mr_monty> something like "oop" map or something.
[00:47:10] <jezek2> well as I said you would have to modify it to print x directly, not getting it as a result from weak reference
[00:47:26] <jezek2> because you basically stops using that reference right before passing it into the function
[00:49:15] <mr_monty> I'm thinking the reason I don't null and it behaves as I expect is because x is strong
[00:50:04] <MatthiasM> mr_monty: why are you even using WeakReference?
[00:50:06] <jezek2> by spec both cases are identical
[00:50:29] <jezek2> it's just an implementation detail that it's held in the second case
[00:50:29] <mr_monty> but yet I get two different answers
[00:50:41] <jezek2> it's not something you can't count on
[00:50:45] <mr_monty> indeed
[00:50:53] <jezek2> maybe switching to different GC algo will change that observation
[00:50:57] <mr_monty> that seems to be the conslusion that I'm coming to
[00:51:21] <jezek2> you can't conclude anything by measuring non-deterministic systems (GC in this case)
[00:51:24] <MatthiasM> it is likely that compiling the method changes which objects are retained
[00:51:57] <jezek2> oh yeah that too
[00:52:08] <jezek2> you can try running it in interpreted mode :)
[00:53:15] *** ruben01 has quit IRC
[00:55:53] *** DrShoggoth has quit IRC
[00:58:56] <mr_monty> figure that java knows which variables are allocated locally, I'm wondering when determining reachability, it looks at the explicitly declared stack frame. Given that an rval is just pushed on after the fact.
[00:59:06] <mr_monty> at any rate.
[00:59:09] <mr_monty> moral of the story
[00:59:43] <mr_monty> many factors influence reproducibility
[01:01:57] <jezek2> well it's like using and relying on undefined behavior in C, it's certainly more deterministic to certain version of compilator (usually) but will break sooner or later
[01:02:25] <jezek2> I don't think trying to reproduce anything in a code that rely on undefined behavior is meaningful
[01:03:39] <mr_monty> it's quite meaningful
[01:03:42] <mr_monty> it demonstrates that you can't count on it
[01:03:53] <mr_monty> it's most likely implementation specific
[01:04:15] <mr_monty> be interesting if I run it under ibm j9 that I'd get both objects returned.
[01:04:30] <ra4king> mr_monty: if you run the example in the debugger instead of standard server java, then you'll never get null :)
[01:04:40] <jezek2> that's bad approach, you have to follow spec to determine that... because it might be that the implementation(s) you're using would work, yet in newer version or another implementation would silently break that
[01:04:43] <ra4king> just like you said
[01:04:59] <mr_monty> no, actually it's fine
[01:05:18] * ra4king noms mr_monty
[01:05:33] <mr_monty> jezek2: I think we're violently agreeing
[01:06:03] <jezek2> hehe
[01:09:21] *** bluethen2 has joined #lwjgl
[01:10:12] *** BlueThen has quit IRC
[01:10:29] <jezek2> I always prefer less undefined behavior than more... it's then less surprising (but goes against optimization...)
[01:11:32] <jezek2> if java had guarantee to hold the params during the duration of the method call it would work as intended, but still not really anything it would solve really... this is not good usage of them
[01:11:35] *** bluethen2 is now known as BlueThen
[01:11:59] <jezek2> or things like shifting... the modulo behavior is quite surprising to many programmers
[01:13:02] <jezek2> in my lang I've decided to do the "clamping" version instead... doesn't matter when it's shifted by a constant, takes some performance hit when it's variable, but it's always working as intended
[01:13:16] <jezek2> however I expect surprised when someone ports code from/to C :P
[01:13:27] <jezek2> *surprises
[01:14:22] <ra4king> goddamn I'm bored
[01:14:24] <ra4king> and tired
[01:14:26] * ra4king sleeps
[01:15:07] <jezek2> though the majority of usages don't exceed the range so maybe nobody will find that out except for some crypto code where the modulo shifting is used I think
[01:17:41] *** Dashiva has quit IRC
[01:20:35] *** Dashiva has joined #lwjgl
[01:22:11] <ra4king> jezek2: what are you working on these days by the way?
[01:22:20] <ra4king> jezek2: what happened to that FPS you were working on?
[01:22:40] <ra4king> jezek2: and also to your ambitions for a fast software rasterizer
[01:25:20] <jezek2> we're working on the FPS, we've spent this year mostly starting a business to fund the development of it, that went well and are working more again on it
[01:26:01] <jezek2> I already have a fast SW renderer, but it's obviously a low priority so I work on it only some times
[01:26:02] *** bgilb has joined #lwjgl
[01:28:39] <jezek2> I use it also for experimenting with SSE2 vectorized code and/or multicore processing
[01:28:42] <jezek2> :)
[01:30:34] *** mr_monty has quit IRC
[01:32:21] <ra4king> jezek2: whoa there's a "we" now!
[01:32:29] <ra4king> who else is working on it? I always thought it was just you
[01:33:30] <jezek2> that's quite old news that we're two :)
[01:33:32] *** djdduty has joined #lwjgl
[01:33:52] <ra4king> jezek2: ah, who's the other person?
[01:33:55] *** GoldenGates has joined #lwjgl
[01:33:58] <GoldenGates> Hi.
[01:34:03] <ra4king> GoldenGates: hello!
[01:35:50] <jezek2> ra4king: he was originally just an audio guy, but realized he likes mapping/modelling/texturing too :P
[01:36:13] *** md_5- has quit IRC
[01:36:24] <jezek2> so I focus mostly on the code and the overall vision
[01:36:44] <jezek2> also spend some time improving the tools for both him and our modding community
[01:38:57] <jezek2> still one biggie more is ahead for me... upgrading the model export script written for blender 2.49b to work with 2.6x
[01:39:21] <jezek2> and convert all blend files (well basically just the human model) to 2.6x
[01:41:29] <jezek2> and most likely contributing a patch to blender to fix one issue that affects me, and probably writing also a plugin that gives back the fast switching between modes that was in previous versions, as it's just too powerful to not use anymore :)
[01:41:56] *** Guest57919 has quit IRC
[01:42:08] <jezek2> but I will see how much I will be motivated to do that, at least blender's code is very readable unlike some other projects ;)
[01:43:47] <GoldenGates> I started lwjgl like 6 months ago, but I found it too confusing, giving it another shot this time.
[01:44:05] <jezek2> you mean opengl itself being too confusing :)
[01:44:06] <GoldenGates> Is there an API for it?
[01:44:33] <GoldenGates> So is there an API/docs for lwjgl?
[01:44:36] <jezek2> sure
[01:44:36] *** BlueThen has quit IRC
[01:44:46] <jezek2> but for any opengl specific things go to opengl.org or other sites
[01:45:20] <GoldenGates> I'm just referring to 2D rather than 3D as of now.
[01:45:26] <jezek2> doesn't matter
[01:45:41] <jezek2> if you're into 2d consider using some existing library such as slick or libgdx
[01:46:12] <GoldenGates> It doesn't seem like what I really wanted. :/
[01:46:23] <jezek2> what you want? :)
[01:46:31] <GoldenGates> All I actually need for my project is multi-threading between a lot of 2D images.
[01:46:39] <GoldenGates> So animations/states/etc.
[01:46:42] <jezek2> what does it even mean?
[01:46:52] <GoldenGates> Eh, lemme try rephrasing that.
[01:47:22] <GoldenGates> Wait does Slick2D work with lwjgl?
[01:47:36] <jezek2> yes on top of it
[01:47:42] *** Gooogy has quit IRC
[01:48:08] <GoldenGates> http://slick.ninjacave.com/javadoc/ is what you mean right?
[01:48:13] <GoldenGates> Assumed there was something like that for lwjgl.
[01:48:25] <jezek2> lwjgl is just opengl/al wrapper
[01:48:33] <jezek2> no specific functionality
[01:48:38] <GoldenGates> Yea sorry still new to this. :x
[01:49:02] <jezek2> either you use this low-level API directly, or you use some library that provides you API for a given task
[01:49:27] <jezek2> slick is a good option to use
[01:49:45] <GoldenGates> Yea looking at the docs now, is there any open source example of good use of animation?
[01:49:52] <jezek2> it provides implementation of all the mundane things and you can fully focus on your game :)
[01:49:56] <GoldenGates> Nothing overcomplicated, just want to see how it all works.
[01:50:44] <jezek2> maybe something in slick examples? or on forums
[01:51:08] <GoldenGates> I'll check Slick out, seems to have what I need based on looking at all the classes. :/
[01:51:11] <jezek2> also since you mentioned multi-threading... you don't need this at all for animations
[01:51:31] <jezek2> in fact it's totally normal that games operate just in single thread
[01:51:34] <GoldenGates> It's a lot of animations happening at once.
[01:51:40] <jezek2> (just to make sure you don't get bad idea from the start)
[01:51:52] <GoldenGates> I don't see how that'll work efficiently.
[01:51:55] <ra4king> FINALLY!
[01:51:59] <GoldenGates> What?
[01:52:10] <ra4king> THEY RELEASED A CLIENT PATCH FOR BF4!!
[01:52:15] <ra4king> WOOHOOOO
[01:52:16] <GoldenGates> Oh lol..
[01:52:40] <jezek2> GoldenGates: it will, threads are not some thing that makes things magically better, in fact they have their overheads and are error-prone to properly synchronize stuff
[01:52:51] <jezek2> GoldenGates: for having lot of tiny tasks they're totally unsuitable
[01:53:34] <jezek2> GoldenGates: most games (including AAA titles) are single threaded
[01:53:48] <jezek2> for good reasons
[01:54:18] <GoldenGates> I'll try it out and see how it goes then. :/
[01:54:41] <jezek2> calculating animations is something not computation heavy actually :)
[01:54:42] *** meoblast001 has joined #lwjgl
[01:55:26] <jezek2> and you need to process things in synchronous way anyway, using threading just complicates that for little, no, or even negative benefit
[01:57:05] *** l3dx has quit IRC
[02:00:06] *** md_5 has joined #lwjgl
[02:03:01] *** GoldenGates has quit IRC
[02:07:59] *** md_5 has quit IRC
[02:14:04] *** MMuse has quit IRC
[02:15:12] *** MachineMuse has joined #lwjgl
[02:30:59] <monty_hall1> sup
[02:31:08] *** monty_hall1 is now known as monty_hall
[02:31:19] <monty_hall> google doodle hopper and cobol
[02:31:27] <monty_hall> perhaps I should switch to cobol
[02:31:30] <monty_hall> :P
[02:40:36] *** Goddesen has quit IRC
[02:53:19] *** ZeuPiark has joined #lwjgl
[02:55:43] *** ksclarke has joined #lwjgl
[02:58:06] <monty_hall> whoa that is truly f'ed up
[02:58:17] <monty_hall> converting rvals to explicit assingments
[02:58:19] <monty_hall> all is well
[02:59:30] <monty_hall> I'm going to have to ask in the java forums. perhaps reachable from actual declared stack frame variables.
[02:59:49] <monty_hall> in that case rvals wouldn't work
[03:00:41] <monty_hall> I typically don't like to make explicit assignments - I'm mr. rval
[03:00:46] <jezek2> if you want to force it reachable put it into a ThreadLocal or static field (if you're sure it's called only from one thread at a time)
[03:00:55] <monty_hall> don't need to
[03:01:08] <jezek2> so how does the code looks now?
[03:01:57] <monty_hall> set.add(new Memo(blah, blah)) -> Memo am = new Memo(blah, blah); set.add(memo);
[03:02:15] <monty_hall> am unambiguously is strong
[03:03:07] <monty_hall> nothing has a strong ref to the rval in the first case
[03:03:26] <monty_hall> though it's on the stack
[03:03:28] <jezek2> am = memo I think?, I don't think it guarantees that though, the safes is to make sure it's used after that point
[03:03:49] <monty_hall> it's on the stack frame explicity declared
[03:04:38] <jezek2> in bytecode? still not sure if there wouldn't be a javac implementation that would covert it autoamtically to the first case
[03:05:37] <monty_hall> possibly the same however - it does have information about the stack frame as to what it's declared fields are - at least it knows what's a reference and what's a primitive.
[03:06:18] <monty_hall> the rval clearly wasn't declared in the stack frame
[03:06:35] *** ZeuPiark has quit IRC
[03:07:36] <jezek2> well still wouldn't be so sure, in any case add a comment to it describing why the code is as it is
[03:07:37] *** CharlieM75 has quit IRC
[03:07:45] <monty_hall> indeed
[03:08:43] *** CharlieM75 has joined #lwjgl
[03:08:52] <jezek2> have you tried both oracle's javac and eclipse's compiler at least? :)
[03:10:56] <jezek2> and somehow I have my doubts it will really help you with all the weakreferences... maybe there is some better overall design how to handle this?
[03:11:17] <jezek2> or maybe in that method use strong reference but only when you store it elsewhere use a weakreference?
[03:11:46] <jezek2> the design of this is really fishy no matter the behavior :)
[03:12:53] <jezek2> but of course I don't see into your problem much, and there are also other considerations like getting a quick dirty fix, esp. when they don't pay for anything more ;)
[03:13:31] <monty_hall> figure I would still have the same problem w/ java's weakhashmap
[03:13:42] <monty_hall> in fact, that's what I emulated to some extent
[03:13:46] <monty_hall> took the parts that I needed
[03:13:49] <monty_hall> and left the rest :P
[03:14:05] <monty_hall> the way I see it, if I can reclaim memory insitu w/o reinventing the wheel
[03:14:26] <monty_hall> it is good
[03:14:40] <monty_hall> in other words, for the smaller problems, I was manually cleansing the graph
[03:14:50] <monty_hall> essentially doing what th gc was doing
[03:15:37] <monty_hall> the problem with the original design is that what happens *during* the operation - I'd have to clean things up at the end where it's most likely to not finish because of memory problems.
[03:15:49] <monty_hall> small cases were a luxury
[03:16:25] <monty_hall> I feel, if I can get a grip on the semantics and have some assurances, I would rather use java's gc
[03:17:42] <jezek2> that GC does similar thing to yours doesn't mean you should use it instead, there is for example much less control over GC and it does it's job in unpredictable ways
[03:17:52] <monty_hall> I'm aware of that
[03:18:00] <monty_hall> when it decides to reclaim, I don't really care about
[03:18:54] <monty_hall> and now, I can write a cache - part 2
[03:19:02] <monty_hall> simple lru will suffice
[03:19:10] *** ra4king has quit IRC
[03:20:04] <jezek2> well I wish you good luck :)
[03:20:28] <jezek2> I did some similar things in the past too... in the end it was mostly these that I ended up rewritting :)
[03:22:10] <jezek2> and also learned to limit the non-determinism parts as much as possible... for example using LinkedHashMap in various cases, etc.
[03:24:42] <monty_hall> only use it when it's necessary
[03:24:46] <monty_hall> but only because I'm lazy
[03:24:52] <monty_hall> "Linked" too much typing XD
[03:25:39] <jezek2> well yeah
[03:25:59] <jezek2> mostly when I'm processing things in some order and it's undesirable to change that, or it's user unfriendly (eg. when processing files)
[03:26:13] <jezek2> or when it makes harder to compare different runs
[03:30:50] *** Irrelium has quit IRC
[03:31:03] *** Hanack has joined #lwjgl
[03:32:33] *** ra4king has joined #lwjgl
[03:32:38] *** ra4king has joined #lwjgl
[03:32:38] *** Hanack1 has quit IRC
[03:34:22] *** chuckles73 has quit IRC
[03:34:50] *** chuckles73 has joined #lwjgl
[03:36:14] *** CharlieM751 has joined #lwjgl
[03:38:56] *** CharlieM75 has quit IRC
[03:46:52] <monty_hall> http://www.nytimes.com/2013/12/10/world/spies-dragnet-reaches-a-playing-field-of-elves-and-trolls.html?_r=1&
[03:47:38] <monty_hall> fair number of terrorists hang out in second life :P
[03:57:28] *** CharlieM751 has quit IRC
[03:59:34] *** CharlieM75 has joined #lwjgl
[04:00:32] *** Htbrdd has quit IRC
[04:01:05] *** Htbrdd has joined #lwjgl
[04:28:52] <nbf> http://positech.co.uk/cliffsblog/wp-content/uploads/2013/12/gamespot_rect1.jpg
[04:28:53] <nbf> warning
[04:28:55] <nbf> NSFW
[04:36:04] <monty_hall> http://i.imgur.com/TOEvMJw.jpg
[04:36:29] <monty_hall> why isn't it nsfw?
[04:42:04] *** DrShoggoth has joined #lwjgl
[04:47:08] <monty_hall> damn network connection
[04:51:11] <monty_hall> dayum
[04:51:19] <monty_hall> sped my mdd up by a factor of 3 using weak references :P
[05:15:46] *** ra4king has quit IRC
[05:16:06] *** ra4king has joined #lwjgl
[05:16:42] *** meoblast001 has quit IRC
[05:24:09] <nbf> http://www.theguardian.com/world/2013/dec/10/canada-north-pole-claim
[07:15:37] *** ksclarke has quit IRC
[07:24:42] *** l3dx has joined #lwjgl
[07:28:30] *** l3dx has quit IRC
[07:28:30] *** l3dx has joined #lwjgl
[07:39:21] *** MatthiasM has quit IRC
[08:11:42] *** DroneZeRo has joined #lwjgl
[08:27:38] *** bmahe has joined #lwjgl
[08:27:42] *** bmahe has joined #lwjgl
[08:33:26] *** DroneZeRo has quit IRC
[08:46:47] *** devnewton has joined #lwjgl
[08:53:26] *** steve____ has joined #lwjgl
[08:58:48] <steve____> hello
[09:01:03] <steve____> is there some way to draw simple text strings in 2D (e.g. score) while simultaneously having 3d stuff going? (without a bunch of other libraries)?
[09:04:34] <jezek2> steve____: I think the simplest is to render your text into a BufferedImage and then upload it to opengl texture and show that on screen, it's not the most efficient approach but probably the simplest without need for 3rd party code or writing more complex font drawing routines
[09:05:22] <jezek2> for text that is changed only sometimes (not every frame) it's ok
[09:06:01] <jezek2> you still need to write the conversion routine though :)
[09:07:17] <steve____> what if I'm doing a FPS indicator, or heading/velocity/position, where I do want to update almost every frame?
[09:08:50] <jezek2> generating texture populated with individual characters and then rendering parts of it where you need is one of the classic approaches
[09:09:07] <MatthiasM2> steve____: TWL has all these features
[09:09:32] <steve____> i don't suppose someone's already made a nice png containing all the Unicode chars on 32x32 tiles?
[09:09:32] <MatthiasM2> it loads BMFont files (there is also an addon for TrueType fonts)
[09:09:39] <MatthiasM2> steve____: lol
[09:10:01] <steve____> with twl I'd have to use all TWL, right? including to do the 3D stuff?
[09:10:04] <MatthiasM2> the TWLThemeEditor can create a BMFont file from an TrueType font (TTF) with the characters you want
[09:10:12] <MatthiasM2> it has no 3D stuff
[09:10:17] <steve____> OK, i can probably make that work
[09:10:22] <MatthiasM2> you can use it just as an overlay over your 3D world for UI
[09:10:39] <steve____> OK that's what I need.
[09:10:43] <MatthiasM2> eg FPSCounter, chat windows, game messages
[09:12:16] <steve____> i see this code public void render() { Color.white.bind(); texture.bind(); // or GL11.glBind(texture.getTextureID()); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2f(0,0); GL11.glVertex2f(100,100); GL11.glTexCoord2f(1,0); GL11.glVertex2f(100+texture.getTextureWidth(),100); GL11.glTexCoord2f(1,1); GL11.glVertex2f(100+texture.getTextureWidth(),100+texture.getTextureHeight()); GL11.glTexCoord2f(0,1);
[09:12:26] <steve____> that is in the TestUtils.java
[09:12:52] <steve____> But I don't see quite where to put it in my 3D render section
[09:12:53] <MatthiasM2> ?
[09:13:22] <steve____> e.g. my current 3D code doesn't have "glBegin"
[09:14:48] <steve____> (so I'm not quite sure how to merge in this render example with the 3D quads etc rendering already happening.
[09:17:02] <MatthiasM2> what is TestUtils?
[09:17:21] <steve____> in package org.newdawn.slick.tests;
[09:17:37] <MatthiasM2> well - I don't use Slick - and I don't know your renderer
[09:17:42] <steve____> C:\Users\steve\Downloads\twl.zip\TWLExamples
[09:17:51] <MatthiasM2> but sounds like you need to learn a bit more about OpenGL :)
[09:18:04] <steve____> sorry I'm getting lib confusion at this point. that's slick not twl
[09:18:05] <MatthiasM2> you can ignore the Slick parts of the examples
[09:18:27] <MatthiasM2> (they should not even be in the TWLExamples repository)
[09:18:54] <steve____> private void renderCycle() { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); GL20.glUseProgram(pId); // Bind the texture GL13.glActiveTexture(GL13.GL_TEXTURE0); GL11.glBindTexture(GL11.GL_TEXTURE_2D, texIds[textureSelector]); // Bind to the VAO that has all the information about the vertices GL30.glBindVertexArray(vaoId); GL20.glEnableVertexAttribArray(0); GL20.glEnableVertexAttribArray(1); GL20.glEnable
[09:19:11] <steve____> i was looking at slick also (trying to pick a minimal lib to do this overlay stuff)
[09:19:27] <steve____> OK pasting code not working so good.
[09:19:58] <steve____> am I inserting the text overlay at the right place in render cycle?
[09:20:21] <steve____> please forget I mentioned slick
[09:21:45] <steve____> GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, vboiId); GL11.glDrawElements(GL11.GL_TRIANGLES, indicesCount, GL11.GL_UNSIGNED_BYTE, 0); //bugbug is this the right place for text overlays? GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); RenderTextOverlay();
[09:22:38] <steve____> (draw the 3d elements, then the 2d overlay)
[09:30:27] *** Guest19084 has joined #lwjgl
[09:31:04] *** Htbrdd has quit IRC
[09:31:14] <steve____> Is RenderTextOverlay() call in the right place to call drawString??
[09:32:57] <steve____> I mean is that the right place to call into twl renderer's Font.drawText()
[09:32:59] <steve____> ?
[09:34:35] <MatthiasM2> TWL rendering is done by creating a UI hierarchy (eg GUI -> your own root widget -> FPSCounter) - see GameUIDemo
[09:34:43] <MatthiasM2> and then calling gui.update()
[09:38:43] <steve____> that would be a pretty big change
[09:38:57] <MatthiasM2> why? it has no influence on the rest of your app
[09:39:17] <MatthiasM2> just insert the gui.update() between your rendering and Display.update()
[09:39:40] <MatthiasM2> if you don't want TWL to handle input pass a null Input object to the GUI constructor
[09:42:46] *** Guest19084 has quit IRC
[09:42:48] <steve____> OK I will give it a try that way. wish me luck! thanks for your help!
[09:56:37] <steve____> Ah, one more question...it seems to do this I would need to be a widget myself...must override layout, etc , like the demo does?
[09:57:38] *** md_5 has joined #lwjgl
[09:58:26] <MatthiasM2> your class does not need to extend Widget
[09:58:32] <MatthiasM2> you can just create an additional class
[09:58:45] <MatthiasM2> in the demos I just combined it all
[10:06:53] *** Unimatrix325 has joined #lwjgl
[10:07:43] *** md_5 has quit IRC
[10:11:01] *** md_5 has joined #lwjgl
[10:13:39] *** Me4502- has joined #lwjgl
[10:20:29] *** Htbrdd has joined #lwjgl
[10:43:54] *** md_5 has quit IRC
[10:57:45] <Grum> Did anyone submit 2.9.1 to the maven repos? ;D
[11:11:00] *** md_5 has joined #lwjgl
[11:15:52] *** md_5 has quit IRC
[11:28:08] *** bmahe has quit IRC
[11:35:52] *** md_5 has joined #lwjgl
[11:56:40] <monty_hall> hello
[11:57:09] *** md_5 has quit IRC
[12:13:58] *** md_5 has joined #lwjgl
[12:20:52] *** Sopheria has quit IRC
[12:33:41] *** Goddesen has joined #lwjgl
[12:40:04] *** agro_tablet_ has joined #lwjgl
[12:41:20] *** skos has joined #lwjgl
[12:42:15] *** agro_tablet has quit IRC
[12:42:16] *** skoskav has quit IRC
[12:42:18] *** agro_tablet_ is now known as agro_tablet
[12:46:14] *** skos is now known as skoskav
[13:12:35] *** Irrelium has joined #lwjgl
[14:04:56] <lwjglbot> lwjglforum: Re: Problem with texture edges <http://lwjgl.org/forum/index.php/topic,5264.msg28083.html#msg28083>
[14:07:29] *** Irrelium has joined #lwjgl
[14:12:36] *** mr_monty has joined #lwjgl
[14:12:38] <mr_monty> ahh finally
[14:12:49] <mr_monty> webchat went back to digit capchas
[14:13:17] <mr_monty> out of monster, had to purchase a rock star enety
[14:13:20] <mr_monty> too much caffiene
[14:13:29] <mr_monty> but I'll drink it anyways :P
[14:13:33] <mr_monty> sup
[14:36:23] *** lrh9 has joined #lwjgl
[14:38:23] *** djdduty has quit IRC
[15:00:36] *** ksclarke has joined #lwjgl
[15:03:39] *** CLT|Stiotic has joined #lwjgl
[15:03:43] <CLT|Stiotic> Hello
[15:05:16] <lwjglbot> lwjglforum: Re: Problem with texture edges <http://lwjgl.org/forum/index.php/topic,5264.msg28084.html#msg28084>
[15:05:52] *** CharlieM751 has joined #lwjgl
[15:07:40] *** darkfrog has quit IRC
[15:07:41] *** mononofu has quit IRC
[15:07:45] *** chuckles73 has quit IRC
[15:08:11] *** chuckles73 has joined #lwjgl
[15:08:19] *** CharlieM75 has quit IRC
[15:09:21] *** nbf has quit IRC
[15:13:02] *** mononofu has joined #lwjgl
[15:14:58] *** nbf has joined #lwjgl
[15:14:59] *** nbf has joined #lwjgl
[15:18:46] *** agro_tablet has quit IRC
[15:19:06] *** agro_tablet_ has joined #lwjgl
[15:22:21] *** darkfrog has joined #lwjgl
[15:35:26] <mr_monty> hmm, coworker in germany has "dritter advent" on his calendar
[15:36:02] <mr_monty> isn't advent mostly associated with catholics?
[15:36:56] <mr_monty> damn, he's got them all
[15:37:04] <devnewton> I am not catholic, but I love advent calendar
[15:37:33] <devnewton> chocolate can be seen as a cool religion
[15:39:54] <mr_monty> was never a catholic or other type of pagan mary worshipping religions
[15:39:55] <mr_monty> :P
[15:39:56] <mr_monty> jk jk jk
[16:10:31] <nbf> http://www.luxverbi.org.uk/arch/Escape_from_paganism_evangelizing_catholics.jpg
[16:18:53] <CLT|Stiotic> mr_monthy im german and advent ist (at least here) a general christian term
[16:19:22] <CLT|Stiotic> is*
[16:28:10] * mr_monty gives nbf an extra strength sin cleansing for his pagan ways
[16:41:23] *** Gooogy has joined #lwjgl
[16:49:55] *** aho has joined #lwjgl
[16:55:29] *** Irrelium has quit IRC
[17:05:54] <lwjglbot> lwjglforum: Re: Problem with texture edges <http://lwjgl.org/forum/index.php/topic,5264.msg28085.html#msg28085>
[17:07:00] *** lrh9 has quit IRC
[17:12:44] *** peter1 has joined #lwjgl
[17:13:00] *** Irrelium has joined #lwjgl
[17:15:32] *** DrShoggoth has quit IRC
[17:23:25] *** steve____ has quit IRC
[17:39:25] *** purestrain has joined #lwjgl
[17:43:07] *** devnewton has quit IRC
[17:47:23] <mr_monty> isle of man
[17:47:26] <mr_monty> interesting
[17:51:07] *** Jeanne-Kamikaze has joined #lwjgl
[17:54:23] *** Norbo11 has joined #lwjgl
[18:03:40] *** CharlieM75 has joined #lwjgl
[18:05:58] *** CharlieM751 has quit IRC
[18:06:13] <lwjglbot> lwjglforum: Re: Problem with texture edges <http://lwjgl.org/forum/index.php/topic,5264.msg28086.html#msg28086>
[18:18:38] <nbf> http://www.phoronix.com/scan.php?page=news_item&px=MTU0MDI
[18:18:40] <nbf> FINALLY
[18:18:48] <nbf> april can't get here soon enough :)
[18:21:41] <MatthiasM2> nice
[18:52:32] <aho> did anyone try ceylon?
[18:53:01] <aho> this jvm/to-js language: http://ceylon-lang.org/
[19:13:20] *** MatthiasM has joined #lwjgl
[19:15:03] *** davedes has joined #lwjgl
[19:20:34] *** Goddesen has quit IRC
[19:28:37] *** SoniEx2 has quit IRC
[19:29:24] *** SoniEx2 has joined #lwjgl
[19:35:19] *** lrh9 has joined #lwjgl
[19:49:43] *** skos has joined #lwjgl
[19:51:46] *** purestrain has quit IRC
[19:52:45] *** skoskav has quit IRC
[19:55:13] *** skoskav has joined #lwjgl
[19:58:33] *** skos has quit IRC
[20:08:15] *** ako has joined #lwjgl
[20:11:59] *** aho has quit IRC
[20:12:41] *** CLT|Stiotic_ has joined #lwjgl
[20:14:52] *** CLT|Stiotic has quit IRC
[20:47:22] *** peter1 has quit IRC
[20:57:00] *** cobolfoo has joined #lwjgl
[21:05:26] *** ZeuPiark has joined #lwjgl
[21:07:14] <lwjglbot> lwjglforum: Re: Problem with texture edges <http://lwjgl.org/forum/index.php/topic,5264.msg28087.html#msg28087>
[21:16:42] <jezek2> ako: I don't like langauges that don't provide strong guarantees on basic integer types
[21:16:59] *** ZeuPiark has quit IRC
[21:17:05] <jezek2> like I understand it makes JS port more fast, but at what price?
[21:17:28] *** Hanack has quit IRC
[21:18:14] <ako> in js-land, integers up to 2^53 work fine
[21:19:02] <ako> (9,007,199,254,740,992)
[21:19:16] <ako> for most things it's good enough
[21:21:21] <jezek2> on the other hand I'm glad there are some more choices of sensible languages that compiles to JS
[21:21:34] <jezek2> last time it was all weird language after another
[21:21:45] <ako> i use dart :>
[21:22:18] <jezek2> I realized targetting web is a mistake :)
[21:23:08] <jezek2> but you never know when you would just need it for something so it's good to have some better options
[21:23:27] <jezek2> for basic stuff JS is totally fine
[21:23:50] <jezek2> complex apps are better not done on web
[21:23:50] <ako> ceylon is fully interoperable with java. so, you could use it in places where scala is used... or together with lwjgl etc
[21:24:01] <jezek2> otherwise it will be just another shitty app
[21:24:23] <ako> yea, writing bigger applications with javascript is needlessly complicated
[21:24:25] <jezek2> I can say that google apps seems to be a little better than the rest, seems they invested a lot of effort to make a "mini OS" of some sort
[21:24:35] <jezek2> like they have own implementation of scrollbar that even works as intended!
[21:24:41] <jezek2> that's very rare
[21:24:51] <MatthiasM> we also have a huge HTML5 UI
[21:24:52] <ako> heh
[21:25:16] <jezek2> well I'm not saying just JS, but also anythign that compiles into it
[21:25:29] <ako> yea, google doesn't really use plain javascript
[21:26:12] <ako> they got that Closure flavor of js which adds type information via doc comments
[21:26:16] <ako> and they got GWT
[21:26:44] <ako> dart gives you pretty much the benefits from both
[21:27:27] <ako> you get good tooling and fast iterations
[21:27:31] <jezek2> for one project I plan to use classic client self-updatable multiplatform app, it would provide the high quality experience to manage the "backend" stuff that is just not achieavable on HTML platform without being shitty + comfortant offline usage
[21:27:50] <jezek2> <canvas> is just shitty to do any sort of UI elements for example
[21:28:05] *** mr_monty has quit IRC
[21:28:23] <nbf> haha canvas
[21:28:28] <nbf> it makes flash look awesome
[21:28:41] <ako> well, canvas elements are like any other node. they are part of the dom and you can just put stuff above and below it
[21:28:52] <jezek2> that's the theory :)
[21:29:02] <jezek2> in practice it's unusable piece of crap
[21:29:17] <ako> *shrug*
[21:29:18] <jezek2> nbf: yeah + flash had nice optimized SW vector renderer
[21:29:42] <jezek2> ako: we'll see in 5 years if it improves in the browsers
[21:29:43] <jezek2> :)
[21:29:47] <ako> canvas is okay as long as the hardware acceleration works
[21:29:53] <nbf> no it doesn't
[21:30:03] <nbf> it's slow as balls even with hw acceleration
[21:30:19] <jezek2> actually I can imagine webgl to do stuff, than canvas :D
[21:30:31] <nbf> whoever created the impls for chrome, firefox and safari must have been like "oh look how fast we can draw one triangle on one canvas, DONE!"
[21:30:46] <jezek2> but there is still issues with event handling in browsers etc.
[21:30:50] <nbf> yeah webgl is much better
[21:31:02] <nbf> still slow as hell but an order of magnitude faster than canvas
[21:31:04] *** Hanack has joined #lwjgl
[21:31:26] *** Scient has quit IRC
[21:32:18] <nbf> google is slowly recreating the flash and java platforms
[21:32:20] <ako> well, it's not like a rectangle which is simply overdrawn. it's part of the dom and the final compositing step has to be done by the browser
[21:32:32] <nbf> it will end up sucking in the same ways
[21:32:37] <MatthiasM> nbf: yes, it is not fast compared to native trivial OpenGL - but it's basically the only way to get any dynamic graphics into a website
[21:32:41] <ako> that's where webgl gets a performance hit
[21:33:45] <nbf> soon they'll sober up and go
[21:33:52] <jezek2> ako: well once the browser is fully accelerated it's quite fast, which I think quite happened
[21:33:58] <nbf> "compiling to javascript is awful, we need to create a new intermediate format"
[21:34:13] <ako> pNaCl
[21:34:17] <jezek2> well I think the issue is more if to even have such "network apps"
[21:34:20] <nbf> and then web intermediate bytecode will be born
[21:34:22] <ako> it's LLVM IR bytecode
[21:34:26] <jezek2> I was thinking about it many times
[21:34:28] <nbf> oh that's right
[21:34:33] <nbf> so there you go, bobs your uncle
[21:34:34] <jezek2> and they will always be limited, second class citizens
[21:34:58] <nbf> iirc the next step will be a bunch of security problems
[21:35:03] <ako> with pNaCl, you can have an emscripten fallback
[21:35:16] <nbf> with a bunch of performance limitations
[21:35:20] <jezek2> somehow I think the web evolved to about the right state however shitty it is... but it just satisfies conflicting requirements :)
[21:35:37] *** Scient has joined #lwjgl
[21:35:39] <jezek2> and I would say overally it's better than e-mails :D
[21:36:07] <jezek2> on the level how much it sucks
[21:36:08] <jezek2> :)
[21:37:39] <ako> Google I/O 2013 - Introduction to Portable Native Client (PNaCl) http://www.youtube.com/watch?v=5RFjOec-TI0&list=PLOU2XLYxmsIKNXidK5HZsHu9T7zs6nxwK&index=34
[21:38:43] <jezek2> isn't LLVM IR too complex? :)
[21:39:19] <jezek2> though for getting good performance it can be probably the best option for such "network apps"
[21:39:23] *** Scient has quit IRC
[21:39:34] <jezek2> I think the question is... can you implement a performing JVM on this?
[21:39:44] <jezek2> not that it would make much sense
[21:39:45] *** ayo has joined #lwjgl
[21:39:59] <jezek2> but it's a great metric on quality of the tech
[21:40:08] *** Scient has joined #lwjgl
[21:41:22] <ayo> yea, you could
[21:41:55] *** CLT|Stiotic_ has quit IRC
[21:42:10] <ayo> probably :>
[21:42:35] *** ako has quit IRC
[21:44:30] <ayo> compiling directly to llvm ir might be a better idea though
[21:44:41] *** ayo is now known as aho
[21:49:58] *** Irrelium has quit IRC
[21:57:34] *** Irrelium has joined #lwjgl
[22:02:12] <nbf> there already is a functioning jvm built on llvm, vmkit
[22:02:47] <nbf> although with pnacl I'm not sure, I doubt they let you do a lot of fiddling with the code at runtime
[22:03:01] <nbf> you supply IR, which gets verified and then compiled and executed
[22:03:07] <jezek2> aho: well I was thinking more of the implementation of GC, and ability to dynamically load code
[22:03:11] <nbf> I don't think you can do code generation
[22:03:27] <jezek2> yeah that's what I'm talking about, there may be vmkit, but would it work with pnacl? :)
[22:03:48] <nbf> like I siad, I doubt it due to security restrictions
[22:03:51] <jezek2> or some other cool things, some languages use eg. tagged types or whatever weird thing
[22:04:01] <jezek2> like "is it general enough?" :)
[22:04:05] <nbf> but really why
[22:04:13] <nbf> you can just compile once and let your app run
[22:04:29] <jezek2> to support different languages from C/C++
[22:05:03] <nbf> you could do that and still have AOT
[22:05:21] <nbf> Dynamic linking and glibc are not yet supported. Work is under way to enable dynamic linking in future versions of PNaCl.
[22:05:24] <nbf> that's kind of interesting
[22:05:27] <jezek2> not every language is easily done in AOT :)
[22:05:54] <jezek2> well dynamic introducing of code is not that hard, just provide API that can accept the code/bytecode to be verified and incroporated into the process
[22:06:05] <jezek2> it would be a bit slower though... but you can always opt to use -O0 optimization for that :)
[22:06:22] <jezek2> or jsut very basic one
[22:06:54] <jezek2> still... from user point, not sure what is the point of running such complex apps in browser, it's just limiting
[22:07:16] <jezek2> and smartphones/tablets shows that the native apps way is very viable actually
[22:07:22] <jezek2> and also people got used to it
[22:08:54] <jezek2> but it's interesting tech nevertheless
[22:09:18] <nbf> it's funny that google is choosing goofy names for that tech
[22:09:21] <nbf> like they aren't serious
[22:09:28] <nbf> but at least they didn't call it "Google Applets"
[22:09:41] <jezek2> you mean like metro or windows? :P
[22:09:58] <nbf> I mean like PNaCL
[22:10:05] <jezek2> haha, still better than linux names
[22:10:35] <jezek2> I don't think that using the "applets" word would be the best idea
[22:11:05] <jezek2> they would be confused if it's based on java or whatever
[22:11:13] <jezek2> or if it's slow & bulky ;)
[22:12:33] <jezek2> I would say it's because it's totally in the research category, so codenames like that are completely fine :)
[22:12:42] <nbf> true
[22:12:50] <nbf> and it's a feature of chrome
[22:12:56] <nbf> so end users don't need to know about it
[22:12:59] <jezek2> don't think they plan it as a product
[22:13:01] *** meoblast001 has joined #lwjgl
[22:13:06] <jezek2> as of now at least
[22:13:17] <nbf> you install a chrome web app and it just uses that stuff in the background
[22:13:20] <jezek2> also that it's used only in that chrome app store
[22:13:29] <jezek2> not even for general web pages
[22:14:36] <jezek2> also for something like that to catch up it should be reasonably easy to develop it independently
[22:14:48] <jezek2> with this you're basically tied to google's code & llvm
[22:15:02] <jezek2> that's unlike anything other that's part of the open web
[22:15:52] <lrh9> Anyone have any experience with the Java scripting API?
[22:22:48] *** TechNick6425 has joined #lwjgl
[22:23:51] *** TechNick6425 has quit IRC
[22:56:33] *** ksclarke has quit IRC
[23:00:21] *** Sopheria has joined #lwjgl
[23:04:31] <nbf> MatthiasM: http://nothings.org/stb/stb_truetype.h
[23:27:03] *** void256 has joined #lwjgl
[23:46:48] *** davedes has quit IRC
[23:49:21] *** Norbo11 has quit IRC
top

   December 10, 2013  
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | >