Jump to content
  • Advertisement

keltar

Member
  • Content Count

    28
  • Joined

  • Last visited

Community Reputation

133 Neutral

About keltar

  • Rank
    Member
  1. #include <SDL/SDL.h> #include <SDL/SDL_image.h> int main() { SDL_Init(SDL_INIT_VIDEO); while(1) { SDL_Surface *surf = IMG_Load("test.png"); SDL_FreeSurface(surf); } SDL_Quit(); return 0; } I've tested this code, and it doesn't produces memory leaks. What is your OS/SDL version/SDL_image version? What are you doing in Init()?
  2. keltar

    Unreliable Linux GL

    Quote:I'm not loading the extensions using GetProcAddress or dlsym. It's a bad idea. Try to use glew or something other. There is a lot of debugging tools, use them. Bugle is capable to catch every GL-error, launch your program with it (something like "LD_PRELOAD=/usr/lib/libbugle.so" gldb ./your_program", if you have bugle installed).
  3. I think this is a third parameter of glStencilFunc()
  4. keltar

    Loading fonts in linux.

    Use freetype library. But if you want to use Xlib, use something like xset +fp=path/to/font/directory
  5. Make your program with -O0 -ggdb -g3 flags (and if you have gcc with SSP extension, -fstack-protector-all). If program still fails, run it in debugger (on linux, i recommend gdb), and look on backtrace.
  6. Are you sure that your model have correct vertex normals? Which 3d-content creation software you are using? This code just compares triangle normal with vertex normal.
  7. keltar

    multiple glViewports

    I think it should be something like glScissor(_left, _bottom, _width, _height). Scissor box always defined in window coordinates
  8. keltar

    multiple glViewports

    You need to use glScissor And don't forget to enable scissor test
  9. keltar

    Vsync with Linux (SDL+GL)

    Look on nvidia-settings source code. There is NV-CONTROL X-server extension, you can use it to control everything that nvidia-settings does. SDL_GL_SWAP_CONTROL requires GLX_MESA_swap_control extenrion, but nvidia's driver doesn't support it.
  10. IIRC depth is something like pos.z / pos.w, where "pos" is vertex position in clip space (after ModelViewProjection transform).
  11. keltar

    Video Screen Capture

    xvidcap is a good tool for that, i think http://xvidcap.sourceforge.net/
  12. keltar

    gluLookAt and modelview matrix.

    It modify current matrix (defined via glMatrixMode)
  13. keltar

    OpenGL matrix states in Cg

    These params always should be uniform: uniform float4x4 ModelViewProj : state.matrix.mvp You don't need to use cgGLSetStateMatrixParameter if you use ARB-based profile (arbvp1, vp40, etc.)
  14. keltar

    Deferred Shading w/ Shaders in Cg

    Indeed, it can be used with ARB-based profiles, but not in general case. It is profile-specific extention, and it works only with ARB-based profiles (arbvp1, vp40, gp4vp and so on). Sadly, I don't now how to do the same with glslv/glslf profiles. Full list of glstates can be found in ARB_vertex_program and ARB_fragment_program specs.
  15. keltar

    PNG Transparency

    Get color masks from source surface's display format. I believe you produces a lot of memory leaks, look to hint on http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fDisplayFormat
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!