Open ScanMountGoat opened 6 years ago
public static void LoadBaseLevelGenerateMipmaps<T>(TextureTarget textureTarget, int width, int height,
T[] baseMipLevel, int mipCount, InternalFormat internalFormat) where T : struct
{
// The number of mipmaps needs to be specified first.
int maxMipLevel = Math.Max(mipCount - 1, minMipLevel);
GL.TexParameter(textureTarget, TextureParameterName.TextureMaxLevel, maxMipLevel);
// Calculate the proper imageSize.
int baseImageSize = TextureFormatTools.CalculateImageSize(width, height, internalFormat);
// Load the first level.
GL.CompressedTexImage2D(textureTarget, 0, internalFormat, width, height, 0, baseImageSize, baseMipLevel);
GL.GenerateMipmap((GenerateMipmapTarget)textureTarget);
}
This could be an issue with the format and dimensions. The crash is from
GL.CompressedTexImage2D
.Passing the same parameters and an empty byte array of the same length into the method does not cause an exception with SFGraphics.
Error: Run Forge in debug mode in Visual Studio. Otherwise, the application will immediately exit.
System.AccessViolationException
File: DgnObj_SwitchStepOnce_B.Tex1.sbfres.zip