Рассылка закрыта
При закрытии подписчики были переданы в рассылку "Программирование в Delphi" на которую и рекомендуем вам подписаться.
Вы можете найти рассылки сходной тематики в Каталоге рассылок.
СообЧА. Программирование на Delphi
Информационный Канал Subscribe.Ru |
===СообЧа: Программирование на дельфи для чайников
и не только===
|
|
Автор рассылки: Pixel
. Наш веб-сайт pixelsoft.narod.ru |
Обзор литературы ЛЮЮЮДИ !!!! ПОМОГИТЕ С ФРАКТАЛАМИ ! |
Ведущий рассылки, также предоставляет
следующие услуги: |
К заголовку | |
А теперь снова наш рекламный пунктик... ой, всмысле обзор. На сей раз хотел бы представить вам тот список лит-ры, который необходимо
прочесть для овладевания БАЗОВЫМИ навыками по дельфи: |
К заголовку | |
Данный код требует FastLIB VCL, очень неплох для любителей повыпендриваться и демомейкеров... К сожалению, без файла с ресурсами будет крутиться надпиь "Picture or resource not found" , так что поковыряйтесь с картинкой не поленитесь, оно того стоит... Набор классов FastLib Библиотека для работы с растровой графикой. Проверялся на Delphi 3,5 Оригинал: http://www.gfody.com/ Delphi GFX - все о создании игр и графике на Delphi http://www.delphigfx.narod.ru
program rotozoom; // example for FastLIB http://gfody.com uses var const procedure UpdateFrame; xd:=((Src.Width shl 16)-(Dst.Width shl 16))div 2; isin:=Round(Sin(Cos(i/90)*15)*65536); ax:=(cx shl 16)-(icos*cx); pc:=Pointer(Dst.Bits); Str(Fps,s); if Motion then Inc(Frames); procedure FillModTable; function WindowProc(hWnd,uMsg,wParam,lParam:Longint):Longint; stdcall; WM_KEYDOWN: WM_LBUTTONDOWN: WM_RBUTTONDOWN: WM_DESTROY: WM_PAINT: WM_SIZE: WM_TIMER: else Result:=DefWindowProc(hWnd,uMsg,wParam,lParam); begin if HasJPG then LoadJPGRes(Src,hInstance,'sunghi1','binary',True) else Blur:=TFastDIB.Create; Dst:=TFastDIB.Create; hDC:=GetDC(Handle); Handle:=CreateWindow('#32770','rotozoom - gordy', SetWindowLong(Handle,GWL_WNDPROC,Longint(@WindowProc)); SetTimer(Handle,0,1000,nil); while Msg.Message<>WM_QUIT do end. |
К заголовку | |
К данной программке нужен файл tunnel.bmp, размером 128х128 ... Приложение окна не имеет(создает его OpenGL контекстом), поэтому всего 63к в рамере... //------------------------------------------------------------------------ uses const TEXTURE_SPEED = 1/50; type glCoord = Record h_Wnd : HWND; // Global window handle // Textures // User vaiables {$R *.RES} procedure glBindTexture(target: GLenum; texture: GLuint); stdcall; external opengl32; {------------------------------------------------------------------}
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); // Clear The Screen
And The Depth Buffer glTranslatef(0.0,0.0,-4.2); if Manual then // setup tunnel coordinates for I :=0 to 12 do Tunnels[I, J].X :=(3 - J/12)*cos(2*pi/12*I) + 2*sin((Angle+2*j)/29)
+ cos((Angle+2*j)/13) - 2*sin(Angle/29) - cos(Angle/13); end; // draw tunnel // near the end of the tunnel, fade the effect away
glClearColor(0.0, 0.0, 0.0, 0.0); // Black Background glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Realy Nice perspective calculations glEnable(GL_TEXTURE_2D); // Enable Texture Mapping LoadTexture('tunnel.bmp', TunnelTex); Speed :=0;
glMatrixMode(GL_MODELVIEW); // Return to the modelview matrix
if (keys[VK_DOWN]) then
if Fullscreen then // Change back to non fullscreen // Makes current rendering context not current, and releases the device // Attempts to delete the rendering context // Attemps to release the device context // Attempts to destroy the window // Attempts to unregister the window class
with wndClass do // Set up the window class if (RegisterClass(wndClass) = 0) then // Attemp to register the window
class // Change to fullscreen if so desired // Try to change screen mode to fullscreen // If we are still in fullscreen then // Attempt to create the actual window // Try to get a device context // Settings for the OpenGL window // Attempts to find the pixel format supported by a device context that
is the best match to a given pixel format specification. // Sets the specified device context's pixel format to the format specified
by the PixelFormat. // Create a OpenGL rendering context // Makes the specified OpenGL rendering context the calling thread's
current rendering context // Initializes the timer used to calculate the FPS // Settings to ensure that the window is the topmost window // Ensure the OpenGL window is resized properly Result := True;
// Perform application initialization: DemoStart := GetTickCount(); // Get Time when demo started // Main message loop: LastTime :=ElapsedTime; glDraw(); // Draw the scene if (keys[VK_ESCAPE]) then // If user pressed ESC then set finised TRUE
ниже модуль для загрузки картинок... //----------------------------------------------------------------------------// // Author : Jan Horn // Email : jhorn@global.co.za // Website : http://home.global.co.za/~jhorn // Date : 8 April 2001 // Description : A unit that used with OpenGL projects to load BMP files // Usage : LoadTexture(BMPFilename, TextureName); // eg : LoadTexture('logo.bmp', LogoTex); // //---------------------------------------------------------------------------- unit BMP; interface uses function LoadTexture(Filename: String; var Texture: GLuint): Boolean; implementation
// Get header information // Get palette Width := InfoHeader.biWidth; // Get the actual pixel data // Bitmaps are stored BGR and not RGB, so swap the R and B bytes.
if (Assigned(pData)) then glGenTextures(1, Texture); { Select a filtering type. BiLinear filtering produces very good results
with little performance impact glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); {
only first two can be used } gluBuild2DMipmaps(GL_TEXTURE_2D, 3, Width, Height, GL_RGB, GL_UNSIGNED_BYTE,
pData);
|
http://subscribe.ru/
E-mail: ask@subscribe.ru |
Отписаться
Убрать рекламу |
В избранное | ||