• Content count

  • Joined

  • Last visited

Community Reputation

141 Neutral

About Mhondoz

  • Rank
  1. OpenGL OpenGL 3.1

    Here is an article by Paul Martz (author of OpenGL Distilled book) about the new 3.1 specs:
  2. Thank you all for your replies. :-) The reason why I want to use OpenGL for this are: I want hardware acceleration with scaling, rotation, blending... I am already using another GUI / Message Loop (Qt), so SDL does not fit very well into this I know how to use ortho, and to map a texture on one quad, and I think this would be the most straight forward way to do it, just create a texture from the pixel buffer each frame.
  3. Hi. I am working on an application that does graphics the old fashioned way, by plotting pixels in an unsigned char array. The application dates back to the DOS days, but have lately used SDL and a SDL surface to plot the pixels in a Windows environment. What I want to do is to instead of the SDL surface do the plotting to an OpenGL texture. So the question is: What is the best way to plot pixels with OpenGL? I guess I could take the array of pixels and create a texture of it with glTexImage2D. But are there other ways?
  4. Simple(?) USB switch of some sort?

    One way to do it is to use a digital I/O module like this one. This might be an overkill if you just want to have one LED, and it costs money. But it also will let you have more than one light, and since it also can take input, you could for example let the user switch a hardware button that in turn switches a button in your program. These modules are delivered with a C++ API and is fairly easy to program. But you will need some hardware knowledge of how to connect the light and buttons to the module. This module is just an example, there are different vendors and products. Search for
  5. First of all, sorry for bringing up this old thread again, but I just wanted to get back to say thank you for your replies. :-) First I realized that it was possible to test the edges and not whole triangles. I will not detect if the whole ship is "into" the land, but I will detect each time the ship crosses an edge. And that is enough, since the ship does not move so fast relatively to how often I check for collision, so that is all fine. I have also implemented a QuadTree, and is doing bounding box check of the ship against the nodes in the tree. Then I check a list of edges inside any leaf that the ship's bounding box intersects with. By not using the "tall and skinny" triangles the geometry also fits better into the QuadTree. It is now working pretty well, and I am happy with it. My only concern with it is how to deal with edges that intersect more than one leaf. The way I do that now is that each edge is stored in each leaf it intersect with. That gives cases where one edge is stored in more than one leaf...
  6. Ray tracing tutorials

    Try this at
  7. Converting .doc to .html

    You could also try OpenOffice. Would do the same as MS Word though (open .doc and Save As... .html). Does not use CSS, encodes all with HTML tags.
  8. Serial port guides?

    A few links of Serial COM application developement: Serial COM - event driven version - Tetraedre Serial Communication in Windows - CodeProject Serial library for C++ - CodeProject Serial Communications in Win32 - MSDN
  9. Thank you for your replies. Greatly appreciated. :) @CJM -- The original land consist of only the edges that separate land from ocean, so no internal triangles. The triangles are there only because the collision detection algorithm need to test against convex polygons. Since the triangles are created out of the "outline" of an island for example, all triangles have at least one edge that is coastline. If I could get by with only testing this edge that would be an significant optimization. But I am not sure if I will detect if the ship was totally inside the island, no edges is hit, but it sure is a collision between land and ship... For the cell idea I think that could work, but I see one problem because alot of the triangles is very "tall" and "slim", so a lot of the triangles will span over a lot of cells... or do I misunderstand the concept?
  10. I want to detect if a ship (polygon with 9 vertices) intersect with my land polygons. So far I got the method of the separation axis working, by using the tutorials presented by Oliii here on the forums. I am using the GLU tesselation functions to create triangles of the land polygons. Then I test the ship against each polygon (brute force). And while it works perfectly, it becomes too heavy to compute several times per second when the largest map contains about 30000 triangles (note, the screenshots are zoomed in so the ship should be visible, the complete map consist of a lot more triangles). So what I am asking for is suggestions of how to optimize this... For example a method to organize the triangles so that I only need to do the detailed intersection test for some and not all the triangles... Example of land and ship polygon Wireframe to show the GLU tesselation Each triangle random colored... Collision detected! :) [Edited by - Mhondoz on February 20, 2006 8:33:10 AM]
  11. Game Engine Architecture

    Oops. Sorry, didn't notice that line in the original post.
  12. Game Engine Architecture

    Maybe the Enginuity articles are what you are looking for?
  13. Thank you CodeMunkie. :-) /Mhondoz
  14. It is possible to move the SDL window, but I think you have to do it in a platform specific way (not directly supported by SDL, and so not portable). In Windows it can be done like this: #ifdef WIN32 #include <SDL_syswm.h> SDL_SysWMinfo i; SDL_VERSION( &i.version ); if ( SDL_GetWMInfo ( &i) ) { HWND hwnd = i.window; SetWindowPos( hwnd, HWND_TOP, x, y, width, height, flags ); } #endif // WIN32 To make it portable you will have to do similar code for the other target platforms using #ifdef's. Check with MSDN for options in SetWindowPos().
  15. I am using software surfaces in SDL: _screen = SDL_SetVideoMode( width, height, 8, SDL_SWSURFACE ); _backscreen = SDL_CreateRGBSurface( SDL_SWSURFACE, width, height, 8, 0, 0, 0, 0 ); Inspecting the SDL_MUSTLOCK macro it looks like you should lock your surface if you are using SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL, or surface->offset != 0. My question is, what is the surface->offset used for? The reason for questioning this is that I am not using any of the flags that will require locking, and if I could know for certain that the offset will not change from 0, I could use the surface without checking if it need to be locked. Btw. I am on Windows XP, and using the _screen in both windowed and fullscreen mode. [Edited by - Mhondoz on June 29, 2005 8:12:47 AM]