Crash on creating a manual texture on OpenGL

Problems building or running the engine, queries about how to use features etc.
Post Reply
uzurpator
Gnoblar
Posts: 18
Joined: Mon Nov 27, 2006 5:35 pm

Crash on creating a manual texture on OpenGL

Post by uzurpator »

Hi.

I have a problem with the following code:

Code: Select all

        this->texture_ =
            Ogre::TextureManager::getSingleton().createManual
            (
                this->texture_name_.c_str(),
				g_par->resource_group_,
                Ogre::TEX_TYPE_2D,
                size_x,
                size_y,
                0,
                Ogre::PF_BYTE_RGBA,
                Ogre::TU_DEFAULT
            );
When running it, regardless of platform (win32 or linux) it crashes, throwing a segfault on Linux or acces violation on windows. I managed to snatch the following stack trace:

#0 0x07ac8c76 in glGenTextures () from /usr/lib/libGL.so.1
#1 0x07bf34c3 in Ogre::GLTexture::createInternalResourcesImpl (
this=0xb6a4f028) at OgreGLTexture.cpp:116
#2 0x00dc36ce in Ogre::Texture::createInternalResources (this=0xb6a4f028)
at OgreTexture.cpp:340
#3 0x00dc6d59 in Ogre::TextureManager::createManual (this=0xb6a31308,
name=@0xbfe0b2ac, group=@0x8e7cf7c, texType=Ogre::TEX_TYPE_2D, width=8,
height=8, depth=1, numMipmaps=0, format=Ogre::PF_A8B8G8R8, usage=261,
loader=0x0, hwGamma=false, fsaa=0) at OgreTextureManager.cpp:158
#4 0x08090e61 in Ogre::TextureManager::createManual (this=0xb6a31308,
name=@0xbfe0b2ac, group=@0x8e7cf7c, texType=Ogre::TEX_TYPE_2D, width=8,
height=8, num_mips=0, format=Ogre::PF_A8B8G8R8, usage=261, loader=0x0,
hwGammaCorrection=false, fsaa=0)
at /usr/local/include/OGRE/OgreTextureManager.h:332
#5 0x08090ba6 in te::dynamic_texture::createTexture (this=0x91f6ac8,
name=@0x91f6ae4, size={x = 8, y = 8})
at /home/wouter/projects/tempire/te3/trunk/te2/src/renderer/dynamic_texture.cpp:62
#6 0x0809d7e2 in temperature_map_impl (this=0x91f6ac8)
at /home/wouter/projects/tempire/te3/trunk/te2/src/weather/temperature_map.cpp:29
#7 0x080aefac in singleton (this=0x91f20fd, is_responsible_for_cleanup=true)
at /home/wouter/projects/tempire/te3/trunk/te2/src/utils/singleton.h:68
---Type <return> to continue, or q <return> to quit---
#8 0x080b23fe in terrain_impl (this=0x91f2068)
at /home/wouter/projects/tempire/te3/trunk/te2/src/terrain/terrain.cpp:29
#9 0x08087fae in singleton (this=0xbfe0b426, is_responsible_for_cleanup=true)
at /home/wouter/projects/tempire/te3/trunk/te2/src/utils/singleton.h:68
#10 0x080829d3 in main ()
at /home/wouter/projects/tempire/te3/trunk/te2/src/main.cpp:119
milacao
Goblin
Posts: 231
Joined: Thu May 08, 2008 10:39 am
Location: Barcelona, Spain

Re: Crash on creating a manual texture on OpenGL

Post by milacao »

* Can you post your Ogre.log?
* Have you installed the latest drivers for your graphics card?
* What are the values of this->texture_name_.c_str(), and g_par->resource_group_?
See http://www.giffgaff.com, the new people-powered brand new mobile operator!
uzurpator
Gnoblar
Posts: 18
Joined: Mon Nov 27, 2006 5:35 pm

Re: Crash on creating a manual texture on OpenGL

Post by uzurpator »

Ogre.log:

20:51:50: Creating resource group General
20:51:50: Creating resource group Internal
20:51:50: Creating resource group Autodetect
20:51:50: SceneManagerFactory for type 'DefaultSceneManager' registered.
20:51:50: Registering ResourceManager for type Material
20:51:50: Registering ResourceManager for type Mesh
20:51:50: Registering ResourceManager for type Skeleton
20:51:50: MovableObjectFactory for type 'ParticleSystem' registered.
20:51:50: OverlayElementFactory for type Panel registered.
20:51:50: OverlayElementFactory for type BorderPanel registered.
20:51:50: OverlayElementFactory for type TextArea registered.
20:51:50: Registering ResourceManager for type Font
20:51:50: ArchiveFactory for archive type FileSystem registered.
20:51:50: ArchiveFactory for archive type Zip registered.
20:51:50: FreeImage version: 3.10.0
20:51:50: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
20:51:50: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2
20:51:50: DDS codec registering
20:51:50: Registering ResourceManager for type HighLevelGpuProgram
20:51:50: Registering ResourceManager for type Compositor
20:51:50: MovableObjectFactory for type 'Entity' registered.
20:51:50: MovableObjectFactory for type 'Light' registered.
20:51:50: MovableObjectFactory for type 'BillboardSet' registered.
20:51:50: MovableObjectFactory for type 'ManualObject' registered.
20:51:50: MovableObjectFactory for type 'BillboardChain' registered.
20:51:50: MovableObjectFactory for type 'RibbonTrail' registered.
20:51:50: Loading library .\RenderSystem_Direct3D9_d
20:51:50: Installing plugin: D3D9 RenderSystem
20:51:50: D3D9 : Direct3D9 Rendering Subsystem created.
20:51:50: D3D9: Driver Detection Starts
20:51:50: D3D9: Driver Detection Ends
20:51:50: Plugin successfully installed
20:51:50: Loading library .\RenderSystem_GL_d
20:51:50: Installing plugin: GL RenderSystem
20:51:50: OpenGL Rendering Subsystem created.
20:51:51: Plugin successfully installed
20:51:51: Loading library .\Plugin_ParticleFX_d
20:51:51: Installing plugin: ParticleFX
20:51:51: Particle Emitter Type 'Point' registered
20:51:51: Particle Emitter Type 'Box' registered
20:51:51: Particle Emitter Type 'Ellipsoid' registered
20:51:51: Particle Emitter Type 'Cylinder' registered
20:51:51: Particle Emitter Type 'Ring' registered
20:51:51: Particle Emitter Type 'HollowEllipsoid' registered
20:51:51: Particle Affector Type 'LinearForce' registered
20:51:51: Particle Affector Type 'ColourFader' registered
20:51:51: Particle Affector Type 'ColourFader2' registered
20:51:51: Particle Affector Type 'ColourImage' registered
20:51:51: Particle Affector Type 'ColourInterpolator' registered
20:51:51: Particle Affector Type 'Scaler' registered
20:51:51: Particle Affector Type 'Rotator' registered
20:51:51: Particle Affector Type 'DirectionRandomiser' registered
20:51:51: Particle Affector Type 'DeflectorPlane' registered
20:51:51: Plugin successfully installed
20:51:51: Loading library .\Plugin_BSPSceneManager_d
20:51:51: Installing plugin: BSP Scene Manager
20:51:51: Plugin successfully installed
20:51:51: Loading library .\Plugin_OctreeSceneManager_d
20:51:51: Installing plugin: Octree & Terrain Scene Manager
20:51:51: Plugin successfully installed
20:51:51: Loading library .\Plugin_CgProgramManager_d
20:51:51: Installing plugin: Cg Program Manager
20:51:51: Plugin successfully installed
20:51:51: *-*-* OGRE Initialising
20:51:51: *-*-* Version 1.6.0 (Shoggoth)
20:51:51: Added resource location '../media' of type 'FileSystem' to resource group 'General'
20:51:51: Added resource location '../media/materials' of type 'FileSystem' to resource group 'General'
20:51:51: Added resource location '../media/textures' of type 'FileSystem' to resource group 'General'
20:51:51: Added resource location '../media/tiles' of type 'FileSystem' to resource group 'General'
20:51:51: Added resource location '../media/gui' of type 'FileSystem' to resource group 'General'
20:51:51: Added resource location '../media/fonts' of type 'FileSystem' to resource group 'General'
20:51:51: Added resource location '../media/meshes' of type 'FileSystem' to resource group 'General'
20:51:51: CPU Identifier & Features
20:51:51: -------------------------
20:51:51: * CPU ID: GenuineIntel: Intel(R) Core(TM)2 Quad CPU @ 2.40GHz
20:51:51: * SSE: yes
20:51:51: * SSE2: yes
20:51:51: * SSE3: yes
20:51:51: * MMX: yes
20:51:51: * MMXEXT: yes
20:51:51: * 3DNOW: no
20:51:51: * 3DNOWEXT: no
20:51:51: * CMOV: yes
20:51:51: * TSC: yes
20:51:51: * FPU: yes
20:51:51: * PRO: yes
20:51:51: * HT: no
20:51:51: -------------------------
20:51:51: *** Starting Win32GL Subsystem ***
20:51:51: Created Win32Window 'TEmpire' : 640x480, 32bpp
20:51:51: GL_VERSION = 2.1.7769 Release
20:51:51: GL_VENDOR = ATI Technologies Inc.
20:51:51: GL_RENDERER = ATI Radeon HD 3870
20:51:51: GL_EXTENSIONS = GL_AMDX_vertex_shader_tessellator GL_AMD_performance_monitor GL_ARB_color_buffer_float GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_fragment_program GL_ARB_fragment_shader GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_transpose_matrix GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_ATI_meminfo GL_ATI_separate_stencil GL_ATI_shader_texture_lod GL_ATI_texture_compression_3dc GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_copy_texture GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_gpu_program_parameters GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texgen_reflection GL_EXT_texture3D GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_shared_exponent GL_EXT_vertex_array GL_KTX_buffer_region GL_NV_blend_square GL_NV_texgen_reflection GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_WIN_swap_hint WGL_EXT_swap_control
20:51:51: Supported WGL extensions: WGL_ARB_extensions_string WGL_ARB_pixel_format WGL_ATI_pixel_format_float WGL_ARB_pixel_format_float WGL_ARB_multisample WGL_EXT_swap_control WGL_ARB_pbuffer WGL_ARB_render_texture WGL_ARB_make_current_read WGL_EXT_extensions_string WGL_ARB_buffer_region WGL_EXT_framebuffer_sRGB WGL_ATI_render_texture_rectangle WGL_EXT_pixel_format_packed_float
20:51:51: ***************************
20:51:51: *** GL Renderer Started ***
20:51:51: ***************************
20:51:51: Registering ResourceManager for type GpuProgram
20:51:51: GLSL support detected
20:51:51: GL: Using GL_EXT_framebuffer_object for rendering to textures (best)
20:51:51: FBO PF_UNKNOWN depth/stencil support: D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_L8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_L16 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_A8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_A4L4 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_BYTE_LA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_R5G6B5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_B5G6R5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_A4R4G4B4 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_A1R5G5B5 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_B8G8R8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_A8R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_B8G8R8A8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_A2R10G10B10 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_A2B10G10R10 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_FLOAT16_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_FLOAT32_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_FLOAT32_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_X8R8G8B8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_X8B8G8R8 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_SHORT_RGBA depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_R3G3B2 depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_FLOAT16_R depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_FLOAT32_R depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_SHORT_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_FLOAT16_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_FLOAT32_GR depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: FBO PF_SHORT_RGB depth/stencil support: D0S0 D0S1 D0S4 D0S8 D0S16 D16S0 D24S0 D32S0 Packed-D24S8
20:51:51: [GL] : Valid FBO targets PF_UNKNOWN PF_L8 PF_L16 PF_A8 PF_A4L4 PF_BYTE_LA PF_R5G6B5 PF_B5G6R5 PF_A4R4G4B4 PF_A1R5G5B5 PF_R8G8B8 PF_B8G8R8 PF_A8R8G8B8 PF_B8G8R8A8 PF_A2R10G10B10 PF_A2B10G10R10 PF_FLOAT16_RGB PF_FLOAT16_RGBA PF_FLOAT32_RGB PF_FLOAT32_RGBA PF_X8R8G8B8 PF_X8B8G8R8 PF_SHORT_RGBA PF_R3G3B2 PF_FLOAT16_R PF_FLOAT32_R PF_SHORT_GR PF_FLOAT16_GR PF_FLOAT32_GR PF_SHORT_RGB
20:51:51: RenderSystem capabilities
20:51:51: -------------------------
20:51:51: RenderSystem Name: OpenGL Rendering Subsystem
20:51:51: GPU Vendor: ati
20:51:51: Device Name: ATI Radeon HD 3870
20:51:51: Driver Version: 2.1.7769.0
20:51:51: * Fixed function pipeline: yes
20:51:51: * Hardware generation of mipmaps: yes
20:51:51: * Texture blending: yes
20:51:51: * Anisotropic texture filtering: yes
20:51:51: * Dot product texture operation: yes
20:51:51: * Cube mapping: yes
20:51:51: * Hardware stencil buffer: yes
20:51:51: - Stencil depth: 8
20:51:51: - Two sided stencil support: yes
20:51:51: - Wrap stencil values: yes
20:51:51: * Hardware vertex / index buffers: yes
20:51:51: * Vertex programs: yes
20:51:51: * Fragment programs: yes
20:51:51: * Geometry programs: no
20:51:51: * Supported Shader Profiles: arbfp1 arbvp1 glsl ps_1_1 ps_1_2 ps_1_3 ps_1_4
20:51:51: * Texture Compression: yes
20:51:51: - DXT: yes
20:51:51: - VTC: no
20:51:51: * Scissor Rectangle: yes
20:51:51: * Hardware Occlusion Query: yes
20:51:51: * User clip planes: yes
20:51:51: * VET_UBYTE4 vertex element type: yes
20:51:51: * Infinite far plane projection: yes
20:51:51: * Hardware render-to-texture: yes
20:51:51: * Floating point textures: yes
20:51:51: * Non-power-of-two textures: yes
20:51:51: * Volume textures: yes
20:51:51: * Multiple Render Targets: 4
20:51:51: - With different bit depths: yes
20:51:51: * Point Sprites: yes
20:51:51: * Extended point parameters: yes
20:51:51: * Max Point Size: 8192
20:51:51: * Vertex texture fetch: yes
20:51:51: - Max vertex textures: 16
20:51:51: - Vertex textures shared: yes
20:51:51: * Render to Vertex Buffer : no
20:51:51: * GL 1.5 without VBO workaround: no
20:51:51: * Frame Buffer objects: yes
20:51:51: * Frame Buffer objects (ARB extension): no
20:51:51: * Frame Buffer objects (ATI extension): no
20:51:51: * PBuffer suppport: no
20:51:51: * GL 1.5 without HW-occlusion workaround: no
20:51:51: Registering ResourceManager for type Texture
20:51:51: ResourceBackgroundQueue - threading disabled
20:51:51: Particle Renderer Type 'billboard' registered
20:51:51: SceneManagerFactory for type 'BspSceneManager' registered.
20:51:51: Registering ResourceManager for type BspLevel
20:51:51: SceneManagerFactory for type 'OctreeSceneManager' registered.
20:51:51: SceneManagerFactory for type 'TerrainSceneManager' registered.
20:51:51: Creating viewport on target 'TEmpire', rendering from camera 'camera', relative dimensions 8192L: 0 T: 0 W: 1 H: 1 ZOrder: 0
20:51:51: Viewport for camera 'camera', actual dimensions 8192L: 0 T: 0 W: 640 H: 480
20:51:51: Parsing scripts for resource group Autodetect
20:51:51: Finished parsing scripts for resource group Autodetect
20:51:51: Parsing scripts for resource group General
20:51:51: Parsing script terrain.material
20:51:51: Parsing script tools.material
20:51:51: Parsing script trees.material
20:51:51: Parsing script gui.material
20:51:51: Parsing script te.fontdef
20:51:51: Finished parsing scripts for resource group General
20:51:51: Parsing scripts for resource group Internal
20:51:51: Finished parsing scripts for resource group Internal

The values are:

this->texture_name_ = "te/WeatherMap" - it is unique
g_par->resource_group = Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME.

I don't have latest drivers, but they are fresh enough (like 3 or so months back). Besides it crashes on three distinctively different machines. D3D works fine.
milacao
Goblin
Posts: 231
Joined: Thu May 08, 2008 10:39 am
Location: Barcelona, Spain

Re: Crash on creating a manual texture on OpenGL

Post by milacao »

I've tried your code setting size_x and size_y to 512 and it works perfectly on Linux with OpenGL. Maybe your size variables have wrong values?
See http://www.giffgaff.com, the new people-powered brand new mobile operator!
Myke.
Gnoblar
Posts: 8
Joined: Thu Dec 04, 2008 12:20 pm

Re: Crash on creating a manual texture on OpenGL

Post by Myke. »

I've read somewhere that the texture size for manual texture should be of 2^n (256, 512, 1024, etc), so maybe that causes the problem.

regards,
Myke.
milacao
Goblin
Posts: 231
Joined: Thu May 08, 2008 10:39 am
Location: Barcelona, Spain

Re: Crash on creating a manual texture on OpenGL

Post by milacao »

No, it depends on your graphics card. I have an NVidia 8800GT and it supports non-power-of-two textures. You can check it in your Ogre.log, there is a line like this in the section "RenderSystem capabilities":

Code: Select all

09:23:34:  * Non-power-of-two textures: yes
See http://www.giffgaff.com, the new people-powered brand new mobile operator!
Myke.
Gnoblar
Posts: 8
Joined: Thu Dec 04, 2008 12:20 pm

Re: Crash on creating a manual texture on OpenGL

Post by Myke. »

k, good to know =)

thx
NukeBuster
Gnoblar
Posts: 1
Joined: Fri Feb 06, 2009 12:30 pm

Re: Crash on creating a manual texture on OpenGL

Post by NukeBuster »

milacao wrote:I've tried your code setting size_x and size_y to 512 and it works perfectly on Linux with OpenGL. Maybe your size variables have wrong values?
I have forced this size onto the texture loading and it still segfaults for me. (Using Linux and OpenGL)
NukeBuster

Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !

OpenTTD patch(es): Password at join
uzurpator
Gnoblar
Posts: 18
Joined: Mon Nov 27, 2006 5:35 pm

Re: Crash on creating a manual texture on OpenGL

Post by uzurpator »

Hello everyone. Sorry for digging out this topic. But I think I know the reason.

I am creating Ogre in its own thread. Along with a global lock for all rendering operations, obviously.

When I create the texture inside the dedicated renderer thread, it works fine. However, if I create texture from outside thread (my main game loop), I get a crash.

Should I assume that OpenGL renderer has some sort of thread specific storage data?
milacao
Goblin
Posts: 231
Joined: Thu May 08, 2008 10:39 am
Location: Barcelona, Spain

Re: Crash on creating a manual texture on OpenGL

Post by milacao »

Ohhh, yes! I also had problems when accesing Ogre features from a thread other than the one where Ogre was initialized and running. It happened in Ogre 1.4.9 with multi-threading support disabled. I haven't tried to enable it, but I assume it would work. Anyway, a workaround for that was to make the main class a Singleton, so that all calls run in the same and valid thread.
See http://www.giffgaff.com, the new people-powered brand new mobile operator!
Post Reply