VGA library and WiFi library conflict?

I've been using the VGA library for some graphics sketches I've been working with on the Due. This has worked fine.

I decided I'd like to be able to control the VGA graphic display via WiFi. I have a official Arduino WiFi shield that I've gotten working independently. It took a bit of research in order to find out how to flash the firmware on the WiFi Shield to get it to work with IDE 1.5.3 and the Due, but it does work and transfers data back and forth across a socket connection. I wrote a Java application to test it, and seems to work fine.

However, once I try to combine the VGA library and the Wifi Library into the same sketch, nothing seems to work. No Serial output, no VGA output, no WiFi connection. I assume there's either a DMA, SPI, or timer interrupt conflict.

This simple code does not work. I'm not even accessing the WiFi or SPI libraries at all, but somehow just including them is causing the VGA library to quit working:

#include <WiFi.h>
#include <SPI.h>
#include <VGA.h>

void setup() {
  //Start the serial connection.

  //Start the VGA library at 320x240 resolution at 8-bit color.
}//End setup

void loop() {

  //Fill the frame buffer.
  for (int y=0;y<240;y++)
    for (int x=0;x<320;x++)
      //Generate random color.
      byte color =random(255);

      //The serial calls make the VGA display very slow
      //but have this here to make sure it's working.
      Serial.print(") = ");

      //Draw the color on the screen.


}//End loop

However, commenting out

#include <WiFi.h>

allows the VGA display to work correctly.

Any thoughts on what the conflict is here, or what could be done to work-around the problem?

I think you might have to #include <WiFi.h> after SPI.h - that's what the other WiFi examples do. I can't help much as I haven't got an Arduino WiFi shield.

As for whether the two libraries will work together, VGA is very resource intensive, but WiFi isn't. Hopefully there's a good chance of getting them to work together somehow. I've had VGA working successfully with a WiFly but that just uses serial.