Changing texture/render mode at runtime 
Author Message
 Changing texture/render mode at runtime

Hello,

Does anyone have any experience changing the
texture mode and render mode during runtime?

I want to set the SetTextureQuality to be mipmapped
when I am near an object.

I do the following commands below but the scene
fails to recognize this.

D3D_Device.SetTextureQuality D3DRMTEXTURE_LINEAR       ' Set the texture
quality
D3D_Device.SetRenderMode D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR    ' Set the
render mode

Thanks,
Adam



Fri, 02 Sep 2005 05:11:51 GMT  
 Changing texture/render mode at runtime
this sounds like you are mixing retained mode with immediate mode.


Quote:
> Hello,

> Does anyone have any experience changing the
> texture mode and render mode during runtime?

> I want to set the SetTextureQuality to be mipmapped
> when I am near an object.

> I do the following commands below but the scene
> fails to recognize this.

> D3D_Device.SetTextureQuality D3DRMTEXTURE_LINEAR       ' Set the texture
> quality
> D3D_Device.SetRenderMode D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR    ' Set
the
> render mode

> Thanks,
> Adam



Sat, 03 Sep 2005 09:05:16 GMT  
 Changing texture/render mode at runtime
Phil,

The scene is setup as follows.

So yes it's retained mode.

How I would enter immediate mode so changes take affect during run-time?

Adam

**********

'Setup the class priority
  SetPriorityClass GetCurrentProcess(), NORMAL_PRIORITY_CLASS
  'Setup the thread priority
  SetThreadPriority GetCurrentThread(), THREAD_BASE_PRIORITY_MAX

  'Set initial draw distance value user value
  EngineViewDistance = DefaultViewDistance

  Set DD_Main = DX_Main.DirectDraw4Create("") ' Create the DirectDraw object

  DD_Main.SetCooperativeLevel frmMain.hWnd, DDSCL_FULLSCREEN Or
DDSCL_EXCLUSIVE ' Set the screen mode (full screen)
  DD_Main.SetDisplayMode 1280, 1024, 32, 0, DDSDM_DEFAULT    ' Set
Resolution and BitDepth (Lets use 32-bit color)

  SD_Front.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT
  SD_Front.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Or DDSCAPS_3DDEVICE Or
DDSCAPS_COMPLEX Or DDSCAPS_FLIP Or DDSCAPS_VIDEOMEMORY
  SD_Front.lBackBufferCount = 3   ' Make one backbuffer
  Set DS_Front = DD_Main.CreateSurface(SD_Front) ' Initialize the front
buffer (the screen)
  ' The Previous block of code just created the screen and the backbuffer.

  DD_Back.lCaps = DDSCAPS_BACKBUFFER
  Set DS_Back = DS_Front.GetAttachedSurface(DD_Back)
  DS_Back.SetForeColor RGB(255, 255, 255)
  ' The backbuffer was initialized and the DirectDraw text color was set to
white.

  Set D3D_Main = DX_Main.Direct3DRMCreate() ' Creates the Direct3D Retained
Mode Object

  Set D3D_Device =
D3D_Main.CreateDeviceFromSurface("IID_IDirect3DHALDevice", DD_Main, DS_Back,
D3DRMDEVICE_DEFAULT)  ' Tell the Direct3D Device that we are using hardware
rendering (HALDevice)

  '3D_Device.SetBufferCount 128   ' Set the number of buffers
  D3D_Device.SetQuality D3DRMSHADE_GOURAUD Or D3DRMRENDER_GOURAUD  ' Set the
rendering quality. GOURAUD has the best rendering quality.
  D3D_Device.SetTextureQuality D3DRMTEXTURE_NEAREST     ' Set the texture
quality
  D3D_Device.SetRenderMode D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR    ' Set
the render mode

  Set DI_Main = DX_Main.DirectInputCreate() ' Create the DirectInput Device
  Set DI_Device = DI_Main.CreateDevice("GUID_SysKeyboard") ' Set it to use
the keyboard.
  DI_Device.SetCommonDataFormat DIFORMAT_KEYBOARD ' Set the data format to
the keyboard format
  DI_Device.SetCooperativeLevel frmMain.hWnd, DISCL_BACKGROUND Or
DISCL_NONEXCLUSIVE  ' Set Cooperative level
  DI_Device.Acquire
  ' The above block of code configures the DirectInput Device and starts it.

  'Set scene font
  Set EngineFont = frmMain.Font
  DS_Front.SetFont EngineFont
  DS_Front.SetForeColor 1

  'Set up/down camera default position (0 = camera pointing straight)
  LookLimit = DefaultLookLimit

  Exit Sub



Quote:
> this sounds like you are mixing retained mode with immediate mode.



> > Hello,

> > Does anyone have any experience changing the
> > texture mode and render mode during runtime?

> > I want to set the SetTextureQuality to be mipmapped
> > when I am near an object.

> > I do the following commands below but the scene
> > fails to recognize this.

> > D3D_Device.SetTextureQuality D3DRMTEXTURE_LINEAR       ' Set the texture
> > quality
> > D3D_Device.SetRenderMode D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR    ' Set
> the
> > render mode

> > Thanks,
> > Adam



Sat, 03 Sep 2005 01:37:37 GMT  
 Changing texture/render mode at runtime
does the device indicate support for those caps in the caps viewer?

does the debug runtime output indicate any issues? you can turn on debug
runtime output for RM in either the win.ini or system.ini file, I believe
its in the docs.


Quote:
> Phil,

> The scene is setup as follows.

> So yes it's retained mode.

> How I would enter immediate mode so changes take affect during run-time?

> Adam

> **********

> 'Setup the class priority
>   SetPriorityClass GetCurrentProcess(), NORMAL_PRIORITY_CLASS
>   'Setup the thread priority
>   SetThreadPriority GetCurrentThread(), THREAD_BASE_PRIORITY_MAX

>   'Set initial draw distance value user value
>   EngineViewDistance = DefaultViewDistance

>   Set DD_Main = DX_Main.DirectDraw4Create("") ' Create the DirectDraw
object

>   DD_Main.SetCooperativeLevel frmMain.hWnd, DDSCL_FULLSCREEN Or
> DDSCL_EXCLUSIVE ' Set the screen mode (full screen)
>   DD_Main.SetDisplayMode 1280, 1024, 32, 0, DDSDM_DEFAULT    ' Set
> Resolution and BitDepth (Lets use 32-bit color)

>   SD_Front.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT
>   SD_Front.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Or DDSCAPS_3DDEVICE Or
> DDSCAPS_COMPLEX Or DDSCAPS_FLIP Or DDSCAPS_VIDEOMEMORY
>   SD_Front.lBackBufferCount = 3   ' Make one backbuffer
>   Set DS_Front = DD_Main.CreateSurface(SD_Front) ' Initialize the front
> buffer (the screen)
>   ' The Previous block of code just created the screen and the backbuffer.

>   DD_Back.lCaps = DDSCAPS_BACKBUFFER
>   Set DS_Back = DS_Front.GetAttachedSurface(DD_Back)
>   DS_Back.SetForeColor RGB(255, 255, 255)
>   ' The backbuffer was initialized and the DirectDraw text color was set
to
> white.

>   Set D3D_Main = DX_Main.Direct3DRMCreate() ' Creates the Direct3D
Retained
> Mode Object

>   Set D3D_Device =
> D3D_Main.CreateDeviceFromSurface("IID_IDirect3DHALDevice", DD_Main,
DS_Back,
> D3DRMDEVICE_DEFAULT)  ' Tell the Direct3D Device that we are using
hardware
> rendering (HALDevice)

>   '3D_Device.SetBufferCount 128   ' Set the number of buffers
>   D3D_Device.SetQuality D3DRMSHADE_GOURAUD Or D3DRMRENDER_GOURAUD  ' Set
the
> rendering quality. GOURAUD has the best rendering quality.
>   D3D_Device.SetTextureQuality D3DRMTEXTURE_NEAREST     ' Set the texture
> quality
>   D3D_Device.SetRenderMode D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR    ' Set
> the render mode

>   Set DI_Main = DX_Main.DirectInputCreate() ' Create the DirectInput
Device
>   Set DI_Device = DI_Main.CreateDevice("GUID_SysKeyboard") ' Set it to use
> the keyboard.
>   DI_Device.SetCommonDataFormat DIFORMAT_KEYBOARD ' Set the data format to
> the keyboard format
>   DI_Device.SetCooperativeLevel frmMain.hWnd, DISCL_BACKGROUND Or
> DISCL_NONEXCLUSIVE  ' Set Cooperative level
>   DI_Device.Acquire
>   ' The above block of code configures the DirectInput Device and starts
it.

>   'Set scene font
>   Set EngineFont = frmMain.Font
>   DS_Front.SetFont EngineFont
>   DS_Front.SetForeColor 1

>   'Set up/down camera default position (0 = camera pointing straight)
>   LookLimit = DefaultLookLimit

>   Exit Sub



> > this sounds like you are mixing retained mode with immediate mode.



> > > Hello,

> > > Does anyone have any experience changing the
> > > texture mode and render mode during runtime?

> > > I want to set the SetTextureQuality to be mipmapped
> > > when I am near an object.

> > > I do the following commands below but the scene
> > > fails to recognize this.

> > > D3D_Device.SetTextureQuality D3DRMTEXTURE_LINEAR       ' Set the
texture
> > > quality
> > > D3D_Device.SetRenderMode D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR    '
Set
> > the
> > > render mode

> > > Thanks,
> > > Adam



Sun, 04 Sep 2005 10:33:05 GMT  
 Changing texture/render mode at runtime
It's being run on Direct8 compliant hardware.

Do you know where to still download DirectX7 SDK? I only
have version 8 SDK. I can't find it to be on the MSDN website.

Thanks,
Adam



Quote:
> does the device indicate support for those caps in the caps viewer?

> does the debug runtime output indicate any issues? you can turn on debug
> runtime output for RM in either the win.ini or system.ini file, I believe
> its in the docs.



> > Phil,

> > The scene is setup as follows.

> > So yes it's retained mode.

> > How I would enter immediate mode so changes take affect during run-time?

> > Adam

> > **********

> > 'Setup the class priority
> >   SetPriorityClass GetCurrentProcess(), NORMAL_PRIORITY_CLASS
> >   'Setup the thread priority
> >   SetThreadPriority GetCurrentThread(), THREAD_BASE_PRIORITY_MAX

> >   'Set initial draw distance value user value
> >   EngineViewDistance = DefaultViewDistance

> >   Set DD_Main = DX_Main.DirectDraw4Create("") ' Create the DirectDraw
> object

> >   DD_Main.SetCooperativeLevel frmMain.hWnd, DDSCL_FULLSCREEN Or
> > DDSCL_EXCLUSIVE ' Set the screen mode (full screen)
> >   DD_Main.SetDisplayMode 1280, 1024, 32, 0, DDSDM_DEFAULT    ' Set
> > Resolution and BitDepth (Lets use 32-bit color)

> >   SD_Front.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT
> >   SD_Front.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Or DDSCAPS_3DDEVICE Or
> > DDSCAPS_COMPLEX Or DDSCAPS_FLIP Or DDSCAPS_VIDEOMEMORY
> >   SD_Front.lBackBufferCount = 3   ' Make one backbuffer
> >   Set DS_Front = DD_Main.CreateSurface(SD_Front) ' Initialize the front
> > buffer (the screen)
> >   ' The Previous block of code just created the screen and the
backbuffer.

> >   DD_Back.lCaps = DDSCAPS_BACKBUFFER
> >   Set DS_Back = DS_Front.GetAttachedSurface(DD_Back)
> >   DS_Back.SetForeColor RGB(255, 255, 255)
> >   ' The backbuffer was initialized and the DirectDraw text color was set
> to
> > white.

> >   Set D3D_Main = DX_Main.Direct3DRMCreate() ' Creates the Direct3D
> Retained
> > Mode Object

> >   Set D3D_Device =
> > D3D_Main.CreateDeviceFromSurface("IID_IDirect3DHALDevice", DD_Main,
> DS_Back,
> > D3DRMDEVICE_DEFAULT)  ' Tell the Direct3D Device that we are using
> hardware
> > rendering (HALDevice)

> >   '3D_Device.SetBufferCount 128   ' Set the number of buffers
> >   D3D_Device.SetQuality D3DRMSHADE_GOURAUD Or D3DRMRENDER_GOURAUD  ' Set
> the
> > rendering quality. GOURAUD has the best rendering quality.
> >   D3D_Device.SetTextureQuality D3DRMTEXTURE_NEAREST     ' Set the
texture
> > quality
> >   D3D_Device.SetRenderMode D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR    '
Set
> > the render mode

> >   Set DI_Main = DX_Main.DirectInputCreate() ' Create the DirectInput
> Device
> >   Set DI_Device = DI_Main.CreateDevice("GUID_SysKeyboard") ' Set it to
use
> > the keyboard.
> >   DI_Device.SetCommonDataFormat DIFORMAT_KEYBOARD ' Set the data format
to
> > the keyboard format
> >   DI_Device.SetCooperativeLevel frmMain.hWnd, DISCL_BACKGROUND Or
> > DISCL_NONEXCLUSIVE  ' Set Cooperative level
> >   DI_Device.Acquire
> >   ' The above block of code configures the DirectInput Device and starts
> it.

> >   'Set scene font
> >   Set EngineFont = frmMain.Font
> >   DS_Front.SetFont EngineFont
> >   DS_Front.SetForeColor 1

> >   'Set up/down camera default position (0 = camera pointing straight)
> >   LookLimit = DefaultLookLimit

> >   Exit Sub



> > > this sounds like you are mixing retained mode with immediate mode.


message

> > > > Hello,

> > > > Does anyone have any experience changing the
> > > > texture mode and render mode during runtime?

> > > > I want to set the SetTextureQuality to be mipmapped
> > > > when I am near an object.

> > > > I do the following commands below but the scene
> > > > fails to recognize this.

> > > > D3D_Device.SetTextureQuality D3DRMTEXTURE_LINEAR       ' Set the
> texture
> > > > quality
> > > > D3D_Device.SetRenderMode D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR    '
> Set
> > > the
> > > > render mode

> > > > Thanks,
> > > > Adam



Sat, 03 Sep 2005 21:32:19 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Texture Rendering

2. Rendering on textures?

3. Form size changes in runtime vs design time modes

4. Retained Mode, Textures and Hardware Acceleration

5. Retained Mode problem loading textures

6. alpha blending textures in Retaind Mode

7. textures in retained mode

8. Differences between Runtime mode and Dev Mode

9. IDE Mode vs Runtime Mode

10. Hardware rendering in window mode

11. Programatically changing Form from Data Entry mode to Edit mode

12. change from running mode to design mode

 

 
Powered by phpBB® Forum Software