Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

422 Neutral

About Optus

  • Rank
  1. Look at the Panel control. (<asp:Panel>) It has an attribute "DefaultButton" that you can set to the ID of a button. When the users presses the enter key within that panel the corresponding button is automatically "clicked". i.e. <asp:Panel ID="SearchPanel" DefaultButton="SearchButton" runat="server"> <asp:TextBox ID="SearchTextBox" runat="server"/> <asp:Button ID="SearchButton" runat="server"/> </asp:Panel> <asp:Panel ID="DetailsPanel" DefaultButton="OKButton" runat="server"> ...UserName: blahblahblah ...Password: blahblahblahblah ...Confirm PW: blahblahblahblah <asp:Button ID="OKButton" runat="server"> </asp:Panel> This is just off the top of my head and may have syntax errors but you get the idea. Also: Panel control at MSDN
  2. I believe it's because the javascript code that you don't put within a function is executed before the page is finished loading. The element "link" in your test doesn't exist yet. If you put the code in an onload statement, it works fine. See: <script type="text/javascript"> function test () { var v = document.getElementById("link"); alert(v); } </script> </head> <body onload="test()"> <a href="#" id="link">asdf</a> </body> </html>
  3. Optus

    Simultaneous input

    Is it because you're using "else if" blocks for each key conditional? This guarantees that only one block of code will be executed (The first that tests true in your series). I think this would definitely prevent you from getting "simultaneous" input. Change it to a series of plain if blocks, like so: if(wParam == VK_ESCAPE) { // Exit when escape is pressed m_bShouldExit = true; } if(wParam == VK_RETURN) { // Toggle windowed / fullscreen m_thePresentParams.Windowed = !m_thePresentParams.Windowed; ResetDevice(); } if(wParam == VK_LEFT)//1ST PADDLE - LEFT { m_paddleOnePos.x -= m_fPaddleSpeed; if(m_paddleOnePos.x < -(m_coordWidth/2)) m_paddleOnePos.x = -(m_coordWidth/2); } if(wParam == VK_RIGHT)//1ST PADDLE - RIGHT { m_paddleOnePos.x += m_fPaddleSpeed; if(m_paddleOnePos.x > (m_coordWidth / 2 - m_paddleTexW)) m_paddleOnePos.x = (m_coordWidth / 2 - m_paddleTexW); } if(wParam == 'A')//2ND PADDLE - LEFT { m_paddleTwoPos.x -= m_fPaddleSpeed; // m_paddleTwoPos.x -= m_paddleTexW; if(m_paddleTwoPos.x < -(m_coordWidth/2)) m_paddleTwoPos.x = -(m_coordWidth/2); } if(wParam == 'D')//2ND PADDLE - RIGHT { m_paddleTwoPos.x += m_fPaddleSpeed; if(m_paddleTwoPos.x > ((m_coordWidth/2) - m_paddleTexW)) m_paddleTwoPos.x = ((m_coordWidth/2) - m_paddleTexW); }
  4. I'm getting some lurching. About every half second or so it jumps forward noticeably faster. I don't have any fixes to recommend, just letting you know that the problem you're having can be reproduced. Specs: Core2 T7200, 2GB RAM
  5. Depends on the database in question. In MySQL you can use the mysql_insert_id() function. In SQL Server it's scope_identity(). insert into [..] values (..); select scope_identity()/mysql_insert_id() Both are safe in the case of simultaneous inserts.
  6. Optus

    glOrtho off-by-one errors?

    For the sake of getting you a quick answer and something easy to try: It probably has to do with the way OpenGL (and really any 3D api) addresses texels (pixels). What is happening is that you are drawing at a whole number, which happens to be the border between 2 texels, not dead center on a texel. This is causing some of your lines to pop between texels, and other alignment issues. What you need to do is draw at the center of the pixel, so instead of a line from (0, 0) to (2, 2) draw from (0.5, 0.5) to (2.5, 2.5) You can do this either by appending .5 to each of your coordinates, or the easy way is to simply modify the modelview matrix to shift everything to texel centers before any 2D drawing by doing glTranslatef(0.5f, 0.5f) Hope this helps
  7. Optus

    File Hosts

    Anyone know of any good pay (as in not-free) simple file hosts? A google search returns tons of free file hosts that all have annoying limitations or advertisements out the wazoo. I'd like a service that has: High capacity (50-100GB), High Bandwidth (20+gb/mo?), FTP access for uploads instead of web-based pain in the ass, and the ability to link DIRECTLY to the file, bypassing any sort of splash screen to start the download (with all of it's annoying ads). Does such a thing exist? I don't have any need to host web pages or get a domain name, I just want to be able to directly share files with anyone I choose with the least hassle possible. Thanks in advance
  8. Oh Salsa! It's awesome. I had been checking this thread almost every day, but somehow I skipped right past my request. Thanks very much, I love it! Payment is in the tubes! edit: you can send the high-res/vectorized version to xfogx [at] hotmail.com
  9. Optus

    Yet another Java question

    Hi, it seems your array assignment is backwards. You wrote sqrs = squares; While the local temp variable you created was named 'sqrs' and the instance variable was named 'squares'. In essence, squares was initialized to a null reference on class instantiation, then you assign that null reference to the local variable 'sqrs'. I think you mean to do the reverse: squares = sqrs;
  10. Hey Salsa, If the offer still stands, I've got a website that could use a new logo. It is for a browser-based zombie game named Living Amongst the Dead. I'm looking for a logo that confers a sense of seclusion, loneliness, abandonement, violence, etc. Currently what I've got is a type of horizontal header bar meant for the webpage and it has lots of reds and blacks, as you can see in a work in progress here: Let me know if you can fit me in! Loving your work so far, and I've already got a paypal account ready and waiting. *edit: removed imageshack link
  11. You are, of course, right smitty. I would try Kalidor's suggestion, maybe the texture matrix is out of wack. Do this directly before rendering: glMatrixMode(GL_TEXTURE); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); Alternatively, you can push the texture matrix onto the stack and pop it after rendering, to restore the old texture matrix (who knows? maybe it was used for something) Another thing I would try: Disable texture coord generation, it may have been enabled in another part of the program. These calls should do the trick: glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); glDisable(GL_TEXTURE_GEN_R); glDisable(GL_TEXTURE_GEN_Q); This might have been enabled, for example, for projective texturing or shadow mapping. And last but not least, does anything change if you set a clamping mode on the texture? i.e. glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); At this point, I'm convinced it's some previous state that was set that is interfering. The code you posted as it stands should work perfectly (although I haven't had a chance to verify this).
  12. Hi smitty, can you post the texture creation code? Specifically any glTexParameteri/f calls and the glTexImage* call.
  13. Hi Ravuya, I'd cut through the BS straight to the good stuff. I've been working on and off for about 3 years on an OpenGL-based engine intended for an FPS game. IMO, BSP trees are outdated technology. They are especially good at one thing, though, and that's sorting the scene data from back-to-front (according to the camera) to eliminate overdraw. This was very important back in 1996 when Quake came out and 3dfx still made video cards. Nowadays, overdraw is less important and batching has become very important. Problem is, when taking advantage of the BSP tree for depth sorting, the draw call batch sizes become very small and wasteful for the cpu. I'd recommend looking into DeleD for an idea of how a typical scene is stored. It's a lightweight polygonal modelling tool specifically made for level design www.delgine.com. It supports quads (we don' need no stinkin' triangles!), has a builtin light mapper, and there is a completely functional version for free (limited in the aspect that you can't fully configure the lightmapper for higher quality light map generation.) On their site you can find routines for loading their (text-based) file format in a few different languages (delphi, c, c++, I have written one in Java based on these with ease). Also, in the DeleD documentation you will find a whole section dedicated to describing the file format. It's basically a polygon soup stored by groups such that a group owns it's vertices, faces and texcoords. Each face inside a group can have it's own material, and each material can have multiple layers. As for spacial partitioning, I settled on an AABB tree (also known as a bounding volume hierarchy) implementation as described here: http://www.flipcode.com/articles/dpcolumn_issue05.shtml It's great for casting rays and narrowing down potential colliding triangles. It can also work for frustum culling, consider that your view frustum can be easily fit to an AABB, then it's simply an AABB-AABB test to find which triangles are possibly viewable. Obviously frustums are rarely axis-aligned so I imagine it would "over-select" triangles to render, but can be much faster then testing all of the scene triangles against the frustum. I found your question kind of vague, so I'm hoping some of this will be useful, but if you would like any more details, post back.
  14. Optus

    java, xml & scripting

    I'm at a similar stage in development. Trying to decide if a scripting language is actually needed. My reasoning is that it doesn't save much time, with the scripting engine. After all, there is a lot of work necessary to integrate the scripting language with your current engine. All for the supposed benefits of rapid/simplicity of development, no need to recompile, readability, etc. I can see a scripting language being highly beneficial in an engine that uses C or C++... recompiling the code can be slow, development is often much slower, and with any sort of generic implementation the readability goes down the toilet. With Java, though, none of these are much of an issue. Readability is almost always good, compile times are much much shorter, and Java is a fast language to work with. Anyway, besides trying to discourage you from using a scripting language with your game, I have one offering: Beanshell. I haven't actually gotten in to using it yet, but I assumed if I ever needed a scripting language for my Java game, it would be Beanshell. The interop and standard library that beanshell offers seems to be very well done, convenient, and easy to use. And upon visiting the site to verify the link, it seems they were accepted by the JSR! This means it will be built in to J2SE core in the future (Maybe Java 7?). However, I'm unsure of it's suitability in a demanding real-time environment, maybe someone else who uses beanshell can comment?
  15. Optus

    Java for graphics?

    Quote: I'm thinking about using Java for programming web applets. How is java for graphics? Just fine. You ask specifically about shader support. When it comes down to an application that uses programmable hardware shaders, you are most certainly limited by your graphics hardware capability. Java is not a limiting factor in this case. Quote: Can you do 3D in Java? Can you use something like DirectX or OpenGL? And my biggest question, can you do shaders? Yes, yes but no DirectX, and yes. Check out LWJGL or JOGL. I prefer LWJGL as the more mature OpenGL api, but JOGL is quickly gaining ground. Add to that, in Java 6 JOGL will be core API, and is maintained actively by Sun, and it is a very attractive offering. Both APIs have full (AFAIK) OpenGL 2.0 support including FBOs, Vertex/Pixel Shaders, etc. Quote: I beleive Java3D is what your after. I last used it years ago, whether is it is still actively supported/developed I don't know. Last I knew Java3D was dead and a complete abomination. Upon further investigation, it seems it is now a community-led project. Doesn't seem to be a viable choice. Quote: I assume you could call native C++ openGL or D3D code from a Java application, but not from a applet. This is how LWJGL and JOGL both operate. However, both APIs can be used from an applet. JOGL has mature applet support, LWJGL added support in the last version. Both have signed binaries, security is not an issue. For future questions I'd head on to the Java Development forum here on gamedev, lest someone will come in here and say you absolutely must use C for any project with three dimensions in it.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!