Re: Windows GTK+ 2.24.10: Cairo contexts not rendering tosurface

Jeffrey Sheen <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAPYQ83nUz_0xRBLfBKAq81XwTsf+pnnPVsOG8YYWQ_z26V6+FA@mail.gmail.com>
After trying different VS 2015 Solution configurations (and abundant
breakpointing), I have established that it is not the .EXE->.LIB->Cairo API
call structure that is breaking Cairo surface rendering in my project.

The black test square can be rendered before, but not directly after, this
D3D9 API call:

Direct3DCreate9(D3D_SDK_VERSION)->CreateDevice( D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL, WindowHandle, D3DCREATE_HARDWARE_VERTEXPROCESSING,
&PresentParameters, &PDevice);

N.B. The object parameters are as follows:

WindowHandle 0x001b07f8 {unused=13111204 } HWND__ *
unused 13111204 int

PresentParameters {BackBufferWidth=0 BackBufferHeight=0
BackBufferFormat=D3DFMT_UNKNOWN (0) ...} _D3DPRESENT_PARAMETERS_
BackBufferWidth 0 unsigned int
BackBufferHeight 0 unsigned int
BackBufferFormat D3DFMT_UNKNOWN (0) _D3DFORMAT
BackBufferCount 1 unsigned int
MultiSampleType D3DMULTISAMPLE_NONE (0) _D3DMULTISAMPLE_TYPE
MultiSampleQuality 0 unsigned long
SwapEffect D3DSWAPEFFECT_DISCARD (1) _D3DSWAPEFFECT
+ hDeviceWindow 0x001b07f8 {unused=13111204 } HWND__ *
Windowed 1 int
EnableAutoDepthStencil 0 int
AutoDepthStencilFormat D3DFMT_UNKNOWN (0) _D3DFORMAT
Flags 1 unsigned long
FullScreen_RefreshRateInHz 0 unsigned int
PresentationInterval 0 unsigned int

PDevice 0x00000000 <NULL> IDirect3DDevice9 *
+ IUnknown <struct at NULL> IUnknown

As a reminder, the code for rendering the black test square is as below,
and the status of each Cairo API call returns "no error has occurred":


cairo_surface_t *surface;

cairo_t *cr;
cairo_status_t status;

surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 390, 60);
status = cairo_surface_status(surface);

cr = cairo_create(surface);
status = cairo_status(cr);

cairo_set_source_rgba(cr, 0, 0, 0, 1);
status = cairo_status(cr);

cairo_rectangle(cr, 175, 10, 40, 40);
status = cairo_status(cr);

cairo_fill(cr);
status = cairo_status(cr);

cairo_surface_flush(surface);
status = cairo_surface_write_to_png(surface, "f:\\cairo_test_pos_lib_member
_function.png");

cairo_destroy(cr);
cairo_surface_destroy(surface);

Can anyone suggest how to proceed from here?

N.B. I have removed the original Stack Overflow question, and created a new
question with this new information:

http://stackoverflow.com/questions/41986105/idirect3d9createdevice-
prevents-gtk-2-cairo-rendering

Cheers,

Jeff.

On 24 January 2017 at 00:37, <[email protected]> wrote:

> Hi Jeff,
>
> (sorry it the formatting does not look nice—I am replying on my phone)
>
>
>
> Only add the .lib’s to the “additional dependencies” to the .exe/.dll that
> will built in your project, not the static lib’s.  This should removed the
> warnings.
>
>
>
> Hope this helps.
>
>
>
> With blessings, and cheers!
>
>
>
> 從 Windows 10 手機傳送
>
> I have the same GTK-related parameters in both VS projects' settings (as
> per http://stackoverflow.com/questions/15906580/how-to-configure
> -gtk-on-visual-studio-2010).
>
>
>
> The only difference in output when building each is that I get a dozen
> linker warnings for my main project, all of the form:
>
> 1>gdk-win32-2.0.lib(libgdk-win32-2.0-0.dll) : warning LNK4006:
> __NULL_IMPORT_DESCRIPTOR already defined in gtk-win32-2.0.lib(libgtk-win32-2.0-0.dll);
> second definition ignored
>
> 1>gdk-win32-2.0.lib(libgdk-win32-2.0-0.dll) : warning LNK4221: This
> object file does not define any previously undefined public symbols, so it
> will not be used by any link operation that consumes this library
>
> I'd appreciate any advice.
>
>
>
> Jeff.
>
>
>
>
>

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.