Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

139 Neutral

About lol

  • Rank
  1. I recently finished porting an md2 viewer of mine from Linux to Windows, and I want to provide binaries for the Windows version on my website. Because I am going to be showing this program to potential employers, I want to make sure I follow the licenses of the libraries I use as closely as possible. My (GPL) program links against several GPL and LGPL libraries, so I am going to include the DLLs for those libraries in the same directory. I'm pretty sure that I'm obligated to include a copies of the LGPL and GPL, but I'm not sure how I should make it clear which libraries are licensed under which license. Should I just include that information in a readme file, or should I actually include more than one copy of each license (ie LICENSE-SDL.txt, LICENSE-freetype.txt, etc)?
  2. lol

    Memory leak?

    I don't do much with Win32 so I could be wrong, but here's my best guess: according to this, Quote:The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common device context. Maybe you still need to release the DC even if it's NULL?
  3. I think the problem is that you're calling Py_Initialize and Py_Finalize every time you draw. These functions actually create and destroy the python interpreter. I believe you're supposed to call them only once each, at the beginning and end of your program respectively.
  4. Quote:Lets say I want to spawn particles over a 2D background image, but I want there to be a part that will hide or start cutting off particles that gives the illusion something is there that is in front of the particles, but it's inadvisable so you can still see the full background image. I can think of two possible ways to do this. First option would involve drawing the background with glDrawPixels (which is not affected by the frustum or the depth test if I recall correctly) before drawing the particles. Other option would involve drawing the background as a textured quad (with writes to the depth buffer disabled), then shortening the frustum by changing the projection matrix before drawing the particles. There's probably a multitude of other ways to get this done, too.
  5. I'm making a python program to test a feature of my game engine, but couldn't seem to figure out why gluUnProject keeps raising a TypeError. I tried making a simple 60 line program to see if maybe this is happening because of something happening in my engine (which is an extension written in C), but the problem still persists. This is my source (the program is supposed to print the 3d coordinates of the cursor whenever the user clicks something): [source lang = "Python"] import pygame from OpenGL.GL import * from OpenGL.GLU import * def SetUpCamera(res): glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(90, float(res[0]) / float(res[1]), 1.0 / 100.0, 100.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() glTranslatef(0.0, 0.0, -1.0) resolution = (800, 600) IsRunning = True pygame.init() pygame.display.set_mode(resolution, pygame.OPENGL | pygame.DOUBLEBUF) while IsRunning: for event in pygame.event.get(): if event.type == pygame.QUIT: IsRunning = False elif event.type == pygame.MOUSEBUTTONDOWN: SetUpCamera(resolution) try: coords = gluUnProject(event.pos[0], event.pos[1], 0.0) except TypeError, arg: print arg else: print coords #draw a triangle glEnable(GL_DEPTH_TEST) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) SetUpCamera(resolution) glBegin(GL_TRIANGLES) glColor3f(1, 0, 0) glVertex3f(-1, 0, 0) glColor3f(0, 1, 0) glVertex3f(0, 1, 0) glColor3f(0, 0, 1) glVertex3f(1, 0, 0) glEnd() pygame.display.flip() pygame.quit() and the exception raised by gluUnProject is: Quote: ("Can't create NULL pointer filled with values", 'Failure in cConverter <OpenGL.converters.SizedOutput object at 0x15ec668>', [GL_MODELVIEW_MATRIX], 1, <OpenGL.wrapper.glGetDoublev object at 0x15f1518>) I can't seem to figure out why this is happening. Does anyone know how to fix it?
  6. Never mind, I finally managed to figure it out on my own. Just in case anyone else has this same problem and comes across this thread, here's a link to a page with the functions necessary to do this: http://docs.python.org/c-api/allocation.html
  7. I'm trying to teach myself how to extend and embed Python with C by creating a simple class for representing vectors. Some of the methods I'm creating (such as the cross product) will need to return a new instance of the vector class. I've been searching Google and the Python documentation for a few hours, but I can't seem to figure out how to do this. the closest thing I can find to this is Py_BuildValue, but I think that that only works for PyObjects if I already have an instance of the same class. Does anyone know how to do this? [Edited by - lol on May 13, 2009 9:11:03 PM]
  8. I'm in my university's computer lab doing some homework on Maple. I felt a burning sensation in my knee and pulled it back out of reflex. I discovered that there was an exposed electrical outlet near my knee. I feel kind of lightheaded, and there's a little blood on my knee (which was already scabbed). I think I might have gotten electrocuted, but I always imagined that 120v AC would seriously injure me or something. Does anybody know if this sounds like electrocution? Also, should I see a doctor even though I feel fine?
  9. lol

    30fps versus 60fps

    I think it's because FPS is not constant. Having an average FPS of 30 means that at times the FPS is less than 30, and at times it is greater than 30. An average FPS of 30 could be below the minimum frame rate necessary to look fluid at times.
  10. What's preventing you from using that data? Are you getting a segmentation fault? also, have you tried checking glGetError()?
  11. lol

    Star Trek movie funness

    DAMMIT JIM, I'm a doctor not a _______________! I'm givin' her all she's got captain! He's dead, Jim.
  12. I'm working on a program that is using Cairomm to draw a targa (which is loaded into an ImageSurface). The program needs to scale the image because it's pretty small. Everything works fine, but the image looks blurry. I found this page which contains enums for different filter types. I think what I want is FILTER_NEAREST, but I can't seem to find any functions that allow me to select the filter that Cairo uses. Can anybody please help me out?
  13. I implemented a s imilar feature a week ago. All you need to do is draw each object 9 times in different positions. example: [source lang='C++'] draw(pos.x, pos.y); draw(pos.x + ScreenWidth, pos.y); draw(pos.x - ScreenWidth, pos.y); draw(pos.x, pos.y + ScreenHeight); draw(pos.x, pos.y - ScreenHeight); draw(pos.x + ScreenWidth, pos.y + ScreenHeight); draw(pos.x - ScreenWidth, pos.y - ScreenHeight); draw(pos.x + ScreenWidth, pos.y - ScreenHeight); draw(pos.x - ScreenWidth, pos.y + ScreenHeight); You might want to cull out any renderings of the object that are outside of the screen. Also, every time the object's position is outside of the screen, set it's position to pos % resolution.
  14. I could be wrong about this, but I think you need to normalize diffPos before calling atan2.
  15. lol

    Object Creation

    The first one would declare a new instance of Class named object. This instance would be deleted as soon as it goes out of scope (usually when the function returns). The second one creates a new instance of class and place its address in object (assuming object is a pointer). It will not go away until you delete it. BTW, I recommend that you don't name any of your classes "Class". Even though C++ will let you do this, it can be very confusing to other programmers.
  • 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!