1. What is a C2D 2.6?Originally Posted by andygfx
2. That link is where the latest build is kept. So what you installed should be fine.
1. What is a C2D 2.6?Originally Posted by andygfx
2. That link is where the latest build is kept. So what you installed should be fine.
Core 2 Duo x6700 2.6MHz sorry it was bad shortcut
Yes latest JEDI work fine
Now i try fix problem with mouse delta for freelook, because if VSync is ON the is speed OK, but if is OFF is slow. I think that i must calc Delta Tick Count for correct calc on different FPS. I any tutorial about TickCount and movement?
Currently i have my timer helper class writed so:
Code:unit F3D_Timer; {******************************************************************************} { F3D_TIMER: {******************************************************************************} interface uses gl,sdl; type TProcedureEvent = procedure of object; { The type of event that is called by the timer. } Type TF3D_TimerEvent = procedure(Sender: TObject; FrameTime: Single) of object; Type TF3D_Timer = class private m_lastTick : integer; m_fpsDuration : single; m_fpsFrames : integer; m_fps : integer; ElapsedTime:single; public constructor Create(); destructor Destroy; function GetElapsedTime: Single; function GetTickCount: Integer; function GetFPS: Integer; procedure Update(); end; implementation uses F3Dlib; {******************************************************************************} { F3D_TIMER: {******************************************************************************} constructor TF3D_Timer.Create(); begin inherited Create; m_lastTick := 0; end; {******************************************************************************} { F3D_TIMER: {******************************************************************************} destructor TF3D_Timer.Destroy; begin inherited destroy; end; {******************************************************************************} { F3D_TIMER: {******************************************************************************} function TF3D_Timer.GetFPS: Integer; begin result:=self.m_fps; end; {******************************************************************************} { F3D_TIMER: {******************************************************************************} function TF3D_Timer.GetTickCount: Integer; begin result:=m_lastTick; end; {******************************************************************************} { F3D_TIMER: {******************************************************************************} function TF3D_Timer.GetElapsedTime: Single; begin result:=ElapsedTime*100; end; {******************************************************************************} { F3D_TIMER: {******************************************************************************} procedure TF3D_Timer.Update; var tick : integer; begin // get the current tick value tick := SDL_GetTicks; // calculate the amount of elapsed seconds ElapsedTime := ( tick - m_lastTick ) / 1000.0; if ElapsedTime = 0 then exit; // adjust fps counter m_fpsDuration := m_fpsDuration + ElapsedTime; if ( m_fpsDuration >= 1.0 ) then begin m_fps := round( m_fpsFrames / m_fpsDuration ); m_fpsDuration := 0.0; m_fpsFrames := 0; end; m_lastTick := tick; inc( m_fpsFrames ); glFlush(); end; end.
C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate
I'm sure I had implemented this at some point. But maybe I over wrote it. I'll try and check it in tonight after I compare what I currently have.Originally Posted by technomage
OK. THX. I will continue on F3D in tonight too (>22:00 CET ) If i don't forget, I switch my ICQ ON.
Now i must go play with my little daughter (she has 7 month) ....
C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate
Just now i one hour find which extension i need for ARB vertex/fragment shader
for this now i have:
// reset
if (ProgramObject <> 0) then glDeleteObjectARB(ProgramObject);
if (VertexShaderObject <> 0) then glDeleteObjectARB(VertexShaderObject);
if (FragmentShaderObject <> 0) then glDeleteObjectARB(FragmentShaderObject);
for this i can't find neede extension:
// create
ProgramObject := glCreateProgramObjectARB();
VertexShaderObject := glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
FragmentShaderObject := glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate
hehe. I have now all needed.
'GL_ARB_vertex_program',
'GL_ARB_vertex_shader',
'GL_ARB_fragment_shader',
'GL_ARB_shader_objects',
'GL_ARB_shading_language_100',
C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate
New release ver. 0.09 with billboard sample / GLSL shader
Features:
WinXP x86/ Vista x64 / Linux (not tested)
OpenGL 2.0
SDL lib
pascal language
Viewport class
HUD class
Texture Factory class (currently is used DevIL lib)
Font class
Font Manager class (accept Nitrogen Font Studio 4 file - tga/composit)
Image Manager class (will be used for GUI)
SDL Input control class
Movement control class
Camera class
Billboard Manager (new)
Material manager (new)
Material Event Manager (new)
Surface Manager (new)
GLSL (new)
Shader Manager (new)
ToDo:
Skined GUI
GUI Manager
Scene loader
VBO class
LUA wrapper for all classes
Sprite2D/3D Manager
Documentation
SRC/BIN from http://final3d.intelligentdevelopment.sk/
C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate
I see you've written your own control class. Are you aware that JEDI-SDL ships with it's own SDL Input Manager that should handle Keyboard, Mouse and Joysticks. Have a look at sdlinput.pas. It may save you some time.
[1]
It's not fully true, because my Input class is only simple extension on existinng SDLInput.
Code:type TF3D_Input = class private delta : TF3D_Vector2f; old_pos : TPoint; Manager : TSDLInputManager; public constructor create; destructor destroy; procedure Update(); function IsKeyDown(key:integer):boolean; function IsButtonDown(btn:integer):boolean; function IsKeyUp(key:integer):boolean; procedure ShowInfo(sx: integer; sy: integer); function GetMouseDelta:TF3D_Vector2f; end; implementation uses F3Dlib; {******************************************************************************} { F3D INPUT CONTROL: {******************************************************************************} constructor TF3D_Input.create; begin inherited create; Manager := TSDLInputManager.Create([itKeyBoard, itMouse, itJoystick]); end; {******************************************************************************} { F3D INPUT CONTROL: {******************************************************************************} destructor TF3D_Input.destroy; begin inherited destroy; end; {******************************************************************************} { F3D INPUT CONTROL: {******************************************************************************} procedure TF3D_Input.Update(); var dx,dy:integer; begin SDL_GetRelativeMouseState(dx,dy); delta.x := dx; delta.y := dy; self.Manager.UpdateInputs(F3D.SDL.event); end; {******************************************************************************} { F3D INPUT CONTROL: KEY DOWN {******************************************************************************} function TF3D_Input.IsKeyDown(key:integer):boolean; begin if self.Manager.KeyBoard.IsKeyDown(key) then result:=true else result:=false; end; {******************************************************************************} { F3D INPUT CONTROL: MOUSE BUTTON DOWN {******************************************************************************} function TF3D_Input.IsButtonDown(btn:integer):boolean; begin if self.Manager.Mouse.MouseIsDown(btn) then result:=false else result:=true; end; {******************************************************************************} { F3D INPUT CONTROL: KEY UP {******************************************************************************} function TF3D_Input.IsKeyUp(key:integer):boolean; begin if self.Manager.KeyBoard.IsKeyDown(key) then result:=true else result:=false; end; {******************************************************************************} { F3D INPUT CONTROL: Get Delta mouse move {******************************************************************************} function TF3D_Input.GetMouseDelta:TF3D_Vector2f; begin result:=self.delta; end; {******************************************************************************} { F3D INPUT CONTROL: DrawINFO {******************************************************************************} procedure TF3D_Input.ShowInfo(sx: integer; sy: integer); var BTN_0, BTN_1, BTN_2: integer; WHEEL_UP,WHEEL_DOWN:integer; begin if (not F3D.Config.use_infoscreen) then exit; glDisable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glColor4f(0, 0, 0, 0.5); F3D.Draw.Rectangle(sx - 8, sy - 4, sx + 256 + 16, sy + 84); glDisable(GL_BLEND); BTN_0 := 0; if self.Manager.Mouse.MouseIsUp(SDL_BUTTON_LEFT) then BTN_0 := 1; BTN_1 := 0; if self.Manager.Mouse.MouseIsUp(SDL_BUTTON_MIDDLE) then BTN_1 := 1; BTN_2 := 0; if self.Manager.Mouse.MouseIsUp(SDL_BUTTON_RIGHT) then BTN_2 := 1; WHEEL_UP:=0; WHEEL_DOWN:=0; if self.Manager.Mouse.MouseIsDown(SDL_BUTTON_WHEELUP) then WHEEL_UP := 1; // ?????????? if self.Manager.Mouse.MouseIsDown(SDL_BUTTON_WHEELDOWN) then WHEEL_DOWN := 1; // ?????????? glDisable(GL_BLEND); F3D.Hud.SetFontColor('CourierNew', SetColor4f(1, 0.5, 0, 1)); F3D.Hud.Print('CourierNew', sx, sy + 13 * 0, 'MOUSE CONTROL:'); F3D.Hud.SetFontColor('CourierNew', SetColor4f(1, 1, 1, 1)); F3D.Hud.Print('CourierNew', sx, sy + 13 * 1, format('MOUSE DELTA : %8.4f %8.4f ', [self.delta.x,self.delta.y])); F3D.Hud.Print('CourierNew', sx, sy + 13 * 2, format('MOUSE POS : %4d %4d ', [self.Manager.Mouse.MousePosition.X, self.Manager.Mouse.MousePosition.Y])); F3D.Hud.Print('CourierNew', sx, sy + 13 * 3, format('MOUSE BTN : [%1d][%1d][%1d] ', [BTN_0, BTN_1, BTN_2])); F3D.Hud.Print('CourierNew', sx, sy + 13 * 4, format('MOUSE WHEEL UP : [%1d] ', [WHEEL_UP])); F3D.Hud.Print('CourierNew', sx, sy + 13 * 5, format('MOUSE WHEEL DW : [%1d] ', [WHEEL_DOWN])); end; end.
[2]
I found problem with mouse delta and LAG values answer i found in vry good document which help me. Here is part:
Timers
Timers are not something every game uses so you might be wondering why I’m covering them in this article. Trying to get SDL timers to work caused me a lot of aggravation and I spent hours trying to figure out what the problem was. I’m writing about SDL timers to save you the aggravation I went through.
A timer is a function the operating system calls periodically. You get to specify how often the timer fires, which is how often the operating system calls the timer. Use a timer when you want to do something repeatedly in your program at regular time intervals.
... now i have implemented USER TIMER and all is OK. Tonight will be released as ver 0.10
part of code:
[3]Code:function SDLLoop(interval: Uint32; param: Pointer ): Integer; var event:TSDL_Event; begin event.type_ := SDL_USEREVENT; event.user.code := RUN_FINAL3D_LOOP; event.user.data1 :=0; event.user.data2 :=0; SDL_PushEvent(@event); result := interval; end; .... // initialize timer SDL_Init(SDL_INIT_TIMER); self.Timer := SDL_AddTimer(20,@SDLLoop,nil); .... begin F3D := TF3D.Create(); F3D.Initialize(); APP_DO_INIT(); Done := False; while ( not Done ) do begin while ( SDL_PollEvent( @F3D.SDL.event ) = 1 ) do begin case F3D.SDL.event.type_ of SDL_QUITEV : Done := true; SDL_USEREVENT : begin APP_DO_LOOP( F3D.SDL.event.user.code); end; end; end; end; SDL_QUIT; Halt(0); end. .... procedure APP_DO_LOOP( code : integer ); begin case code of RUN_FINAL3D_LOOP : APP_DO_RENDER(); end; end;
WHEEL_UP and WHEEL_DOWN return always 1 ((
C2D X6800, 4GBRAM, NV8800GTX, Vista x64 Ultimate
Bookmarks