Why reinvent the wheel? My GLEngine is a fully working opengl window component. At least if you don't want to use it, you can see some points from source. It uses window component more abstract than TPanel for efficiency reasons.

http://www.freewebs.com/loknar/