Show Posts
|
|
Pages: [1] 2 3
|
|
1
|
Java Game APIs & Engines / OpenGL Development / Re: Mouse Grabbing
|
on: 2005-09-14 15:09:06
|
Ha ha. I'm sure pro's have the same stupid mistakes every once in a while. Sometimes I find the best solution is just to rewrite everything.
I’d like to think they don’t make cock ups on the scale that I’m capable of  In my defense (well sort of) I’ve still never gotten out of the habit of writing messy code. My objects and stuff are pretty tidy but in almost everything I’ve ever wrote the main program has always been a shoddy mess with bits all other the place. I blame eclipse, it does so much for me that I’ve become more lazy than I could possibly imagine 
|
|
|
|
|
2
|
Java Game APIs & Engines / OpenGL Development / Re: Mouse Grabbing
|
on: 2005-09-13 17:08:47
|
As far as I can tell you simply need to set that boolean. I've never had any trouble getting it to turn visible when I want it to. Perhaps you are changing something else?
Not changing anything else, I’ve double checked. [edit] ok checked it again and found out what I was doing wrong. Alls I’ll say is, thank gawd I don’t program professionally. Think I’ll delete this thread later if its possible  Cheers all
|
|
|
|
|
3
|
Java Game APIs & Engines / OpenGL Development / Re: Mouse Grabbing
|
on: 2005-09-09 20:01:39
|
|
Ok, I tidied up my mouse calls today and I'm still loosing my cursor after I setGrabbed(false).
What I’m trying to do is grab the mouse so I can use the deltas to move a little picking box around the glscene, then ungrab the mouse so I can use the normal cursor to interact with the giu (a bit hacky I know, but it saves mucking about with ray picking).
My mouse object initially sets Mouse.setGrabbed(true) and I can then later press space to setGrabbed(false), but when I do this the cursor doen’t appear on the screen.
Is there anything else I need to do to make the cursor reappear?
[edit] Meant to mention before, if I start my app with the mouse un-grabbed and then later set it to grabbed the cursor still remains on screen, is this supposed to happen?
Cheers.
|
|
|
|
|
4
|
Java Game APIs & Engines / OpenGL Development / Re: Mouse Grabbing
|
on: 2005-09-07 20:26:20
|
|
Oh Dear, just been looking at my mouse code (which was quick and dirty temp stuff I done a while ago) and there appears to be huge amounts of funkyness going on all over the place. Some bits of code are calling myMouseObject and other bits are calling the default Mouse, long story. I think that's where the problem is.
I'll rewrite it over the weekend and that should hopefully sort it out.
Cheers DP, and sorry for wasting your time. Feel free to issue a slap.
|
|
|
|
|
5
|
Java Game APIs & Engines / OpenGL Development / Mouse Grabbing
|
on: 2005-09-07 19:00:09
|
|
Probably a stupid question but, is it possible to use the mouse in both the grabbed and un-grabbed state in a single session?
It helps a great deal if I can use the mouse deltas to move and position stuff in my glwindow, but obviously this renders the swing gui useless. If I set a key to grab and un-grab the mouse it becomes unreadable.
Anyone know if there is a workaround for this?
Cheers.
|
|
|
|
|
9
|
Java Game APIs & Engines / OpenGL Development / Quick AWTTest related question
|
on: 2005-08-31 19:02:11
|
Just been looking a the AWTTest.java that comes bundled with the source as I'm tempted to port over my game editor to it, at the moment its all in standard opengl and I'm running out of keyboard shortcuts  I have very little experience using AWT but in the AWTTest demo isn’t the GLcanvas supposed to resize when I drag/maximise the window? If not how do I get the GLcanvas to stay the same size as the window? Thanks.
|
|
|
|
|
11
|
Java Game APIs & Engines / OpenGL Development / Convolutions
|
on: 2005-07-21 20:30:04
|
|
Browsing through the red book today and came upon the section on convolution filters and though I'd have a little play around with them, however I can't seem to find them in LWJGL. Have these been left out of LWJGL or are my searching skills just as poor as my programming?
Cheers
|
|
|
|
|
13
|
Java Game APIs & Engines / OpenGL Development / Re: strange crash
|
on: 2005-03-31 17:43:28
|
|
I've just been playing about with openal for the first time and it seems to be working ok, besides one huge conflict problem. If I'm using openal and I've got Reason (music app) open I get a blue screen of death with this message:
DRIVER_IRQL_NOT_LESS_OR_EQUAL Blah, blah, please reset your computer...
That's on winxp with a creative Audigy card.
Not nice, but it could be a problem with Reason and I've learnt to close Reason if I'm using openal on the pc. I get the same problem if I try the superdudster demo when Reason is open. I haven't tried it on the mac yet but I'll give it a go tomorrow. Also, noticed the sound in superdudster gets very crackly when lots of bat guys are exploding, I can't remember thisbeing a problem in the older versions I tried.
|
|
|
|
|
15
|
Java Game APIs & Engines / OpenGL Development / Re: Dot3 Bump Mapping (little) problem
|
on: 2004-09-20 20:18:20
|
I've been playing around with multitexturing recently and I thought I'd try out the example above, doesn't seem to work right for me. Is there anything else that has to be added to the above code to get bump mapping working as the code above just adds highlights to the texture, rather than a light reactive bump map? Also, I've been browsing the net looking for none shader bump mapping techniques and a common one I've found is this : http://www.paulsprojects.net/tutorials/simplebump/simplebump.html, (nehe#20 links to this tut) Its uses a normalized cube map to calculate the, err, magic:) However I'm having trouble converting this bit of C code to java. 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
| GL11.glGenTextures(textureId); glBindTexture(GL_TEXTURE_CUBE_MAP, texid);
unsigned char* data = new unsigned char[size*size*3];
float offset = 0.5f; float halfSize = size * 0.5f; float[] temp = {0f, 0f, 0f}; int bytePtr = 0;
for(int j=0; j<size; j++) { for(int i=0; i<size; i++) { temp[0] = halfSize; temp[1] = (j+offset-halfSize); temp[2] = -(i+offset-halfSize); scale_to_01(temp); data[bytePtr] = (unsigned char)(temp[0] * 255.0f); data[bytePtr+1] = (unsigned char)(temp[1] * 255.0f); data[bytePtr+2] = (unsigned char)(temp[2] * 255.0f);
bytePtr+=3; } } glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGB8, size, size, 0, GL_RGB, GL_UNSIGNED_BYTE, data); |
The part I'm having trouble with is the unsigned char parts, I guess this needs to be a byteBuffer but (being rubbish with byteBuffers) I have no idea how to get this bit of code working with them. Can someone point me in the right direction? Also are there other more straight forward ways for creating the bump mapping effect, preferably with openGL doing all the work  Cheers all [edit], I think I've sorted it out, wont be able to test it tomorrow though.
|
|
|
|
|
17
|
Java Game APIs & Engines / OpenGL Development / sync and sync2
|
on: 2004-09-10 19:09:39
|
Hands up who could see this coming  After being advised to use the sync and sync2 methods rather than rely on vsync, I thought I'd try and test them out. Not sure if I'm doing this right but here's how I'm using the method, using the mainloop from FullScreenWindowedTest as an example. 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 32 33 34
| private void mainLoop() { while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested()) { if (Display.isVisible()) { processKeyboard(); logic(); render(); } else { if (Display.isDirty()) { render(); } try { Thread.sleep(100); } catch (InterruptedException inte) { } } Display.sync(60); Display.update(); } } |
As I said I'm not sure if this is the right way to use the method, but doing it this way the updates are not very reliable, the screen seems to skip every few seconds as if it's catching up with the updates, if that makes any sense. So what I'm I doing wrong here? cheers Btw, the display mode is set to 60htz.
|
|
|
|
|
19
|
Java Game APIs & Engines / OpenGL Development / Re: LWJGL 0.92 released!
|
on: 2004-09-10 15:43:52
|
|
/waves hand jedi like:
What and where are these sync and sync2 methods of which you speak.
Are these part of lwjgl or are they just some tried and tested timing methods, can't seem to find any info on them. I've always relied on vsync but going by the advice on here its time to look into something more reliable I guess.
Cheers
|
|
|
|
|
21
|
Java Game APIs & Engines / OpenGL Development / Re: LWJGL 0.92 released!
|
on: 2004-09-09 18:45:33
|
Oops, no its still there  I was looking through good'ole FullScreenWindowedTest.java, only just noticed that Display.setVSyncEnabled(true) has now been placed into glInit(). Slightly off topic. What's the score with TFT monitors and VSync, do they always sync at 60htz, or should I look to using a proper timer for a game release?
|
|
|
|
|
24
|
Java Game APIs & Engines / OpenGL Development / Re: Keyboard Focus and Webstart
|
on: 2004-08-21 10:05:06
|
|
I had a problem with this with one of my own webstarts, it was caused by webstart popping up a dialog box asking if I would like the app integrated into my desktop, unfortunately webstart decides to ask this question after the app has run, so that's why you have to alt-tab to gain focus away from the dialog box.
It's easily turned off.
Might be something else but it sounds very similar.
|
|
|
|
|
29
|
Java Game APIs & Engines / OpenGL Development / Re: ported kev's TextureLoader
|
on: 2004-05-01 16:36:23
|
>It bombed out at GLU.gluBuild2DMipmaps IIRC JCD's worked fine for me, but as I said I've only glanced through the texture chapter, maybe JCD can shed some light. >Well, opengl stores them upside down. That I didn't know, I've just been flipping them in photoshop to solve the issue I'll really have to read that red book properly sometime. Cheers 
|
|
|
|
|
30
|
Java Game APIs & Engines / OpenGL Development / Re: ported kev's TextureLoader
|
on: 2004-05-01 16:01:54
|
|
Cool oNyx, I'll take a look at this as soon as I get some time. I really like JCD's texture loader though, very easy to use imo.
What problems have you had with it?
There is one thing that's puzzling me about JCD's texture loader though, but I'm not sure if it's something I'm doing or something in the code. Every time I load and display a texture it's always displayed upside down. I'm pretty sure its something I'm not setting up right on the texture loading side of things, but I've only glanced through the texture chapter of the red book so I can't be sure.
Anyone got any clues?
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|