# Problem with blitting & OpenGL

**URL:** <https://discourse.libsdl.org/t/problem-with-blitting-opengl/1753>\
**Category:** SDL Development\
**Created:** [February 10, 2000, 12:19pm UTC](https://discourse.libsdl.org/t/problem-with-blitting-opengl/1753 "2000-02-10T12:19:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franck\_Guillaud](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/f/a88e57/32.png) [@Franck\_Guillaud](https://discourse.libsdl.org/u/Franck_Guillaud)\
**Post date:** [February 10, 2000, 12:19pm UTC](https://discourse.libsdl.org/t/problem-with-blitting-opengl/1753/1 "2000-02-10T12:19:56Z")

</div>

Hello World,

If I miss a recent thread, excuse me.

I’m a new user to SDL (great great work btw). I use  
the OpenGL mode with 1.1 libs. I have SDL\_Surface to  
store my texture on the app side, and then transform them to  
OpenGL texture objects. My problem is that surface blitting  
copy only the red channel:

```
 If I have :

```

surface A depth 24 and with good pixel values (I checked),  
surface B depth 24, all values are 0 (I checked)

if I do SDL\_BlitSurface(A,NULL,B,NULL); to blit A on B,  
then B is filled with only the red channel after the blit. ☹

```
Is this a known problem ?

                        Franck.
```

---

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [February 10, 2000, 6:21pm UTC](https://discourse.libsdl.org/t/problem-with-blitting-opengl/1753/2 "2000-02-10T18:21:07Z")

</div>

> ```
> If I have :
> 
> ```

> surface A depth 24 and with good pixel values (I checked),  
> surface B depth 24, all values are 0 (I checked)

> if I do SDL\_BlitSurface(A,NULL,B,NULL); to blit A on B,  
> then B is filled with only the red channel after the blit. ☹

> ```
> Is this a known problem ?
> 
> ```

No, it is not.  
Can you send a sample app which reproduces this bug?

Ideally it would not use OpenGL, but blit from one surface to the other  
and then to the screen.

Thanks!  
-Sam Lantinga (slouken at [devolution.com](http://devolution.com))

Lead Programmer, Loki Entertainment Software–  
“Any sufficiently advanced bug is indistinguishable from a feature”  
– Rich Kulawiec

---

<div class="post-metadata">

**Author:** ![Franck\_Guillaud](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/f/a88e57/32.png) [@Franck\_Guillaud](https://discourse.libsdl.org/u/Franck_Guillaud)\
**Post date:** [February 10, 2000, 11:15pm UTC](https://discourse.libsdl.org/t/problem-with-blitting-opengl/1753/3 "2000-02-10T23:15:29Z")

</div>

Hello Sam,

```
Ok, I'll make a sample case. I think it only appens

```

when OpenGL is enabled. I’ll try both way.

```
                Franck.

```

Sam Lantinga wrote:\>

> Franck guillaud wrote
> 
> > if I do SDL\_BlitSurface(A,NULL,B,NULL); to blit A on B,  
> > then B is filled with only the red channel after the blit. ☹
> 
> > ```
> > Is this a known problem ?
> > 
> > ```
> 
> No, it is not.  
> Can you send a sample app which reproduces this bug?
> 
> Ideally it would not use OpenGL, but blit from one surface to the other  
> and then to the screen.
> 
> Thanks!
