Show / Hide Table of Contents

Class PowerOfTwo

Provides static power of two calculations.

Inheritance
Object
PowerOfTwo
Namespace: DaggerfallConnect.Utility
Assembly: Assembly-CSharp.dll
Syntax
public static class PowerOfTwo

Methods

| Improve this Doc View Source

IsPowerOfTwo(Int32)

Check if value is a power of 2.

Declaration
public static bool IsPowerOfTwo(int x)
Parameters
Type Name Description
Int32 x

Value to check.

Returns
Type Description
Boolean

True if power of 2.

| Improve this Doc View Source

MipMapCount(Int32)

Gets count of mipmap levels for value.

Declaration
public static int MipMapCount(int x)
Parameters
Type Name Description
Int32 x

Value.

Returns
Type Description
Int32

Number of mipmap levels.

| Improve this Doc View Source

MipMapSize(Int32, Int32)

Gets size of mipmap from value x at level. Value x must already be a power of 2. Never returns lower than 1.

Declaration
public static int MipMapSize(int x, int level)
Parameters
Type Name Description
Int32 x

Value.

Int32 level

MipMap level.

Returns
Type Description
Int32

Size of mipmap at level.

| Improve this Doc View Source

NextPowerOfTwo(Int32)

Finds next power of 2 size for value.

Declaration
public static int NextPowerOfTwo(int x)
Parameters
Type Name Description
Int32 x

Value.

Returns
Type Description
Int32

Next power of 2.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX