# Renderers

## Included Versions

- **`cnc-ddraw - 7.1.0.0`**

## Recommendations

**`cnc-ddraw`** is Cactus' recommended video renderer for all versions
of Diablo II starting from **`1.00`** to **`1.13d`**. **`cnc-ddraw`** is
more compatible than **`glidewrapper`**, contains less issues, is
actively maintained, and has more features. It has the ability to 
dynamically resize the window resolution (not the internal resolution), 
set any custom window resolution, easily switch between window mode and 
full screen via a hotkey, and upscale the game's textures to look much 
better through the use of shaders. These are just a few of the features it 
has. Since **`cnc-ddraw`** is a **`DirectDraw`** implementation, any 
Glide related errors will no longer affect you.

## **`cnc-ddraw`**

The required files for **`cnc-ddraw`** are already included as part of the
Cactus Core Installation, specifically **`ddraw.dll`**, **`ddraw.ini`**,
and the **`Shaders`** directory.

#### Quick Testing

Try running Diablo II (Make sure you don't have any other settings
that can conflict with the renderer such as using **`-3dfx`**, **`-opengl`**,
or **`-w`** flags) and see if the game starts up. If the game starts up, see if
you can easily switch between full screen and window mode by pressing
**`[Alt] + [Enter]`**. If you can't switch between these modes, then the dll is
not being used to render the game. If it doesn't, you will need to continue
inspecting things yourself.

### Tweaking **`cnc-ddraw`**

You can tweak **`ddraw.ini`** to change any settings such as the window
resolution (not the internal resolution), renderer, shaders, etc.

#### Tweaking Shaders (The Game Look)

Cactus contains a carefully curated set of shaders from the upstream repository.
I'm using the **`jinc2-sharper`** shader as the default since it is an overall
good looking shader that still very closely resembles the original game.
You can play around with the included shaders and settings until you find a
combination that works for you.

To change the shader, just open the **`ddraw.ini`** file and change the
shader line to a different shader located in the **`Shaders`** directory:

```
shader=Shaders\windowed\jinc2-sharper.glsl
```

You can get more shaders from
[libretro's repository](https://github.com/libretro/glsl-shaders), however only
**`.glsl`** will work, if at all. **`cnc-ddraw`** states that they've only
implemented **`preliminary shader support`**.

### Hotkeys and Other

Since **`cnc-ddraw`** already has support to switch between full screen and
window mode for the game, you need to make sure you don't use the **`-w`** flag
since it's no longer necessary.

The following hotkeys are also available for you in game:

- **`[Alt] + [Enter]`** - Switches between Full Screen and Window Mode.
- **`[Ctrl] + [Alt]`** OR **`[Right Alt] + [Right Ctrl]`** - Unlocks the cursor.

If you happen to also play Diablo 1, you can use **`cnc-ddraw`** for it as well!

## General Problems

### Scrolling Letters

- Both **`Glide`** and **`DirectDraw`** have this problem, however the problem
  is experienced differently on both implementations. For **`Glide`**, it is
  much worse and more noticable. It seems it will happen not only when you
  start Diablo II, but it will also happen when you switch games as well
  (start a game, save and exit, and make a new game). For **`DirectDraw`**,
  this seems to only happen when you start Diablo II, but not in between games.
  Singling includes the [Scrolling Letters Fix](https://xyinn.org/diablo/videos/10.%20%5bDiablo%20II%5d%20Scrolling%20Letters%20Fix%20&%20Demo%20(Included%20in%20Singling_Cactus).mp4)
  for both implementations.
