Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Making my own OpenGL, what to do about wgl* entrypoints?

Making my own OpenGL, what to do about wgl* entrypoints?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpgraphicsgame-devdebugging
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maxmaven
    wrote on last edited by
    #1

    I'm building an opengl "spy" utility to capture opengl calls. I compiled my own DLL and called it opengl32.dll. The DLL exports entrypoints for most of the OpenGL calls as follows: typedef void (*glEnable_TYPE)(int cap); void glEnable(int cap) { glEnable_TYPE GL_glEnable; // returns a handle to the DLL, otherwise NULL hMod = LoadLibrary("C:/windows/system32/opengl32.DLL"); // returns the address of the DLL function, otherwise NULL GL_glEnable = (glEnable_TYPE) GetProcAddress(hMod, "glEnable"); GL_glEnable(cap); } The problem is, I cannot get the wgl entrypoints (wglMakeCurrent, etc.) to work. Either I include these in my opengl, in which case visual c++ reports: error C2491: 'wglMakeCurrent' : definition of dllimport function not allowed Or, if I do not include a definition of these functions, I get: error LNK2001: unresolved external symbol wglMakeCurrent Debug/opengl32.lib : fatal error LNK1120: 1 unresolved externals LINK : fatal error LNK1141: failure during build of exports file What can I do?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups