Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdl: WIP removed old surface, try to use Renderer #2149

Closed
wants to merge 5 commits into from
Closed

sdl: WIP removed old surface, try to use Renderer #2149

wants to merge 5 commits into from

Conversation

rafal1137
Copy link
Member

Main reason for this one is to eliminate issues with Nvidia Graphic Drivers when legacy is compiled using not bundled lib.

In my case Nvidia is using nouveau. I know its bad one should test with a better one.

@rafal1137 rafal1137 self-assigned this Sep 19, 2022
@rafal1137 rafal1137 added cat: client Category engine (client, renderer, sdl) P1: Urgent Priority 1 labels Sep 19, 2022
@rafal1137
Copy link
Member Author

The more I digged into SDL. Its gets clearly there is something wrong with using SDL_LoadBMP and those too

	SDL_RWops *rw = SDL_RWFromConstMem(src_sdl_splash_bmp, sizeof(src_sdl_splash_bmp));
	SDL_Surface* surface = SDL_LoadBMP_RW(rw, 1);

Even I did tried to use some sdl render textures tutorials within our codebase and everytime I am getting white image
I am more convinced of using opengl implementation of drawing textures.

@rafal1137
Copy link
Member Author

I will post dissembled part of the famous glTexImage2D function

#8  0xe2c03b06 in Upload32 (data=0xffffc30c, width=8, height=8, mipmap=qfalse, picmip=qfalse, lightMap=qfalse, format=0x5937c898, pUploadWidth=0x5937c888, pUploadHeight=0x5937c88c, noCompress=qtrue)
    at /home/rafal/Pobrane/etlegacy/src/renderer/tr_image.c:771
771                             glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
(gdb) disassemble glTexImage2D
Dump of assembler code for function glTexImage2D:
   0xe2bb4540 <+0>:     mov    %gs:0xffffff7c,%eax
   0xe2bb4546 <+6>:     jmp    *0x2e0(%eax)
   0xe2bb454c <+12>:    cmp    (%edx),%al
   0xe2bb454e <+14>:    add    %cl,0x3880(%ebx)
   0xe2bb4554 <+20>:    add    %ah,-0x75(%ebp)
   0xe2bb4557 <+23>:    add    %bh,%bh
   0xe2bb4559 <+25>:    mov    0x28a8,%al
   0xe2bb455e <+30>:    xchg   %ax,%ax   <= Can it swap between same operands ?
End of assembler dump.

PS: Check <=

@rafal1137
Copy link
Member Author

Solved by Jacker closing.

@rafal1137 rafal1137 closed this Nov 4, 2022
@rafal1137 rafal1137 deleted the wip_splash branch September 3, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat: client Category engine (client, renderer, sdl) P1: Urgent Priority 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant