• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Caglow

  • Rank
  1. FreeGLUT Game Mode Problem

    Just did a bunch of variations to that line (removing the alpha, removing GLUT_RGBA, removing GLUT_DOUBLE and removing that line altogether) and I still get that strange error. I've never gotten the problem before when working with normal GLUT (which I can't test with because it doesn't want to work at all).
  2. I usually don't use Game Mode in GLUT so I never noticed the problem until now. Anyways, I can't seem to get working. For the following (non-production) code, I would expect a fullscreen black window to show up: #include <GL/freeglut.h> void display(void) { glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT); glutSwapBuffers(); } int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE); glutInitWindowPosition(150, 100); glutCreateWindow("Black Window"); glutGameModeString("1024x768"); glutEnterGameMode(); glutDisplayFunc(display); glutMainLoop(); return 0; } Instead, I get a normal 300x300 window filled in black. The output of the program is along the lines of: Quote: freeglut (E:\Projects\C\test\freeglut\bin\Debug\freeglut.exe): The graphics mode is not supported. freeglut (E:\Projects\C\test\freeglut\bin\Debug\freeglut.exe): failed to change screen settings I've tried changing the Game Mode string to 1280x1024 but I still get the same problem. glutFullScreen() works though. The libraries I'm linking are in order as below: opengl32 freeglut glu32 <-- not needed here but can't hurt to have I'm using MinGW with GCC 4.4.0 and Code::Blocks 8.02 and freeglut 2.4.0 (2.6.0rc1 and trunk doesn't work properly for me). I built the freeglut binaries myself. If you need more information or if a thread like this already exists, please let me know. I've searched!
  3. Weird...after I restarted my works! I haven't got a clue what a computer restart would do that would solve the problem but...strange.
  4. I'm building this project I have for Windows (using Code::Blocks & MinGW), and all goes fine until it builds the resource. I only built the projects with MinGW before the problem though, and I reinstalled it because of the GLUT linking problem I had earlier which has since been fixed. Yet, when I had the GLUT linking problems, I didn't have any issues compiling the resource files. The problem came what felt like out of nowhere. Anyways, here's my build log: -------------- Build: Main Win32 in ci --------------- windres.exe -i E:\Projects\C\I\src\cires.rc -J rc -o ..\obj\cires.res -O coff gcc.exe: E:ProjectsCIsrccires.rc: No such file or directory gcc.exe: warning: `-x c' after last input file has no effect gcc.exe: no input files windres: preprocessing failed. Process terminated with status 1 (0 minutes, 0 seconds) 0 errors, 1 warnings Everything else builds without a warning. And it's not just this project. Projects that I've built a month ago which I haven't changed the settings at all which had successfully built resources before are also having the same problem. I replaced windres.exe with no luck. FYI, this problem occurs on BOTH MinGW AND Cygwin so whatever the problem is, it affects them both. EDIT: For those wondering, yes, I've searched the web with no luck. I found two that looked promising. The first turned out the problem because there were spaces in the directory path. There are no spaces here. The second one had the error in English exactly like mine but it was like in Iranian. When I used Google Translate, it didn't really make sense. [Edited by - Caglow on August 8, 2009 11:59:26 AM]
  5. Problems Linking GLUT

    Command-line looks exactly the same. In addition, it also built on Cygwin with the makefile but failed on MinGW...even after I completely deleted everything in the MinGW folder and reinstalled it. However, Cygwin uses 4.3.2...
  6. Problems Linking GLUT

    I just tested with Cygwin and strangely, it worked. So now, I'm narrowing the problem down to MinGW. I can't use Cygwin for the project because of the fact that it is closed source and anything built with Cygwin must be under the GPL. Note that the libglut32.a came with Cygwin when I installed it a while back. UPDATE AGAIN: I copied the library in Cygwin into the MinGW lib directory and it actually works. The thing now I'm worried about is if that libglut32.a & glut32.dll was built with Cygwin because if it is, then anything using it must be open sourced like above. Most of the libraries between Cygwin and MinGW seem identical so it seems okay for use in a closed source project. If someone can tell me for sure...thanks. [Edited by - Caglow on August 1, 2009 8:34:08 PM]
  7. Problems Linking GLUT

    I just tried building freeglut. I tried to do it with a makefile first. It appeared to be successful until I realized that it produced no output besides a bunch of object files. Except for that libglut.a which I have no idea why it would generate that. But no dlls, nothing. I tried it with Code::Blocks by converting the VS solution. The compilation worked with the libfreeglut.a being produced. Except I got a bunch of linking errors. The errors for OpenGL were easy to solve...I just linked to libopengl32.a and thought that was the end of them. Except I still ended up with a bunch of linking errors to GDI functions (or so I think from searching the web) such as `undefined reference to wglGetProcAddress@4'. I added in gdi32 and winmm (both of which do exist) and came up with the same result. Of course, it worked perfectly when I built it directly from Visual Studio. Is it problem with my GDI library? Do I have to build that to fix it? Thanks for the reply. BTW, I'm also going to try openglut to see if that ends up any different although it does appear to be a dead project is GLUT so... UPDATE: OpenGLUT gives me the exact same result as FreeGLUT. I thought it might be a problem with MinGW so I reinstalled it to no avail.
  8. Problems Linking GLUT

    Yes, I built GLUT (3.7.6) myself. I used GCC 4.4.0 on MinGW to do so. I just tried it again with those 2 other libraries and it still doesn't work. Order is as follows: glut32 opengl32 gdi32 winmm Same error. I also checked and made sure I have no other copies of GLUT in the path by renaming libglut32.a which, as expected, gave me a not found error. Could it be that GCC doesn't support something as old as the original GLUT?
  9. Details are here: To put it short, I'm using the latest version (which I heard is pretty old) of GLUT (3.7.6) on MinGW. It refuses to link...or at least link properly. The glut32.lib links in Visual Studio but nothing does in MinGW. NOTE: I HAVE TOLD THE COMPILER TO LINK. Please read the details for additional information which I think will be necessary to answer the question. Thanks.
  10. OpenGL Custom Projections?

    I haven't a clue about how to do this but I will take a look at some of those tutorials. (I've never rendered anything successfully on the inside of a polyhedron or any other solid) Also, if anyone else has a solution, please post. Stereographic Projections on Wikipedia: (there are formulas but no matrices).
  11. OpenGL Custom Projections?

    Yes, that's what I'm trying to figure out how to do. I'm trying to convert everything 3D and draw it onto a sphere which then needs to be converted to 2D with a stereographic projection. I'm sure this is possible (to some extent) as, like I said, stellarium uses it (and the objects appear remarkably 3D as if drawn using Perspective).
  12. The only 2 projects I know of that are built into OpenGL are Orthographic and Perspective. I've been using these for a while now but am wondering if it's possible to have other projection stereographic. I've searched Google for code for this but have come up empty-handed. My current project is to be purely based on this projection type. I've realized that other programs written with OpenGL, like stellarium, seem to be able to do this. However, I'm not about to look through 1M+ lines of code just to find a few hundred that I need (not to mention that stellarium has SO few comments). If possible, I'd like to see some example code and a brief explanation (unless the code is self-explanatory). Thanks.
  13. Translated/Translatef

    Now THAT works like magic! Thanks for the help!
  14. Translated/Translatef

    I see...well, that fixes the X/Y part of it but the Z axis still doesn't seem to want to work as you say it should. The code: PushMatrix(); glTranslated(0, 0, 10); glutSolidSphere(1.4, 150, 150); PopMatrix(); According to what you say, that should move the "glutSolidSphere" closer to me by 10 units. However, this is what it does: This is the original without a translate: I'm not sure what it's exactly doing's either moving the camera around the object or it's moving the light source. Thanks. EDIT: From what I just realized...I think translating an object closer or farther doesn't change its size. How would I go about "linking" the translate with a size change? It feels very obvious but I can't figure it out.
  15. Translated/Translatef

    Sorry about all the questions. I have (attempted) research on all OpenGL related topics and this is one (very basic I assume) principle that I just don't seem to get. How does Translate work? When placed inside a PushMatrix/PopMatrix and before the drawing of an object, I assume it would translate it by the specified 3D coordinates. ie, translatef(0.0, 0.0, 1.0f) would move the object 1 unit away from the camera. From the tutorials, I can tell that I'm clearly wrong about the z. When I try it myself, it moves the object down by 1 unit. Someone, please correct me and my mistake. How does translate REALLY work (I'd prefer if you don't go until matrices unless that's the only way to explain). And how would you move the object 1 unit away like I intended? Again, thanks for any and all help I recieve. [Edited by - Caglow on April 5, 2009 8:30:07 PM]