急!急!!急!!! 在线等待,求Delphi用Driect和OpenGL的源代码。每个80分(160分)

  • 主题发起人 主题发起人 sim_might
  • 开始时间 开始时间
S

sim_might

Unregistered / Unconfirmed
GUEST, unregistred user!
求Delphi用Driect和OpenGL的源代码。
每个80分。
 
Delphi用Driect 一般是用 DelphiX 控件,很多网站都有如:www.playicq.com
Delphi用OpenGL 不清楚:(

 
http://kuga.51.net/download/index.htm
http://www.playicq.com/dispdoc.php?t=&id=1144
http://www.playicq.com/dispdoc.php?t=&id=1315
http://www.playicq.com/dispdoc.php?t=&id=1936
http://www.playicq.com/dispdoc.php?t=&id=538
http://www.playicq.com/dispdoc.php?t=&id=537
http://www.playicq.com/dispdoc.php?t=&id=1422
....
 
OpenGL:

http://www.delphibbs.com/delphibbs/dispq.asp?lid=837950
http://www.delphibbs.com/delphibbs/dispq.asp?lid=846333

 
留下EMAIL,我给你发源码!
我的cdyxl@163.com
 
to:
cdyxl 大虾
给我一个OpenGL的材质例子吧。有水波之类的特效更好。
如有OpenGL的中文函数库。 我另献50分。
sim_might

 
自己到网上找
 
已经给你发了,请查收!
顺便问一下,你做什么东东啊?
有空聊聊!MSN: gz_oscar@msn.com
 
给你一个最简单的例子
unit OPENGL1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,OpenGL;

type
TForm1 = class(TForm)
procedure FormDestroy(Sender: TObject);
procedure FormPaint(Sender: TObject);
procedure FormShow(Sender: TObject);
private
DC:HDC;
RC:HGLRC;
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormDestroy(Sender: TObject);
begin
wglMakeCurrent(0,0);
wglDeleteContext(RC);
DeleteObject(DC);
end;

procedure TForm1.FormPaint(Sender: TObject);
begin
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3b(127,0,0);
glVertex3f(0.5,0.5,0);
glColor3b(0,127,0);
glVertex3f(-0.5,0.5,0);
glColor3b(0,0,127);
glVertex3f(-0.5,-0.5,0);
glColor3b(127,127,127);
glVertex3f(0.5,-0.5,0);
glEnd();
SwapBuffers(DC);
end;

procedure TForm1.FormShow(Sender: TObject);
var
PFD:TPixelFormatDescriptor;
ChosenPixelFormat:integer;
begin
DC:=GetDc(self.Handle);
FillChar(PFD,SizeOf(TPixelFormatDescriptor),0);
with PFD do
begin
nsize:=SizeOf(TpixelFormatDescriptor);
nVersion:=1;
dwFlags:=PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER;
iPixelType:=PFD_TYPE_RGBA;
cColorBits:=24;
cDepthbits:=32;
iLayerType:=PFD_MAIN_PLANE;
end;
ChosenPixelFormat:=ChoosePixelFormat(DC,@PFD);
if ChosenPixelFormat=0 then Raise Exception.Create('ChoosePixelFormat failed!');
SetPixelFormat(DC,ChosenPixelFormat,@PFD);
RC:=wglCreateContext(DC);
wglMakeCurrent(DC,RC);
end;

end.
 
我买到一本用Delphi住OpenGL的专箸了。放分, 感谢各位的帮助。
 
后退
顶部