home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-10-10 | 1.8 KB | 82 lines |
- import java.awt.*;
- import java.applet.*;
- import com.ms.com.*;
- import com.ms.com.*;
- import com.ms.awt.*;
- import com.ms.awt.peer.*;
- import com.ms.directX.*;
-
- class FlickViewer implements Runnable, ddConstants
- {
- private Thread t;
- private boolean running = true;
-
- public boolean left_drag = false;
- public boolean right_drag = false;
-
- AppInfo active_window;
- SelectionDude sel;
-
- //////////////////////////////////////////////////////////////////////////
-
- public FlickViewer(int p, AppInfo info, SelectionDude s)
- {
- active_window = info;
- sel = s;
-
- t = new Thread(this);
- t.setPriority(p);
-
- }
-
- //////////////////////////////////////////////////////////////////////////
-
- public void run()
- {
- while(running)
- {
- Idle();
- Render();
- }
- }
-
- //////////////////////////////////////////////////////////////////////////
-
- public void stop()
- {
- }
-
- //////////////////////////////////////////////////////////////////////////
-
- public void start()
- {
- t.start();
- }
-
- //////////////////////////////////////////////////////////////////////////
-
- int Render()
- {
- active_window.scene.Move(1.0F);
- active_window.view.Clear();
- active_window.view.Render(active_window.scene);
- active_window.dev.Update();
- return 1;
- }
-
- //////////////////////////////////////////////////////////////////////////
-
- void Idle()
- {
- d3drmFrame selected = sel.SelectedFrame();
-
- if (left_drag && (selected != null))
- selected.SetRotation(active_window.scene, 0.0F, 1.0F, 0.0F, 0.0F);
-
- if (right_drag && (selected != null))
- selected.SetVelocity(active_window.scene, 0.0F, 0.0F, 0.0F, 0);
- }
-
- //////////////////////////////////////////////////////////////////////////
- }
-