I tested it but seems doesn't work, the 2d font text doesn't rotate!
I'm working on D7 using old borland Opengl header, maybe this is the cause?!
I tried to using DLGOPNEGL header but this cause a lot of errors on init functions that work fine in OPENGL header (I need to work in 2d way on a region(panel) of my application)!
Can someone know a way to use dlgopengl for working in this way (2d on a region), I'm usually use this method and with opengl header work fine:
Code:
fillchar(pfd,SizeOf(pfd),0);
with pfd do begin
nSize := SizeOf(pfd);
nVersion := 1; {The current version of the desccriptor is 1}
dwFlags := PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER;
iPixelType := PFD_TYPE_RGBA;
cColorBits := 24; {support 24-bit color}
cDepthBits := 32; {depth of z-axis}
iLayerType := PFD_MAIN_PLANE;
end;
FglDC := getDC(handle);//the main object is tcustompanel
FormatIndex := ChoosePixelFormat(FglDC,@pfd);
SetPixelFormat(FglDC,FormatIndex,@pfd);
GLContext := wglCreateContext(FglDC);
wglMakeCurrent(FglDC,GLContext);
//glEnable(GL_LINE_SMOOTH); //Antialaising ON
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glViewPort(0,0,ClientWidth,ClientHeight);
glMatrixMode(GL_PROJECTION); // Change Matrix Mode to Projection
glLoadIdentity();
gluOrtho2D(0.0,ClientWidth,ClientHeight,0.0);
glMatrixMode(GL_MODELVIEW); // Return to the modelview matrix
Bookmarks